aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/scriptserverbrowser.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-09 03:48:14 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-09 03:48:14 +0100
commit037113d4b8032cd3715d879c2f4b08f66fa2be43 (patch)
treecf294f53b28ebb207e497877c8ee3fce39dd5e10 /NorthstarDedicatedTest/scriptserverbrowser.cpp
parent9ab7c43c34183915273cc8b5ccedd72568249b27 (diff)
downloadNorthstarLauncher-037113d4b8032cd3715d879c2f4b08f66fa2be43.tar.gz
NorthstarLauncher-037113d4b8032cd3715d879c2f4b08f66fa2be43.zip
move sqvm funcs to sq managers
Diffstat (limited to 'NorthstarDedicatedTest/scriptserverbrowser.cpp')
-rw-r--r--NorthstarDedicatedTest/scriptserverbrowser.cpp96
1 files changed, 48 insertions, 48 deletions
diff --git a/NorthstarDedicatedTest/scriptserverbrowser.cpp b/NorthstarDedicatedTest/scriptserverbrowser.cpp
index 41506230..f2d53347 100644
--- a/NorthstarDedicatedTest/scriptserverbrowser.cpp
+++ b/NorthstarDedicatedTest/scriptserverbrowser.cpp
@@ -11,7 +11,7 @@
// bool function NSIsMasterServerAuthenticated()
SQRESULT SQ_IsMasterServerAuthenticated(void* sqvm)
{
- ClientSq_pushbool(sqvm, g_MasterServerManager->m_bOriginAuthWithMasterServerDone);
+ g_ClientSquirrelManager->sq_pushbool(sqvm, g_MasterServerManager->m_bOriginAuthWithMasterServerDone);
return SQRESULT_NOTNULL;
}
@@ -25,32 +25,32 @@ SQRESULT SQ_RequestServerList(void* sqvm)
// bool function NSIsRequestingServerList()
SQRESULT SQ_IsRequestingServerList(void* sqvm)
{
- ClientSq_pushbool(sqvm, g_MasterServerManager->m_bScriptRequestingServerList);
+ g_ClientSquirrelManager->sq_pushbool(sqvm, g_MasterServerManager->m_bScriptRequestingServerList);
return SQRESULT_NOTNULL;
}
// bool function NSMasterServerConnectionSuccessful()
SQRESULT SQ_MasterServerConnectionSuccessful(void* sqvm)
{
- ClientSq_pushbool(sqvm, g_MasterServerManager->m_bSuccessfullyConnected);
+ g_ClientSquirrelManager->sq_pushbool(sqvm, g_MasterServerManager->m_bSuccessfullyConnected);
return SQRESULT_NOTNULL;
}
// int function NSGetServerCount()
SQRESULT SQ_GetServerCount(void* sqvm)
{
- ClientSq_pushinteger(sqvm, g_MasterServerManager->m_vRemoteServers.size());
+ g_ClientSquirrelManager->sq_pushinteger(sqvm, g_MasterServerManager->m_vRemoteServers.size());
return SQRESULT_NOTNULL;
}
// string function NSGetServerName( int serverIndex )
SQRESULT SQ_GetServerName(void* sqvm)
{
- SQInteger serverIndex = ClientSq_getinteger(sqvm, 1);
+ SQInteger serverIndex = g_ClientSquirrelManager->sq_getinteger(sqvm, 1);
if (serverIndex >= g_MasterServerManager->m_vRemoteServers.size())
{
- ClientSq_pusherror(
+ g_ClientSquirrelManager->sq_raiseerror(
sqvm,
fmt::format(
"Tried to get name of server index {} when only {} servers are available",
@@ -60,18 +60,18 @@ SQRESULT SQ_GetServerName(void* sqvm)
return SQRESULT_ERROR;
}
- ClientSq_pushstring(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].name, -1);
+ g_ClientSquirrelManager->sq_pushstring(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].name, -1);
return SQRESULT_NOTNULL;
}
// string function NSGetServerDescription( int serverIndex )
SQRESULT SQ_GetServerDescription(void* sqvm)
{
- SQInteger serverIndex = ClientSq_getinteger(sqvm, 1);
+ SQInteger serverIndex = g_ClientSquirrelManager->sq_getinteger(sqvm, 1);
if (serverIndex >= g_MasterServerManager->m_vRemoteServers.size())
{
- ClientSq_pusherror(
+ g_ClientSquirrelManager->sq_raiseerror(
sqvm,
fmt::format(
"Tried to get description of server index {} when only {} servers are available",
@@ -81,18 +81,18 @@ SQRESULT SQ_GetServerDescription(void* sqvm)
return SQRESULT_ERROR;
}
- ClientSq_pushstring(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].description.c_str(), -1);
+ g_ClientSquirrelManager->sq_pushstring(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].description.c_str(), -1);
return SQRESULT_NOTNULL;
}
// string function NSGetServerMap( int serverIndex )
-SQInteger SQ_GetServerMap(void* sqvm)
+SQRESULT SQ_GetServerMap(void* sqvm)
{
- SQInteger serverIndex = ClientSq_getinteger(sqvm, 1);
+ SQInteger serverIndex = g_ClientSquirrelManager->sq_getinteger(sqvm, 1);
if (serverIndex >= g_MasterServerManager->m_vRemoteServers.size())
{
- ClientSq_pusherror(
+ g_ClientSquirrelManager->sq_raiseerror(
sqvm,
fmt::format(
"Tried to get map of server index {} when only {} servers are available",
@@ -102,18 +102,18 @@ SQInteger SQ_GetServerMap(void* sqvm)
return SQRESULT_ERROR;
}
- ClientSq_pushstring(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].map, -1);
+ g_ClientSquirrelManager->sq_pushstring(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].map, -1);
return SQRESULT_NOTNULL;
}
// string function NSGetServerPlaylist( int serverIndex )
SQRESULT SQ_GetServerPlaylist(void* sqvm)
{
- SQInteger serverIndex = ClientSq_getinteger(sqvm, 1);
+ SQInteger serverIndex = g_ClientSquirrelManager->sq_getinteger(sqvm, 1);
if (serverIndex >= g_MasterServerManager->m_vRemoteServers.size())
{
- ClientSq_pusherror(
+ g_ClientSquirrelManager->sq_raiseerror(
sqvm,
fmt::format(
"Tried to get playlist of server index {} when only {} servers are available",
@@ -123,18 +123,18 @@ SQRESULT SQ_GetServerPlaylist(void* sqvm)
return SQRESULT_ERROR;
}
- ClientSq_pushstring(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].playlist, -1);
+ g_ClientSquirrelManager->sq_pushstring(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].playlist, -1);
return SQRESULT_NOTNULL;
}
// int function NSGetServerPlayerCount( int serverIndex )
SQRESULT SQ_GetServerPlayerCount(void* sqvm)
{
- SQInteger serverIndex = ClientSq_getinteger(sqvm, 1);
+ SQInteger serverIndex = g_ClientSquirrelManager->sq_getinteger(sqvm, 1);
if (serverIndex >= g_MasterServerManager->m_vRemoteServers.size())
{
- ClientSq_pusherror(
+ g_ClientSquirrelManager->sq_raiseerror(
sqvm,
fmt::format(
"Tried to get playercount of server index {} when only {} servers are available",
@@ -144,18 +144,18 @@ SQRESULT SQ_GetServerPlayerCount(void* sqvm)
return SQRESULT_ERROR;
}
- ClientSq_pushinteger(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].playerCount);
+ g_ClientSquirrelManager->sq_pushinteger(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].playerCount);
return SQRESULT_NOTNULL;
}
// int function NSGetServerMaxPlayerCount( int serverIndex )
SQRESULT SQ_GetServerMaxPlayerCount(void* sqvm)
{
- SQInteger serverIndex = ClientSq_getinteger(sqvm, 1);
+ SQInteger serverIndex = g_ClientSquirrelManager->sq_getinteger(sqvm, 1);
if (serverIndex >= g_MasterServerManager->m_vRemoteServers.size())
{
- ClientSq_pusherror(
+ g_ClientSquirrelManager->sq_raiseerror(
sqvm,
fmt::format(
"Tried to get max playercount of server index {} when only {} servers are available",
@@ -165,18 +165,18 @@ SQRESULT SQ_GetServerMaxPlayerCount(void* sqvm)
return SQRESULT_ERROR;
}
- ClientSq_pushinteger(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].maxPlayers);
+ g_ClientSquirrelManager->sq_pushinteger(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].maxPlayers);
return SQRESULT_NOTNULL;
}
// string function NSGetServerID( int serverIndex )
SQRESULT SQ_GetServerID(void* sqvm)
{
- SQInteger serverIndex = ClientSq_getinteger(sqvm, 1);
+ SQInteger serverIndex = g_ClientSquirrelManager->sq_getinteger(sqvm, 1);
if (serverIndex >= g_MasterServerManager->m_vRemoteServers.size())
{
- ClientSq_pusherror(
+ g_ClientSquirrelManager->sq_raiseerror(
sqvm,
fmt::format(
"Tried to get id of server index {} when only {} servers are available",
@@ -186,18 +186,18 @@ SQRESULT SQ_GetServerID(void* sqvm)
return SQRESULT_ERROR;
}
- ClientSq_pushstring(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].id, -1);
+ g_ClientSquirrelManager->sq_pushstring(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].id, -1);
return SQRESULT_NOTNULL;
}
// bool function NSServerRequiresPassword( int serverIndex )
SQRESULT SQ_ServerRequiresPassword(void* sqvm)
{
- SQInteger serverIndex = ClientSq_getinteger(sqvm, 1);
+ SQInteger serverIndex = g_ClientSquirrelManager->sq_getinteger(sqvm, 1);
if (serverIndex >= g_MasterServerManager->m_vRemoteServers.size())
{
- ClientSq_pusherror(
+ g_ClientSquirrelManager->sq_raiseerror(
sqvm,
fmt::format(
"Tried to get hasPassword of server index {} when only {} servers are available",
@@ -207,18 +207,18 @@ SQRESULT SQ_ServerRequiresPassword(void* sqvm)
return SQRESULT_ERROR;
}
- ClientSq_pushbool(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].requiresPassword);
+ g_ClientSquirrelManager->sq_pushbool(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].requiresPassword);
return SQRESULT_NOTNULL;
}
// int function NSGetServerRequiredModsCount( int serverIndex )
SQRESULT SQ_GetServerRequiredModsCount(void* sqvm)
{
- SQInteger serverIndex = ClientSq_getinteger(sqvm, 1);
+ SQInteger serverIndex = g_ClientSquirrelManager->sq_getinteger(sqvm, 1);
if (serverIndex >= g_MasterServerManager->m_vRemoteServers.size())
{
- ClientSq_pusherror(
+ g_ClientSquirrelManager->sq_raiseerror(
sqvm,
fmt::format(
"Tried to get required mods count of server index {} when only {} servers are available",
@@ -228,19 +228,19 @@ SQRESULT SQ_GetServerRequiredModsCount(void* sqvm)
return SQRESULT_ERROR;
}
- ClientSq_pushinteger(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].requiredMods.size());
+ g_ClientSquirrelManager->sq_pushinteger(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].requiredMods.size());
return SQRESULT_NOTNULL;
}
// string function NSGetServerRequiredModName( int serverIndex, int modIndex )
SQRESULT SQ_GetServerRequiredModName(void* sqvm)
{
- SQInteger serverIndex = ClientSq_getinteger(sqvm, 1);
- SQInteger modIndex = ClientSq_getinteger(sqvm, 2);
+ SQInteger serverIndex = g_ClientSquirrelManager->sq_getinteger(sqvm, 1);
+ SQInteger modIndex = g_ClientSquirrelManager->sq_getinteger(sqvm, 2);
if (serverIndex >= g_MasterServerManager->m_vRemoteServers.size())
{
- ClientSq_pusherror(
+ g_ClientSquirrelManager->sq_raiseerror(
sqvm,
fmt::format(
"Tried to get hasPassword of server index {} when only {} servers are available",
@@ -252,7 +252,7 @@ SQRESULT SQ_GetServerRequiredModName(void* sqvm)
if (modIndex >= g_MasterServerManager->m_vRemoteServers[serverIndex].requiredMods.size())
{
- ClientSq_pusherror(
+ g_ClientSquirrelManager->sq_raiseerror(
sqvm,
fmt::format(
"Tried to get required mod name of mod index {} when only {} mod are available",
@@ -262,19 +262,19 @@ SQRESULT SQ_GetServerRequiredModName(void* sqvm)
return SQRESULT_ERROR;
}
- ClientSq_pushstring(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].requiredMods[modIndex].Name.c_str(), -1);
+ g_ClientSquirrelManager->sq_pushstring(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].requiredMods[modIndex].Name.c_str(), -1);
return SQRESULT_NOTNULL;
}
// string function NSGetServerRequiredModVersion( int serverIndex, int modIndex )
SQRESULT SQ_GetServerRequiredModVersion(void* sqvm)
{
- SQInteger serverIndex = ClientSq_getinteger(sqvm, 1);
- SQInteger modIndex = ClientSq_getinteger(sqvm, 2);
+ SQInteger serverIndex = g_ClientSquirrelManager->sq_getinteger(sqvm, 1);
+ SQInteger modIndex = g_ClientSquirrelManager->sq_getinteger(sqvm, 2);
if (serverIndex >= g_MasterServerManager->m_vRemoteServers.size())
{
- ClientSq_pusherror(
+ g_ClientSquirrelManager->sq_raiseerror(
sqvm,
fmt::format(
"Tried to get required mod version of server index {} when only {} servers are available",
@@ -286,7 +286,7 @@ SQRESULT SQ_GetServerRequiredModVersion(void* sqvm)
if (modIndex >= g_MasterServerManager->m_vRemoteServers[serverIndex].requiredMods.size())
{
- ClientSq_pusherror(
+ g_ClientSquirrelManager->sq_raiseerror(
sqvm,
fmt::format(
"Tried to get required mod version of mod index {} when only {} mod are available",
@@ -296,7 +296,7 @@ SQRESULT SQ_GetServerRequiredModVersion(void* sqvm)
return SQRESULT_ERROR;
}
- ClientSq_pushstring(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].requiredMods[modIndex].Version.c_str(), -1);
+ g_ClientSquirrelManager->sq_pushstring(sqvm, g_MasterServerManager->m_vRemoteServers[serverIndex].requiredMods[modIndex].Version.c_str(), -1);
return SQRESULT_NOTNULL;
}
@@ -312,12 +312,12 @@ SQRESULT SQ_ClearRecievedServerList(void* sqvm)
// void function NSTryAuthWithServer( int serverIndex, string password = "" )
SQRESULT SQ_TryAuthWithServer(void* sqvm)
{
- SQInteger serverIndex = ClientSq_getinteger(sqvm, 1);
- const SQChar* password = ClientSq_getstring(sqvm, 2);
+ SQInteger serverIndex = g_ClientSquirrelManager->sq_getinteger(sqvm, 1);
+ const SQChar* password = g_ClientSquirrelManager->sq_getstring(sqvm, 2);
if (serverIndex >= g_MasterServerManager->m_vRemoteServers.size())
{
- ClientSq_pusherror(
+ g_ClientSquirrelManager->sq_raiseerror(
sqvm,
fmt::format(
"Tried to auth with server index {} when only {} servers are available",
@@ -345,14 +345,14 @@ SQRESULT SQ_TryAuthWithServer(void* sqvm)
// bool function NSIsAuthenticatingWithServer()
SQRESULT SQ_IsAuthComplete(void* sqvm)
{
- ClientSq_pushbool(sqvm, g_MasterServerManager->m_bScriptAuthenticatingWithGameServer);
+ g_ClientSquirrelManager->sq_pushbool(sqvm, g_MasterServerManager->m_bScriptAuthenticatingWithGameServer);
return SQRESULT_NOTNULL;
}
// bool function NSWasAuthSuccessful()
SQRESULT SQ_WasAuthSuccessful(void* sqvm)
{
- ClientSq_pushbool(sqvm, g_MasterServerManager->m_bSuccessfullyAuthenticatedWithGameServer);
+ g_ClientSquirrelManager->sq_pushbool(sqvm, g_MasterServerManager->m_bSuccessfullyAuthenticatedWithGameServer);
return SQRESULT_NOTNULL;
}
@@ -361,7 +361,7 @@ SQRESULT SQ_ConnectToAuthedServer(void* sqvm)
{
if (!g_MasterServerManager->m_bHasPendingConnectionInfo)
{
- ClientSq_pusherror(sqvm, fmt::format("Tried to connect to authed server before any pending connection info was available").c_str());
+ g_ClientSquirrelManager->sq_raiseerror(sqvm, fmt::format("Tried to connect to authed server before any pending connection info was available").c_str());
return SQRESULT_ERROR;
}