Skip to content

Changing game cvar does not switch game and cgame modules correctly #906

Description

@MovoWR

Description

Changing game in the console should switch Quetoo to a different game folder on the next map. For example, game banana should switch to the banana folder.

That switch has two parts:

  1. The server should load game.dll from the new folder.
  2. The client should load cgame.dll from the new folder.

Right now one or both parts can fail. The server may still load the old game.dll, and the client may still keep the old cgame.dll.

This can leave the game in a mixed state: server logic comes from one game folder, but the client HUD, UI, and prediction come from another.

Steps to Reproduce

  1. For testing, copy lib/default and rename the copy to lib/banana.
  2. Launch Quetoo with the default game module.
  3. Open the console and type: game banana.
  4. Load a map: map warehouse.
  5. Check the console output for which game.dll was loaded.
  6. Check whether the log loads game.dll and cgame.dll from lib/banana.

Expected Behavior

After changing game and loading a map:

  1. The server should switch to the new game folder before it loads game.dll.
  2. The server should load lib/banana/game.dll.
  3. The client should see that the server is using banana.
  4. The client should reload cgame and load lib/banana/cgame.dll.

Actual Behavior

The server may load the old game module, lib/default/game.dll, because the new game folder is added too late.

The client may also keep the old cgame module, lib/default/cgame.dll. Console only shows cgame.dll loading once at startup from lib/default; after switching to banana, there is no later lib/banana/cgame.dll load line.

Environment

  • OS: Windows 11
  • Quetoo version: 9966
  • Build type: Release

Logs / Output

HTTP server listening on port 1998
Parsed 24 maps from maps.lst
...
Game initialization...
  Loading C:\best_game_ever\quetoo\lib/default/game.dll...
  Version:    x86_64-pc-windows 9966
Game module initialized
...
Client game initialization...
  Loading C:\best_game_ever\quetoo\lib/default/cgame.dll...
  Version:    9966 x86_64-pc-windows
Client game initialized
Quetoo 9966 initialized
...
map warehouse
Server initialization...
Game initialization...
  Loading C:\best_game_ever\quetoo\lib/default/game.dll...
  Version:    x86_64-pc-windows 9966
Game module initialized
Game initialized, starting...
  Loaded map warehouse, 99 entities.
Server initialized
...
game
game "default" (server, latched)
  The game module name
game banana
game will be changed for next game.
map warehouse
Disconnecting from localhost...
Server initialization...
Game initialization...
  Loading C:\best_game_ever\quetoo\lib/default/game.dll...
  Version:    x86_64-pc-windows 9966
Game module initialized
Game initialized, starting...
  Loaded map warehouse, 99 entities.
Server initialized
Adding path C:\best_game_ever\quetoo\lib/banana..
Adding path C:\Users\potato\AppData\Roaming\WickedOldGames\Quetoo/banana..
Using C:\Users\potato\AppData\Roaming\WickedOldGames\Quetoo/banana for writing.
...
map edge
Server initialization...
  Loaded map edge, 82 entities.
Server initialized
...
game
game "banana" ["default"] (server, latched)
  The game module name
...
game default
game will be changed for next game.
map warehouse
Disconnecting from localhost...
Server initialization...
Game initialization...
  Loading C:\best_game_ever\quetoo\lib/banana/game.dll...
  Version:    x86_64-pc-windows 9966
Game module initialized
Game initialized, starting...
  Loaded map warehouse, 99 entities.
Server initialized
Adding path C:\best_game_ever\quetoo\lib/default..
Adding path C:\best_game_ever\quetoo\share/default..
Adding path C:\Users\potato\AppData\Roaming\WickedOldGames\Quetoo/default..
Using C:\Users\potato\AppData\Roaming\WickedOldGames\Quetoo/default for writing.
...
game banana
game will be changed for next game.
map warehouse
Disconnecting from localhost...
Server initialization...
Game initialization...
  Loading C:\best_game_ever\quetoo\lib/default/game.dll...
  Version:    x86_64-pc-windows 9966
Game module initialized
Game initialized, starting...
  Loaded map warehouse, 99 entities.
Server initialized
Adding path C:\best_game_ever\quetoo\lib/banana..
Adding path C:\Users\potato\AppData\Roaming\WickedOldGames\Quetoo/banana..
Using C:\Users\potato\AppData\Roaming\WickedOldGames\Quetoo/banana for writing.
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions