aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/scripts/vscripts/lobby/_lobby.gnut
blob: fd877f8cf88ac910d2f077a566a57a9c3a929225 (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
	ServerCommand( "changelevel mp_lobby" )
	
	return true
}