Skip to content

hotfix: Improve lobby performance - #41

Merged
x64-dev merged 2 commits into
GeneralsOnlineDevelopmentTeam:mainfrom
Skyaero42:hotfix/lobby-performance
Aug 15, 2026
Merged

hotfix: Improve lobby performance#41
x64-dev merged 2 commits into
GeneralsOnlineDevelopmentTeam:mainfrom
Skyaero42:hotfix/lobby-performance

Conversation

@Skyaero42

@Skyaero42 Skyaero42 commented Aug 15, 2026

Copy link
Copy Markdown

Possible solution for the server issues of late.
PR consists of two commits, each solving a particular issue.

Commit 1: Move ProcessLobbbiesNeedingDestroyed()into its own lobby timer to prevent blocking of Tick() actions

The destruction of lobbies involves the processing of game results and statistics, involving multiple database calls. This is a synchronous process and is being awaited by the Tick() function. The next Tick() event call and update of lobbies does not proceed until ProcessLobbiesNeedingDestroyed() has finished.

The hotfix solution is to remove ProcessLobbbiesNeedingDestroyed() from Tick() and creation of a new seperate timer that handles ProcessLobbbiesNeedingDestroyed()

Commit 2: Prevent unnecessary creation of AppDbContext

A new AppDbContext is created for every LobbyManager.DeleteLobby() call and Lobby.UpdateState call.
Database contexts should not be recreated for every call, but reused as much as possible.

Hotfix solution is to move the creation of AppDbContext to the constructors of LobbyManager and Lobby.

The implementations have not been tested.

Bart Roossien added 2 commits August 15, 2026 20:15
Move AppDbContext instance to class level instead of method level in Lobby and LobbyManager to prevent unnecessary database connection creation
@Skyaero42 Skyaero42 changed the title Hotfix/lobby performance hotfix: Improve lobby performance Aug 15, 2026
@x64-dev
x64-dev merged commit e3811a6 into GeneralsOnlineDevelopmentTeam:main Aug 15, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants