Critical bug in MCServer
#22
Special implementations sound ok, as long as there aren't too many. I wouldn't have wanted to call something like:
Code:
m_World->DoInChunk(ChunkX, ChunkZ, cSetBlock(BlockX, BlockY, BlockZ, E_BLOCKID_IRONORE));
Instead, we'll keep the SetBlock() function, calling this instead:
Code:
m_world->SetBlock(BlockX, BlockY, BlockZ, E_BLOCKID_IRONORE);

However, those callback classes are still useful - see the webplugin's cWebAdmin.cpp, class cPlayerAccum. It includes a string buffer into which all the players are accummulated, HTML-formatted, one-by-one, in a single function call. Thread-safe and everything.
The thread safety is of utmost importance here - the ForEachXXX() function needs to lock the list of objects it is working on, process the callbacks and unlock the list - so that no other thread can manipulate the list under its hands.
Calling Lock, GetAll, Process, Unlock is not a good solution because someone, somewhere is always gonna forget to lock or unlock (and RAII doesn't work well for this)

Finally, I have a vision that the future cChunkMap object will not let a single cChunkPtr out of it, it will only accept coordinates and actions as the parameters for all its functions. Thus, it could finally be pronounced thread-safe, including chunk access Smile

I think the current "bad compressed data format" errors are the result of two threads colliding on a single chunk - one thread writes blockdata, the other thread is in the compressino routine. The compression looks at a value, decides to use some algorithm on it and before the algorithm starts, the value gets changed by the other thread -> bang, invalid compressed data. I'll get working on this issue as soon as possible.
Thanks given by:


Messages In This Thread
Critical bug in MCServer - by FakeTruth - 01-01-2012, 02:21 PM
RE: Critical bug in MCServer - by mtilden - 01-01-2012, 11:05 PM
RE: Critical bug in MCServer - by Lapayo - 01-01-2012, 11:47 PM
RE: Critical bug in MCServer - by FakeTruth - 01-02-2012, 12:21 AM
RE: Critical bug in MCServer - by xoft - 02-08-2012, 11:44 PM
RE: Critical bug in MCServer - by FakeTruth - 02-09-2012, 12:23 AM
RE: Critical bug in MCServer - by xoft - 02-09-2012, 03:26 AM
RE: Critical bug in MCServer - by xoft - 02-10-2012, 01:44 AM
RE: Critical bug in MCServer - by FakeTruth - 02-10-2012, 02:05 AM
RE: Critical bug in MCServer - by xoft - 02-10-2012, 07:28 AM
RE: Critical bug in MCServer - by xoft - 02-13-2012, 05:46 AM
RE: Critical bug in MCServer - by tbar - 02-13-2012, 07:53 PM
RE: Critical bug in MCServer - by xoft - 02-14-2012, 07:59 AM
RE: Critical bug in MCServer - by tbar - 02-14-2012, 06:35 PM
RE: Critical bug in MCServer - by xoft - 02-14-2012, 11:10 PM
RE: Critical bug in MCServer - by FakeTruth - 02-14-2012, 09:29 PM
RE: Critical bug in MCServer - by FakeTruth - 02-14-2012, 11:41 PM
RE: Critical bug in MCServer - by xoft - 02-14-2012, 11:53 PM
RE: Critical bug in MCServer - by FakeTruth - 02-15-2012, 12:00 AM
RE: Critical bug in MCServer - by xoft - 02-15-2012, 12:24 AM
RE: Critical bug in MCServer - by FakeTruth - 02-15-2012, 12:38 AM
RE: Critical bug in MCServer - by xoft - 02-15-2012, 03:05 AM
RE: Critical bug in MCServer - by NiLSPACE - 02-15-2012, 03:18 AM
RE: Critical bug in MCServer - by FakeTruth - 02-15-2012, 05:16 AM
RE: Critical bug in MCServer - by xoft - 02-15-2012, 06:36 AM
RE: Critical bug in MCServer - by FakeTruth - 02-15-2012, 07:10 AM
RE: Critical bug in MCServer - by xoft - 02-15-2012, 07:14 AM
RE: Critical bug in MCServer - by FakeTruth - 02-15-2012, 07:26 AM
RE: Critical bug in MCServer - by FakeTruth - 02-15-2012, 11:22 PM
RE: Critical bug in MCServer - by Boo - 02-16-2012, 04:08 PM
RE: Critical bug in MCServer - by xoft - 02-16-2012, 07:37 PM
RE: Critical bug in MCServer - by Boo - 02-16-2012, 08:26 PM
RE: Critical bug in MCServer - by FakeTruth - 02-16-2012, 08:57 PM
RE: Critical bug in MCServer - by Boo - 02-16-2012, 09:32 PM
RE: Critical bug in MCServer - by FakeTruth - 02-16-2012, 09:57 PM



Users browsing this thread: 3 Guest(s)