mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-27 06:55:54 -04:00
[Server] Prevent SetGameMode() and SetHostname() from crashing server
Previously, turning off communication with the MasterServer from the server config and then attempting to use SetGameMode() or SetHostname() led to a server crash.
This commit is contained in:
parent
3b07dc4b42
commit
d47b06fe7a
@ -146,12 +146,14 @@ const char *ScriptFunctions::GetIP(unsigned short pid) noexcept
|
||||
|
||||
void ScriptFunctions::SetGameMode(const char *gameMode) noexcept
|
||||
{
|
||||
mwmp::Networking::getPtr()->getMasterClient()->SetModname(gameMode);
|
||||
if (mwmp::Networking::getPtr()->getMasterClient())
|
||||
mwmp::Networking::getPtr()->getMasterClient()->SetModname(gameMode);
|
||||
}
|
||||
|
||||
void ScriptFunctions::SetHostname(const char *name) noexcept
|
||||
{
|
||||
mwmp::Networking::getPtr()->getMasterClient()->SetHostname(name);
|
||||
if (mwmp::Networking::getPtr()->getMasterClient())
|
||||
mwmp::Networking::getPtr()->getMasterClient()->SetHostname(name);
|
||||
}
|
||||
|
||||
void ScriptFunctions::SetServerPassword(const char *password) noexcept
|
||||
|
Loading…
x
Reference in New Issue
Block a user