Set correct data on client side to join dedis

- SetGameMode to default seems the way to go here, keeps switching teams available and makes sure online classes get previewed correctly.
- SetGameType needs to be called so it doesn't mix things what you have selected before in private match or played before on another dedicated server.
This commit is contained in:
BrentVL-1952840 2023-02-23 20:04:41 +01:00
parent 6aadfd04c7
commit 1ad875ce8a
2 changed files with 9 additions and 1 deletions

View File

@ -171,6 +171,12 @@ namespace party
scheduler::once([=]
{
if (is_connecting_to_dedi)
{
game::Com_SessionMode_SetGameMode(game::MODE_GAME_DEFAULT);
game::Com_GametypeSettings_SetGametype(gametype.data(), false, false);
}
//connect_to_session(target, hostname, xuid, mode);
connect_to_lobby_with_mode(target, mode, mapname, gametype);
}, scheduler::main);

View File

@ -22,7 +22,9 @@ namespace game
WEAK symbol<void(const char* file, int line, int code, const char* fmt, ...)> Com_Error_{0x1420F8BD0};
WEAK symbol<bool(eModes mode)> Com_SessionMode_IsMode{0x1420F7DD0};
WEAK symbol<void(eNetworkModes networkMode)> Com_SessionMode_SetNetworkMode{0x1420F8010, 0x140500B80};
WEAK symbol<eGameModes(eGameModes gameMode)> Com_SessionMode_SetGameMode{0x0, 0x140500B40};
WEAK symbol<eGameModes(eGameModes gameMode)> Com_SessionMode_SetGameMode{0x1420F7FD0, 0x140500B40};
WEAK symbol<eModes(eModes mode)> Com_SessionMode_SetMode{0x1420F7FF0};
WEAK symbol<void(const char* gametype, bool loadDefaultSettings, bool isModified)> Com_GametypeSettings_SetGametype{0x1420F63E0};
WEAK symbol<bool()> Com_IsRunningUILevel{0x142148DB0};
WEAK symbol<void(int localClientNum, eModes fromMode, eModes toMode, uint32_t flags)> Com_SwitchMode{
0x14214AF30