NetService

The overall network service of the engine

Summary
NetServiceThe overall network service of the engine
Functions
NKClosePlayerConnectionServer only: Close a given player’s connection by name
NKBanPlayerServer only: Ban a given player’s connection by name.
NKRemoveBanServer only: Remove a ban by IP Address.
NKGetBanListServer only: Obtain a list of bans from the server
NKClearAllBansServer only: Remove all bans from the server
NKSetMaxPlayersServer only: Set the maximum number of players allowed by the server
NKGetMaxPlayersServer only: Get the maximum number of players allowed by the server
NKAllowConnectionsServer only: Used to allow/deny connections to the server.
NKGetPortGet the active connection’s port

Functions

NKClosePlayerConnection

Server only: Close a given player’s connection by name

Parameters

stringthe name of the player to close the connection on

Returns

booltrue if the call was successful

NKBanPlayer

Server only: Ban a given player’s connection by name.  Banning is NOT persistent between game sessions.

Parameters

stringthe name of the player to ban from the server

Returns

booltrue if the call was successful

NKRemoveBan

Server only: Remove a ban by IP Address.  See NKGetBanLists

Parameters

stringThe IP address to unban from the server

Returns

booltrue if the call was successful

NKGetBanList

Server only: Obtain a list of bans from the server

Returns

stringa pre-formated string of player names and associated IP addresses

NKClearAllBans

Server only: Remove all bans from the server

NKSetMaxPlayers

Server only: Set the maximum number of players allowed by the server

Parameters

intThe number of players allowed (minimum of 1 required)

NKGetMaxPlayers

Server only: Get the maximum number of players allowed by the server

Returns

intThe current number of allowed players

NKAllowConnections

Server only: Used to allow/deny connections to the server.  This is false by default in single player, but true when hosting a server

Returns

boolwhether or not connections should be allowed

NKGetPort

Get the active connection’s port

Returns

intthe port used in the active connection (1-65535)
Close