Navigation Menu

Skip to content

Commit

Permalink
Fix dedicated server occasionally getting stuck back at the main menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
RabidSquabbit committed Dec 16, 2017
1 parent 6862722 commit ccf086e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions ElDorito/Source/Blam/BlamNetwork.cpp
Expand Up @@ -248,6 +248,12 @@ namespace Blam::Network
return Get_Mode();
}

bool SetLobbyType(int type)
{
auto set_server_lobby_type = (bool(__cdecl*)(int))(0x00A7EE70);
return set_server_lobby_type(type);
}

bool SetNetworkMode(int mode)
{
auto Set_Network_Mode = (bool(__cdecl*)(int))(0x00A7F950);
Expand Down
3 changes: 3 additions & 0 deletions ElDorito/Source/Blam/BlamNetwork.hpp
Expand Up @@ -381,6 +381,9 @@ namespace Blam::Network
// Gets the network mode
int GetNetworkMode();

//Sets the lobbyType
bool SetLobbyType(int type);

//Sets the Network Mode.
bool SetNetworkMode(int mode);

Expand Down
9 changes: 7 additions & 2 deletions ElDorito/Source/Server/DedicatedServer.cpp
Expand Up @@ -9,13 +9,18 @@ namespace Server::DedicatedServer

void Init()
{
Modules::CommandMap::Instance().ExecuteCommand("Server.LobbyType 2");
Blam::Network::SetLobbyType(2);
needToSetMode = true;
}
void Tick()
{
if (!needToSetMode)
if (!needToSetMode) {
if (Blam::Network::GetLobbyType() != 2) {
Blam::Network::SetLobbyType(2);
needToSetMode = true;
}
return;
}

if (Blam::Network::GetLobbyType() == 2) {
if (Blam::Network::SetNetworkMode(3)) {
Expand Down

0 comments on commit ccf086e

Please sign in to comment.