10-24-2011, 09:29 AM
- Moved this thread to a more suitable forum -
MCServer Development Discussion
|
10-24-2011, 09:29 AM
- Moved this thread to a more suitable forum -
(10-24-2011, 09:29 AM)FakeTruth Wrote: - Moved this thread to a more suitable forum - nice Watching these kids talk on the server thinking it's a bukkit server is hilarious. The health message is definitely causing crashes. I can't see what's causing it though. The the message "Entity was not in chunk..." comes up there's also a bit of lag the the server stops responding. I found this in cClientHandle.cpp Code: case E_BLOCK_DIG: I *think* that's cause by using a client nuke with a tool in hand.
Yes, as you can see there's no security, once the server receives the block dig packet, it will simply destroy the block (even if it's bedrock/adminium).
The security is relatively easy to implement. According to this digging has a couple of stages. Once the packet has been received for "start digging", store the XYZ coordinates and the current time. Once the packet for "finished digging" is received, check coordinates and make sure enough time has elapsed before breaking the block. ??? profit
10-24-2011, 09:50 AM
That sounds easy enough. If someone sends finished digging too quickly the packet can be ignored. If it happens too many times it should probably kick or temp ban them.
Be aware that some blocks only send finished digging, and no start digging because they break in one hit, for example flowers and tnt.
Another trick you can use is to check if the block the player is digging is within range of the player
11-06-2011, 05:28 AM
Hi! I tried to compile the server with Visual C++ 2010 Express. First of all, it thrown an error about missing 'afxres.h' but when I replaced it with 'windows.h' then the compilation went fine.
After I tried to run the server, it crashed during terrain generation (in noise.cpp, cNoise::SSE_IntNoise2D, Illegal instruction). I ran it with generated map, it runs fine but whenever a new chunk is generated it crashes, did you encounter similar problems before?
This seems to be a problem with any AMD processor right now. To fix it find and replace all instance of "SSE_" with "" without the quotes in source/cChunk.cpp
In other words, just delete every instance of "SSE_" without the quotes, but keep the rest of the function name in there, the old noise generation functions are still in the code.
11-06-2011, 06:45 AM
Thanks, it worked.
I noticed cWorld::GetBlock and cWorld::GetBlockMeta both return char, wouldn't unsigned char be more suitable?
11-06-2011, 07:21 AM
(11-06-2011, 06:45 AM)Sebi Wrote: Thanks, it worked.AFAIK Java does not have unsigned chars so there's no benefit in making it an unsigned char in C++. Also if you know Notch, he might do something funky with it later which might require it to be a signed char
11-06-2011, 08:12 AM
Notch's thoughts: *I'm running out of block ids!* *Idea! Let's use negative ids!* :V
Also, in cPlayer.cpp (and also somewhere in monster file) at line 265 you have Code: char block = GetWorld()->GetBlock( (int)m_Pos->x, (int)m_Pos->y, (int)m_Pos->z ); Something like this shall do: Code: #define float2int(x) ((x)<0 ? ((int)(x))-1 : (int)(x)) |
« Next Oldest | Next Newest »
|