diff options
| author | untodesu <kirill@untode.su> | 2025-03-22 15:08:17 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-03-22 15:08:17 +0500 |
| commit | e34a973f647bc6b7814ad1f3e837689f8478b84a (patch) | |
| tree | 7c8cb1702c16eb68e7acf942d46633a3833bba00 /game/server/sessions.cc | |
| parent | d8f0fcb101c21b3c4d746d20da6e56e7591006e4 (diff) | |
| download | voxelius-e34a973f647bc6b7814ad1f3e837689f8478b84a.tar.bz2 voxelius-e34a973f647bc6b7814ad1f3e837689f8478b84a.zip | |
A bunch of pre-release fixes
- Updated localization for protocol messages
- Added item registry check into server-side
- Slightly improved how features are stored
Diffstat (limited to 'game/server/sessions.cc')
| -rw-r--r-- | game/server/sessions.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/game/server/sessions.cc b/game/server/sessions.cc index f2e643d..58f12d4 100644 --- a/game/server/sessions.cc +++ b/game/server/sessions.cc @@ -11,6 +11,7 @@ #include "shared/dimension.hh" #include "shared/factory.hh" #include "shared/head.hh" +#include "shared/item_registry.hh" #include "shared/player.hh" #include "shared/protocol.hh" #include "shared/transform.hh" @@ -56,13 +57,20 @@ static void on_login_request_packet(const protocol::LoginRequest &packet) // FIXME: calculate voxel registry checksum ahead of time // instead of figuring it out every time a new player connects - if(packet.voxel_def_checksum != voxel_registry::checksum()) { + if(packet.voxel_registry_checksum != voxel_registry::calcualte_checksum()) { protocol::Disconnect response; response.reason = "protocol.voxel_registry_checksum"; protocol::send(packet.peer, protocol::encode(response)); return; } + if(packet.item_registry_checksum != item_registry::calcualte_checksum()) { + protocol::Disconnect response; + response.reason = "protocol.item_registry_checksum"; + protocol::send(packet.peer, protocol::encode(response)); + return; + } + // Don't assign new usernames and just kick the player if // an another client using the same username is already connected // and playing; since we have a whitelist, adding "(1)" isn't feasible anymore |
