Server functions

class ServerFunctions

Public Static Functions

void StopServer(int code)

Shut down the server.

Return
void
Parameters
  • code: The shutdown code.

void Kick(unsigned short pid)

Kick a certain player from the server.

Return
void
Parameters
  • pid: The player ID.

void BanAddress(const char *ipAddress)

Ban a certain IP address from the server.

Return
void
Parameters
  • ipAddress: The IP address.

void UnbanAddress(const char *ipAddress)

Unban a certain IP address from the server.

Return
void
Parameters
  • ipAddress: The IP address.

const char *GetOperatingSystemType()

Get the type of the operating system used by the server.

Note: Currently, the type can be “Windows”, “Linux”, “OS X” or “Unknown OS”.

Return
The type of the operating system.

const char *GetArchitectureType()

Get the architecture type used by the server.

Note: Currently, the type can be “64-bit”, “32-bit”, “ARMv#” or “Unknown architecture”.

Return
The architecture type.

const char *GetServerVersion()

Get the TES3MP version of the server.

Return
The server version.

const char *GetProtocolVersion()

Get the protocol version of the server.

Return
The protocol version.

int GetAvgPing(unsigned short pid)

Get the average ping of a certain player.

Return
The average ping.
Parameters
  • pid: The player ID.

const char *GetIP(unsigned short pid)

Get the IP address of a certain player.

Return
The IP address.
Parameters
  • pid: The player ID.

unsigned short GetPort()

Get the port used by the server.

Return
Port

unsigned int GetMaxPlayers()

Get the maximum number of players.

Return
Max players

bool HasPassword()

Checking if the server requires a password to connect.

Return

bool GetPluginEnforcementState()

Get the plugin enforcement state of the server.

If true, clients are required to use the same plugins as set for the server.

Return
The enforcement state.

bool GetScriptErrorIgnoringState()

Get the script error ignoring state of the server.

If true, script errors will not crash the server.

Return
The script error ignoring state.

void SetGameMode(const char *gameMode)

Set the game mode of the server, as displayed in the server browser.

Return
void
Parameters
  • name: The new game mode.

void SetHostname(const char *name)

Set the name of the server, as displayed in the server browser.

Return
void
Parameters
  • name: The new name.

void SetServerPassword(const char *password)

Set the password required to join the server.

Return
void
Parameters
  • password: The password.

void SetPluginEnforcementState(bool state)

Set the plugin enforcement state of the server.

If true, clients are required to use the same plugins as set for the server.

Return
void
Parameters
  • state: The new enforcement state.

void SetScriptErrorIgnoringState(bool state)

Set whether script errors should be ignored or not.

If true, script errors will not crash the server, but could have any number of unforeseen consequences, which is why this is a highly experimental setting.

Return
void
Parameters
  • state: The new script error ignoring state.

void SetRuleString(const char *key, const char *value)

Set a rule string for the server details displayed in the server browser.

Return
void
Parameters
  • key: The name of the rule.
  • value: The string value of the rule.

void SetRuleValue(const char *key, double value)

Set a rule value for the server details displayed in the server browser.

Return
void
Parameters
  • key: The name of the rule.
  • value: The numerical value of the rule.

void AddPluginHash(const char *pluginName, const char *hash)

Adds plugins to the internal server structure to validate players.

Parameters
  • pluginName: Name with extension of the plugin or master file.
  • hash: Hash string