MCServer Development Discussion - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html) +--- Forum: Development (https://forum.cuberite.org/forum-13.html) +--- Thread: MCServer Development Discussion (/thread-186.html) |
RE: MCServer Development Discussion - FakeTruth - 10-24-2011 - Moved this thread to a more suitable forum - RE: MCServer Development Discussion - rs2k - 10-24-2011 (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. RE: MCServer Development Discussion - FakeTruth - 10-24-2011 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 RE: MCServer Development Discussion - rs2k - 10-24-2011 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. RE: MCServer Development Discussion - FakeTruth - 10-24-2011 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 RE: MCServer Development Discussion - Sebi - 11-06-2011 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? RE: MCServer Development Discussion - rs2k - 11-06-2011 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. RE: MCServer Development Discussion - Sebi - 11-06-2011 Thanks, it worked. I noticed cWorld::GetBlock and cWorld::GetBlockMeta both return char, wouldn't unsigned char be more suitable? RE: MCServer Development Discussion - FakeTruth - 11-06-2011 (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 RE: MCServer Development Discussion - Sebi - 11-06-2011 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)) |