Skip to content

fix: bug fixes related to client-server communication, lobby and room management, and game state handling.#345

Merged
romain1717 merged 13 commits into
mainfrom
342-feat-interpolation-errors-during-big-lags
Jan 18, 2026
Merged

fix: bug fixes related to client-server communication, lobby and room management, and game state handling.#345
romain1717 merged 13 commits into
mainfrom
342-feat-interpolation-errors-during-big-lags

Conversation

@romain1717

Copy link
Copy Markdown
Collaborator

This pull request introduces several improvements and bug fixes related to client-server communication, lobby and room management, and game state handling. The main focus is on ensuring correct state transitions, improving event handling, and optimizing lobby refresh behavior.

Client Event Handling and State Management:

  • Added checks to ensure that certain events (like starting a game or updating a room) only occur in appropriate states (e.g., only in LobbyState), preventing invalid state transitions. Also, the world is now reset only when starting a game from the lobby. [1] [2]
  • Refactored event handling for room updates and leaving rooms to streamline logic and ensure the world is reset at the correct times.

Networking and Packet Handling:

  • Updated the logic for sending room info packets to always use a new request ID, ensuring better tracking of requests and responses.
  • On the server side, modified the logic for sending accept packets so that each packet is sent three times for reliability.

Lobby and Room UI Improvements:

  • Increased the lobby refresh period from 500ms to 1000ms to reduce unnecessary network traffic and UI updates.
  • Fixed a UI bug where the create room flag was not reset when switching from the join page to the list page in the room menu.

Other Notable Changes:

  • Improved ECS registry reset logic to avoid unnecessary allocations by clearing before reinitializing.
  • Prevented room updates from being processed while in the game state, avoiding potential inconsistencies.

@romain1717 romain1717 self-assigned this Jan 18, 2026
Copilot AI review requested due to automatic review settings January 18, 2026 21:13
@romain1717 romain1717 added bug Something isn't working server Issues related to the server-side implementation. labels Jan 18, 2026
@romain1717 romain1717 linked an issue Jan 18, 2026 that may be closed by this pull request
@romain1717 romain1717 added the client Issues related to the client-side code. label Jan 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request addresses several bug fixes and improvements related to client-server communication, lobby management, and game state handling. The changes focus on preventing invalid state transitions, optimizing network traffic, and ensuring proper resource cleanup.

Changes:

  • Added state validation checks to prevent game start and room update requests from being processed in invalid states
  • Modified server-side UDP packet handling to send accept packets three times for improved reliability
  • Increased lobby refresh period from 500ms to 1000ms to reduce network traffic
  • Fixed UI bug where the create room flag was not properly reset when switching pages

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
server/src/game/gameServer/GameServer.cpp Modified accept packet sending to transmit three times for reliability
client/src/ui/rooms/RoomMenu.cpp Added reset of _createRoom flag when switching to join page
client/src/ui/lobby/Lobby.hpp Increased lobby refresh period from 500ms to 1000ms
client/src/thread/ClientRuntime.cpp Added state validation for game start and room update requests; refactored event handlers; added GameState check to prevent room updates during gameplay
client/src/game/world/ClientWorld.cpp Modified registry reset to call clear() before reassignment

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread server/src/game/gameServer/GameServer.cpp
Comment thread client/src/game/world/ClientWorld.cpp

@ann7415 ann7415 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

@Rosh7887epitech Rosh7887epitech left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

@romain1717 romain1717 merged commit debb225 into main Jan 18, 2026
16 checks passed
@romain1717 romain1717 deleted the 342-feat-interpolation-errors-during-big-lags branch January 18, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working client Issues related to the client-side code. server Issues related to the server-side implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Interpolation errors during big lags

4 participants