itsapi / pycraft

A Minecraft-inspired game for the terminal
GNU General Public License v2.0
197 stars 21 forks source link

Server Unloading Slices #139

Open olls opened 7 years ago

olls commented 7 years ago

In the Game object, we have the reload_slices method (triggered by event_unload_slices from a client after loading chunks) which trims the loaded map down to the edges of all the players. But the edges item of a player dictionary is only added after that player calls event_unload_slices.

So if a new-to-the-server player logs in as another player triggers event_unload_slices, the new players slices (which they had just loaded) will be unloaded on the server, meaning any modifications to those slices by the new player will not be saved on the server until the player reloads the chunks containing those slices.