Skip to main content

Session Manager

The session manager is used for managing anything relating to the active game, such as the map or sector layout.


Get Session​

await RCONClientV2.session.getSession();

Returns​

Promise<{
success: boolean,
error?: string,
session?: {
serverName: string,
mapName: string,
gameMode: string,
playerCount: number,
maxPlayerCount: number,
queueCount: number,
maxQueueCount: number,
vipQueueCount: number,
maxVipQueueCount: number
}
}>

Set Map​

await RCONClientV2.session.setMap(mapId);

Parameters​

NameDescriptionTypeRequired
mapIdThe map ID.stringTrue

Returns​

Promise<{ success: boolean, error?: string }>


Set Sector Layout​

note

Sectors are listed left-right or top-down depending on map orientation.

await RCONClientV2.session.setSectorLayout(sectors);

Example​

// The middle column of strongpoints for St Marie Du Mont
await RCONClientV2.session.setSectorLayout(["Le Grand Chemin", "Cattlesheds", "AA Network", "The Hamlet", "Hill 6"]);

Parameters​

NameDescriptionTypeRequired
layoutThe names of the sectors.Array<string>True

Returns​

Promise<{ success: boolean, error?: string }>


Broadcast Message​

note

This is the "Admin Message" in the top left corner of your screen. If a message variable is not provided, it will clear the message.

await RCONClientV2.session.broadcastMessage(message);

Parameters​

NameDescriptionTypeRequired
messageThe message to displaystringFalse

Returns​

Promise<{ success: boolean, error?: string }>