diff options
| author | Aldrik Ramaekers <aldrik@amftech.nl> | 2023-11-02 18:24:46 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@amftech.nl> | 2023-11-02 18:24:46 +0100 |
| commit | 11fc04b238ff9d42b17e6befa6ab4a673606fc1a (patch) | |
| tree | cf4f48820fe3c55ed98c39038352924fab682ca8 /src/game.c | |
| parent | 0648e9ec83977fe5151896097afd1dbae3f4143b (diff) | |
throwables on server side
Diffstat (limited to 'src/game.c')
| -rw-r--r-- | src/game.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -174,6 +174,11 @@ void update_server(platform_window* window) { } break; + case MESSAGE_USER_THROW: { + protocol_user_throw* throw_msg = (protocol_user_throw*)msg->message; + throw_throwable(throw_msg->id, throw_msg->throwable, throw_msg->dirx, throw_msg->diry); + } break; + case MESSAGE_USER_MOVED: { protocol_move* move_msg = (protocol_move*)msg->message; move_user(window, move_msg->id, move_msg->move, move_msg->delta); @@ -225,6 +230,7 @@ void update_server(platform_window* window) { broadcast_to_clients(create_protocol_zombie_list()); broadcast_to_clients(create_protocol_bullets_list()); broadcast_to_clients(create_protocol_drop_list()); + broadcast_to_clients(create_protocol_throwables_list()); // play sounds locally and send them to clients. play_sounds_in_queue(); @@ -286,6 +292,11 @@ void update_client(platform_window* window) { memcpy(zombies, msg_zombies->zombies, sizeof(zombies)); } break; + case MESSAGE_THROWABLES_LIST: { + protocol_throwables_list* msg_throwables = (protocol_throwables_list*)msg; + memcpy(throwables, msg_throwables->throwables, sizeof(throwables)); + } break; + case MESSAGE_BULLET_LIST: { protocol_bullets_list* msg_bullets = (protocol_bullets_list*)msg; load_bullets_into_existing_list(msg_bullets); |
