aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/scriptserverbrowser.cpp
blob: 2f1c95a420f6fecde58f502cd451888caf91fc5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
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);
}