aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/lobby/_lobby.gnut
blob: 0f37251d6779e5fce37bebd742bf7139cd0b5277 (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
untyped
global function Lobby_Init
global function Lobby_OnClientConnectionStarted
global function Lobby_OnClientConnectionCompleted

void function Lobby_Init()
{
	// need to prevent a crash
	Music_Init()
	
	if ( IsPrivateMatch() || GetCurrentPlaylistName() == "private_match" ) // IsPrivateMatch() doesn't seem to be reliable on local server start
		PrivateLobby_Init()
	else
	{
		// non-private lobby clientcommands
		AddClientCommandCallback( "StartPrivateMatchSearch", ClientCommandCallback_StartPrivateMatchSearch )
	}
}

void function Lobby_OnClientConnectionStarted( entity player )
{
	
}

void function Lobby_OnClientConnectionCompleted( entity player )
{
	FinishClientScriptInitialization( player )
}

bool function ClientCommandCallback_StartPrivateMatchSearch( entity player, array<string> args )
{
	// open lobby in private match mode
	SetCurrentPlaylist( "private_match" ) // required for private match lobby to start properly
	GameRules_ChangeMap( "mp_lobby", GAMETYPE )
	
	return true
}