aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/scriptserverbrowser.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-08-02 03:20:10 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-08-02 03:20:10 +0100
commiteb56fcbe02f35ed4f418a7dc53cd9eb0ad95a504 (patch)
tree352923d1b6735502a71f4202e542af7ab84b3946 /NorthstarDedicatedTest/scriptserverbrowser.cpp
parent30e67549449a0ffbb58f7fc736bdd9e4ce7ec9d5 (diff)
downloadNorthstarLauncher-eb56fcbe02f35ed4f418a7dc53cd9eb0ad95a504.tar.gz
NorthstarLauncher-eb56fcbe02f35ed4f418a7dc53cd9eb0ad95a504.zip
add dynamic keyvalue building, client serverbrowser stuff
Diffstat (limited to 'NorthstarDedicatedTest/scriptserverbrowser.cpp')
-rw-r--r--NorthstarDedicatedTest/scriptserverbrowser.cpp103
1 files changed, 103 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/scriptserverbrowser.cpp b/NorthstarDedicatedTest/scriptserverbrowser.cpp
new file mode 100644
index 00000000..2f1c95a4
--- /dev/null
+++ b/NorthstarDedicatedTest/scriptserverbrowser.cpp
@@ -0,0 +1,103 @@
+#include "pch.h"
+#include "scriptserverbrowser.h"
+#include "squirrel.h"
+
+// functions for viewing server browser
+
+// bool function NSPollServerPage( int page )
+SQInteger SQ_PollServerPage(void* sqvm)
+{
+ SQInteger page = ClientSq_getinteger(sqvm, 1);
+
+ ClientSq_pushbool(sqvm, true);
+ return 1;
+}
+
+// int function NSGetNumServersOnPage( int page )
+SQInteger SQ_GetNumServersOnPage(void* sqvm)
+{
+ SQInteger page = ClientSq_getinteger(sqvm, 1);
+
+ ClientSq_pushinteger(sqvm, 1);
+ return 1;
+}
+
+// string function NSGetServerName( int page, int serverIndex )
+SQInteger SQ_GetServerName(void* sqvm)
+{
+ SQInteger page = ClientSq_getinteger(sqvm, 1);
+ SQInteger serverIndex = ClientSq_getinteger(sqvm, 2);
+
+ ClientSq_pushstring(sqvm, "cool", -1);
+ return 1;
+}
+
+// string function NSGetServerMap( int page, int serverIndex )
+SQInteger SQ_GetServerMap(void* sqvm)
+{
+ SQInteger page = ClientSq_getinteger(sqvm, 1);
+ SQInteger serverIndex = ClientSq_getinteger(sqvm, 2);
+
+ ClientSq_pushstring(sqvm, "mp_thaw", -1);
+ return 1;
+}
+
+// string function NSGetServerMode( int page, int serverIndex )
+SQInteger SQ_GetServerMode(void* sqvm)
+{
+ SQInteger page = ClientSq_getinteger(sqvm, 1);
+ SQInteger serverIndex = ClientSq_getinteger(sqvm, 2);
+
+ ClientSq_pushstring(sqvm, "ffa", -1);
+ return 1;
+}
+
+// string function NSGetServerID( int page, int serverIndex )
+SQInteger SQ_GetServerID(void* sqvm)
+{
+
+ return 0;
+}
+
+// void function NSResetRecievedServers()
+SQInteger SQ_ResetRecievedServers(void* sqvm)
+{
+ return 0;
+}
+
+
+// functions for authenticating with servers
+
+// void function NSTryAuthWithServer( string serverId )
+SQInteger SQ_TryAuthWithServer(void* sqvm)
+{
+ return 0;
+}
+
+// int function NSWasAuthSuccessful()
+SQInteger SQ_WasAuthSuccessful(void* sqvm)
+{
+ return 0;
+}
+
+// string function NSTryGetAuthedServerAddress()
+SQInteger SQ_TryGetAuthedServerAddress(void* sqvm)
+{
+ return 0;
+}
+
+// string function NSTryGetAuthedServerToken()
+SQInteger SQ_TryGetAuthedServerToken(void* sqvm)
+{
+ return 0;
+}
+
+void InitialiseScriptServerBrowser(HMODULE baseAddress)
+{
+ g_UISquirrelManager->AddFuncRegistration("bool", "NSPollServerPage", "int page", "", SQ_PollServerPage);
+ g_UISquirrelManager->AddFuncRegistration("int", "NSGetNumServersOnPage", "int page", "", SQ_GetNumServersOnPage);
+ g_UISquirrelManager->AddFuncRegistration("string", "NSGetServerName", "int page, int serverIndex", "", SQ_GetServerName);
+ g_UISquirrelManager->AddFuncRegistration("string", "NSGetServerMap", "int page, int serverIndex", "", SQ_GetServerMap);
+ g_UISquirrelManager->AddFuncRegistration("string", "NSGetServerMode", "int page, int serverIndex", "", SQ_GetServerMode);
+ g_UISquirrelManager->AddFuncRegistration("void", "NSResetRecievedServers", "", "", SQ_ResetRecievedServers);
+} \ No newline at end of file