aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/misccommands.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-11-27 01:35:22 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-11-27 01:35:22 +0000
commitf66ea9ce2af44a00e49e6defaa7ec6ef4f100bb4 (patch)
treefce15e55515c16ba5f1884545643ae45e52c6e7f /NorthstarDedicatedTest/misccommands.cpp
parent3d3d2c2a13a292a9093ad3029563a1c543a07ab7 (diff)
downloadNorthstarLauncher-f66ea9ce2af44a00e49e6defaa7ec6ef4f100bb4.tar.gz
NorthstarLauncher-f66ea9ce2af44a00e49e6defaa7ec6ef4f100bb4.zip
more masterserver stuff and support for devonly/hidden cvars
Diffstat (limited to 'NorthstarDedicatedTest/misccommands.cpp')
-rw-r--r--NorthstarDedicatedTest/misccommands.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/NorthstarDedicatedTest/misccommands.cpp b/NorthstarDedicatedTest/misccommands.cpp
index f7ccbe2c..a01948af 100644
--- a/NorthstarDedicatedTest/misccommands.cpp
+++ b/NorthstarDedicatedTest/misccommands.cpp
@@ -4,6 +4,7 @@
#include "gameutils.h"
#include "masterserver.h"
#include "serverauthentication.h"
+#include "squirrel.h"
void ForceLoadMapCommand(const CCommand& arg)
{
@@ -27,12 +28,16 @@ void EndSelfAuthAndLeaveToLobbyCommand(const CCommand& arg)
Cbuf_AddText(Cbuf_GetCurrentPlayer(), fmt::format("serverfilter {}", g_ServerAuthenticationManager->m_authData.begin()->first).c_str(), cmd_source_t::kCommandSrcCode);
Cbuf_Execute();
- g_ServerAuthenticationManager->m_bNeedLocalAuthForNewgame = true;
- // this won't set playlist correctly on remote clients, don't think they can set playlist until they've left which sorta fucks things
- // should maybe set this in HostState_NewGame?
- SetCurrentPlaylist("tdm");
- strcpy(g_pHostState->m_levelName, "mp_lobby");
- g_pHostState->m_iNextState = HS_NEW_GAME;
+ // weird way of checking, but check if client script vm is initialised, mainly just to allow players to cancel this
+ if (g_ClientSquirrelManager->sqvm)
+ {
+ g_ServerAuthenticationManager->m_bNeedLocalAuthForNewgame = true;
+ // this won't set playlist correctly on remote clients, don't think they can set playlist until they've left which sorta fucks things
+ // should maybe set this in HostState_NewGame?
+ SetCurrentPlaylist("tdm");
+ strcpy(g_pHostState->m_levelName, "mp_lobby");
+ g_pHostState->m_iNextState = HS_NEW_GAME;
+ }
}
void AddMiscConCommands()