Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
2017-01-22 07:50:02: ERROR[Server]: ServerEnv: Trying to store id=2863 statically but block (-61,-2,-56) already contains 90 objects. Forcing delete.
2017-01-22 07:50:02: ERROR[Server]: ServerEnv: Trying to store id=2864 statically but block (-61,-2,-56) already contains 90 objects. Forcing delete.
2017-01-22 07:50:02: ERROR[Server]: ServerEnv: Trying to store id=2865 statically but block (-61,-2,-56) already contains 90 objects. Forcing delete.
2017-01-22 07:50:02: ERROR[Server]: ServerEnv: Trying to store id=2866 statically but block (-61,-2,-56) already contains 90 objects. Forcing delete.
2017-01-22 07:50:02: ERROR[Server]: ServerEnv: Trying to store id=2867 statically but block (-61,-2,-56) already contains 90 objects. Forcing delete.
2017-01-22 07:50:02: ERROR[Server]: ServerEnv: Trying to store id=2868 statically but block (-61,-2,-56) already contains 90 objects. Forcing delete.
2017-01-22 07:50:02: ERROR[Server]: ServerEnv: Trying to store id=2869 statically but block (-61,-2,-56) already contains 90 objects. Forcing delete.
2017-01-22 07:50:02: ERROR[Server]: ServerEnv: Trying to store id=2870 statically but block (-61,-2,-56) already contains 90 objects. Forcing delete.
2017-01-22 07:50:02: ERROR[Server]: Server::ProcessData(): Canceling: No player for peer_id=2954 disconnecting peer!
2017-01-22 07:50:02: ERROR[Server]: Server::ProcessData(): Canceling: No player for peer_id=2789 disconnecting peer!
2017-01-22 07:50:02: ERROR[Server]: Server::ProcessData(): Canceling: No player for peer_id=2947 disconnecting peer!
Evidently there a correlation between the static object storage errors and the invalid peer-id's, as they always occur simultaneously. So for purposes of debugging, I set max_objects_per_block to 5 and edited the function deactivateFarObjects( ) in src/environment.cpp as follows:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
if( obj->getType() == ACTIVEOBJECT_TYPE_PLAYER )
{
warningstream << "Attempting to delete Player SAO id=" << obj->getId( ) << " from block " << PP(blockpos_o) << std::endl;
}
else if( m_active_blocks.contains(blockpos_o) )
{
warningstream << "Attempting to delete object id=" << obj->getId( ) << " from active block " << PP(blockpos_o) << std::endl;
}
Sure enough, after dropping my entire inventory at spawn and logging off, thereby deactivating the associated map block (-1,0,0), then objects within the active map block (-4,0,1) were also deleted:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
2017-01-22 18:00:33: ACTION[Server]: sorcerykid leaves game. List of players: publicworks, parkdistrict
2017-01-22 18:00:33: ERROR[Server]: ServerEnv: Trying to store id=15 statically but block (-1,0,0) already contains 5 objects. Forcing delete.
2017-01-22 18:00:33: ERROR[Server]: ServerEnv: Trying to store id=17 statically but block (-1,0,0) already contains 5 objects. Forcing delete.
2017-01-22 18:00:33: ERROR[Server]: ServerEnv: Trying to store id=18 statically but block (-1,0,0) already contains 5 objects. Forcing delete.
2017-01-22 18:00:33: WARNING[Server]: Attempting to delete Player SAO id=19 from block (-4,0,1)
2017-01-22 18:00:33: WARNING[Server]: Attempting to delete object id=20 from active block (-4,0,1)
2017-01-22 18:00:33: WARNING[Server]: Attempting to delete object id=21 from active block (-4,0,1)
It would appear as soon as the max_objects_per_block threshold is exceeded in any single map block, then all remaining objects within the entire map are deleted as well. This affects non-static objects including PlayerSAOs. No warnings, no callbacks, no cleanup. This is of particular concern for TNT explosions, which can spawn hundreds of objects in a single map block.
The issue is complicated by several factors. First and foremost, once force_delete is set, then every object is queued for deletion even if the associated map block is still active. This is due to a flaw in the following conditional
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
// If block is active, don't remove
if(!force_delete && m_active_blocks.contains(blockpos_o))
continue;
Clearly this should NOT be an "and" operation, otherwise force_delete from any prior iteration can override the active map block status in all successive iterations, resulting in unintended side-affects.
Secondly, even after obj->isStaticAllowed() is validated, the object can still be deleted regardless of whether it is static object or not. Perhaps this is intentional? I'm not sure. But in the very least, it would be prudent to short circuit whenever encountering a Player SAO. This should afford a reasonable sanity check, I would think:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
// Ignore active map blocks and ignore PlayerSAOs
if(m_active_blocks.contains(blockpos_o) || obj->getType() == ACTIVEOBJECT_TYPE_PLAYER)
continue;
This is a critical bug in Minetest 0.4.14, and is likely impacting many other servers.
I hope that an appropriate patch can be made available very soon. In the meantime, the workaround proposed above should suffice.