diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-05-09 16:42:33 +0100 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-05-09 16:42:33 +0100 |
commit | 5a58dd1c05e943d6b440bea5b4a6ae80ce16841e (patch) | |
tree | 9ea18142c2e2885b990671c04db4786aa05f86f3 /NorthstarDedicatedTest/plugins.cpp | |
parent | 77a1195d77034c00959dfd030e2eb7a57d58a88d (diff) | |
download | NorthstarLauncher-5a58dd1c05e943d6b440bea5b4a6ae80ce16841e.tar.gz NorthstarLauncher-5a58dd1c05e943d6b440bea5b4a6ae80ce16841e.zip |
refactor some squirrel stuff and ingame compilation error message
Diffstat (limited to 'NorthstarDedicatedTest/plugins.cpp')
-rw-r--r-- | NorthstarDedicatedTest/plugins.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/NorthstarDedicatedTest/plugins.cpp b/NorthstarDedicatedTest/plugins.cpp index b77b4ef4..ae651d09 100644 --- a/NorthstarDedicatedTest/plugins.cpp +++ b/NorthstarDedicatedTest/plugins.cpp @@ -113,12 +113,12 @@ void initGameState() SQRESULT SQ_UpdateGameStateUI(void* sqvm) { AcquireSRWLockExclusive(&gameStateLock); - gameState.map = g_ClientSquirrelManager->sq_getstring(sqvm, 1); - gameState.mapDisplayName = g_ClientSquirrelManager->sq_getstring(sqvm, 2); - gameState.playlist = g_ClientSquirrelManager->sq_getstring(sqvm, 3); - gameState.playlistDisplayName = g_ClientSquirrelManager->sq_getstring(sqvm, 4); - gameState.connected = g_ClientSquirrelManager->sq_getbool(sqvm, 5); - gameState.loading = g_ClientSquirrelManager->sq_getbool(sqvm, 6); + gameState.map = g_pClientSquirrel->sq_getstring(sqvm, 1); + gameState.mapDisplayName = g_pClientSquirrel->sq_getstring(sqvm, 2); + gameState.playlist = g_pClientSquirrel->sq_getstring(sqvm, 3); + gameState.playlistDisplayName = g_pClientSquirrel->sq_getstring(sqvm, 4); + gameState.connected = g_pClientSquirrel->sq_getbool(sqvm, 5); + gameState.loading = g_pClientSquirrel->sq_getbool(sqvm, 6); ReleaseSRWLockExclusive(&gameStateLock); return SQRESULT_NOTNULL; } @@ -128,13 +128,13 @@ SQRESULT SQ_UpdateGameStateClient(void* sqvm) { AcquireSRWLockExclusive(&gameStateLock); AcquireSRWLockExclusive(&serverInfoLock); - gameState.players = g_ClientSquirrelManager->sq_getinteger(sqvm, 1); - serverInfo.maxPlayers = g_ClientSquirrelManager->sq_getinteger(sqvm, 2); - gameState.ourScore = g_ClientSquirrelManager->sq_getinteger(sqvm, 3); - gameState.secondHighestScore = g_ClientSquirrelManager->sq_getinteger(sqvm, 4); - gameState.highestScore = g_ClientSquirrelManager->sq_getinteger(sqvm, 5); - serverInfo.roundBased = g_ClientSquirrelManager->sq_getbool(sqvm, 6); - serverInfo.scoreLimit = g_ClientSquirrelManager->sq_getbool(sqvm, 7); + gameState.players = g_pClientSquirrel->sq_getinteger(sqvm, 1); + serverInfo.maxPlayers = g_pClientSquirrel->sq_getinteger(sqvm, 2); + gameState.ourScore = g_pClientSquirrel->sq_getinteger(sqvm, 3); + gameState.secondHighestScore = g_pClientSquirrel->sq_getinteger(sqvm, 4); + gameState.highestScore = g_pClientSquirrel->sq_getinteger(sqvm, 5); + serverInfo.roundBased = g_pClientSquirrel->sq_getbool(sqvm, 6); + serverInfo.scoreLimit = g_pClientSquirrel->sq_getbool(sqvm, 7); ReleaseSRWLockExclusive(&gameStateLock); ReleaseSRWLockExclusive(&serverInfoLock); return SQRESULT_NOTNULL; @@ -146,15 +146,15 @@ SQRESULT SQ_UpdateServerInfo(void* sqvm) { AcquireSRWLockExclusive(&gameStateLock); AcquireSRWLockExclusive(&serverInfoLock); - serverInfo.id = g_ClientSquirrelManager->sq_getstring(sqvm, 1); - serverInfo.name = g_ClientSquirrelManager->sq_getstring(sqvm, 2); - serverInfo.password = g_ClientSquirrelManager->sq_getstring(sqvm, 3); - gameState.players = g_ClientSquirrelManager->sq_getinteger(sqvm, 4); - serverInfo.maxPlayers = g_ClientSquirrelManager->sq_getinteger(sqvm, 5); - gameState.map = g_ClientSquirrelManager->sq_getstring(sqvm, 6); - gameState.mapDisplayName = g_ClientSquirrelManager->sq_getstring(sqvm, 7); - gameState.playlist = g_ClientSquirrelManager->sq_getstring(sqvm, 8); - gameState.playlistDisplayName = g_ClientSquirrelManager->sq_getstring(sqvm, 9); + serverInfo.id = g_pClientSquirrel->sq_getstring(sqvm, 1); + serverInfo.name = g_pClientSquirrel->sq_getstring(sqvm, 2); + serverInfo.password = g_pClientSquirrel->sq_getstring(sqvm, 3); + gameState.players = g_pClientSquirrel->sq_getinteger(sqvm, 4); + serverInfo.maxPlayers = g_pClientSquirrel->sq_getinteger(sqvm, 5); + gameState.map = g_pClientSquirrel->sq_getstring(sqvm, 6); + gameState.mapDisplayName = g_pClientSquirrel->sq_getstring(sqvm, 7); + gameState.playlist = g_pClientSquirrel->sq_getstring(sqvm, 8); + gameState.playlistDisplayName = g_pClientSquirrel->sq_getstring(sqvm, 9); ReleaseSRWLockExclusive(&gameStateLock); ReleaseSRWLockExclusive(&serverInfoLock); return SQRESULT_NOTNULL; @@ -164,10 +164,10 @@ SQRESULT SQ_UpdateServerInfo(void* sqvm) SQRESULT SQ_UpdateServerInfoBetweenRounds(void* sqvm) { AcquireSRWLockExclusive(&serverInfoLock); - serverInfo.id = g_ClientSquirrelManager->sq_getstring(sqvm, 1); - serverInfo.name = g_ClientSquirrelManager->sq_getstring(sqvm, 2); - serverInfo.password = g_ClientSquirrelManager->sq_getstring(sqvm, 3); - serverInfo.maxPlayers = g_ClientSquirrelManager->sq_getinteger(sqvm, 4); + serverInfo.id = g_pClientSquirrel->sq_getstring(sqvm, 1); + serverInfo.name = g_pClientSquirrel->sq_getstring(sqvm, 2); + serverInfo.password = g_pClientSquirrel->sq_getstring(sqvm, 3); + serverInfo.maxPlayers = g_pClientSquirrel->sq_getinteger(sqvm, 4); ReleaseSRWLockExclusive(&serverInfoLock); return SQRESULT_NOTNULL; } @@ -176,7 +176,7 @@ SQRESULT SQ_UpdateServerInfoBetweenRounds(void* sqvm) SQRESULT SQ_UpdateTimeInfo(void* sqvm) { AcquireSRWLockExclusive(&serverInfoLock); - serverInfo.endTime = ceil(g_ClientSquirrelManager->sq_getfloat(sqvm, 1)); + serverInfo.endTime = ceil(g_pClientSquirrel->sq_getfloat(sqvm, 1)); ReleaseSRWLockExclusive(&serverInfoLock); return SQRESULT_NOTNULL; } @@ -185,7 +185,7 @@ SQRESULT SQ_UpdateTimeInfo(void* sqvm) SQRESULT SQ_SetConnected(void* sqvm) { AcquireSRWLockExclusive(&gameStateLock); - gameState.loading = g_ClientSquirrelManager->sq_getbool(sqvm, 1); + gameState.loading = g_pClientSquirrel->sq_getbool(sqvm, 1); ReleaseSRWLockExclusive(&gameStateLock); return SQRESULT_NOTNULL; } @@ -390,21 +390,21 @@ ON_DLL_LOAD_CLIENT_RELIESON("client.dll", PluginCommands, ClientSquirrel, (HMODU // i swear there's a way to make this not have be run in 2 contexts but i can't figure it out // some funcs i need are just not available in UI or CLIENT - if (g_UISquirrelManager && g_ClientSquirrelManager) + if (g_pUISquirrel && g_pClientSquirrel) { - g_UISquirrelManager->AddFuncRegistration( + g_pUISquirrel->AddFuncRegistration( "void", "NSUpdateGameStateUI", "string gamemode, string gamemodeName, string map, string mapName, bool connected, bool loading", "", SQ_UpdateGameStateUI); - g_ClientSquirrelManager->AddFuncRegistration( + g_pClientSquirrel->AddFuncRegistration( "void", "NSUpdateGameStateClient", "int playerCount, int maxPlayers, int outScore, int secondHighestScore, int highestScore, bool roundBased, int scoreLimit", "", SQ_UpdateGameStateClient); - g_UISquirrelManager->AddFuncRegistration( + g_pUISquirrel->AddFuncRegistration( "void", "NSUpdateServerInfo", "string id, string name, string password, int players, int maxPlayers, string map, string mapDisplayName, string playlist, " @@ -412,10 +412,10 @@ ON_DLL_LOAD_CLIENT_RELIESON("client.dll", PluginCommands, ClientSquirrel, (HMODU "playlistDisplayName", "", SQ_UpdateServerInfo); - g_ClientSquirrelManager->AddFuncRegistration( + g_pClientSquirrel->AddFuncRegistration( "void", "NSUpdateServerInfoReload", "int maxPlayers", "", SQ_UpdateServerInfoBetweenRounds); - g_ClientSquirrelManager->AddFuncRegistration("void", "NSUpdateTimeInfo", "float timeInFuture", "", SQ_UpdateTimeInfo); - g_UISquirrelManager->AddFuncRegistration("void", "NSSetLoading", "bool loading", "", SQ_SetConnected); - g_UISquirrelManager->AddFuncRegistration("void", "NSUpdateListenServer", "", "", SQ_UpdateListenServer); + g_pClientSquirrel->AddFuncRegistration("void", "NSUpdateTimeInfo", "float timeInFuture", "", SQ_UpdateTimeInfo); + g_pUISquirrel->AddFuncRegistration("void", "NSSetLoading", "bool loading", "", SQ_SetConnected); + g_pUISquirrel->AddFuncRegistration("void", "NSUpdateListenServer", "", "", SQ_UpdateListenServer); } }) |