Repository navigation
0.5.0
Plasocket 0.5.0 - The World Persistence Update
This release introduces significant enhancements to world management, including persistent world saving, block modification settings, and a more robust server architecture.
New Features
- Persistent World Saving & Loading:
- The server now automatically saves the world grid to
worlds/world.pwat a configurable interval (world_save_interval_sinserver.conf). - World data is loaded from
worlds/world.pwon startup. If the file doesn't exist, a default world (grass, dirt, stone layers) is automatically generated. - World data is saved using an RLE (Run-Length Encoding) JSON format, making the world files more efficient.
- A final world save is performed gracefully when the server is shut down (e.g., via Ctrl+C).
- The server now automatically saves the world grid to
- Configurable Block Modification (Read-Only Mode):
- A new
block_modificationoption inserver.conf(defaulting tofalse) allows administrators to control whether clients can modify the world. - When
block_modificationisfalse(read-only mode), client-sidePLACEandERASEactions are immediately reverted by the server, providing a read-only experience.
- A new
- Enhanced World Data Handling:
- The server now maintains an in-memory
WORLD_GRIDto represent the game world, allowing for efficient block updates and persistent storage. - RLE encoding/decoding functions (
rle_encode,rle_decode) have been implemented for efficient world data transmission and storage.
- The server now maintains an in-memory
- Improved Dependency Management:
- The
check_and_install_dependenciesfunction is now called at the very beginning ofmainto ensure all necessary modules (likewebsocketsandconfigparser) are available before the server attempts to use them. - The dependency check now forces a server restart if packages are installed, ensuring they are loaded correctly.
- The
- Refined Configuration Handling:
- The
server.conffile now automatically includes any missing default configuration options when loaded, ensuring the configuration is always up-to-date with new server features without requiring manual edits. - More robust error handling for reading the
server.conffile.
- The
- Internal API & Code Improvements:
- The
ServerAPIclass passed to plugins now includes a reference to thewebsocketsmodule itself, allowing plugins more flexibility. - Refactored
mainfunction to separate setup andasyncio.runmore cleanly. - Improved logging for block modifications and read-only mode actions.
- Centralized global variables for better state management.
- The server version is now exposed as
SERVER_VERSION = "0.5.0".
- The