Server settings

vcmpError PluginFuncs.GetServerSettings(ServerSettings* settings)

Stores some server properties in the given struct.

Parameters:
Raises:

vcmpErrorNullArgument if the settings pointer is null

vcmpError PluginFuncs.SetServerName(const char* text)

Changes the server’s name.

Parameters:
  • text (const char*) – The server’s new name
Raises:

vcmpErrorNullArgument if text is null

vcmpErrorTooLargeInput if text is longer than 127 characters

Note

If the server is launched with the -appendname argument, the server name will still have that component appended.

vcmpError PluginFuncs.GetServerName(char* buffer, size_t size)

Gets the server’s name.

Parameters:
  • buffer (char*) – A pointer to a char buffer to store the server name in
  • size (size_t) – The size of the buffer
Raises:

vcmpErrorNullArgument if buffer is null

vcmpErrorBufferTooSmall if buffer is too small to fit the server name

vcmpError PluginFuncs.SetMaxPlayers(uint32_t maxPlayers)

Sets the maximum number of players that can join the server.

Parameters:
  • maxPlayers (uint32_t) – The new player limit
Raises:

vcmpErrorArgumentOutOfBounds if maxPlayers is smaller than 1 or larger than 100

Note

If the server is launched with the -maxplayers argument, the server will silently throttle the maximum number of players to this value.

uint32_t PluginFuncs.GetMaxPlayers(void)
Returns:The maximum number of players that can join the server.
vcmpError PluginFuncs.SetServerPassword(const char* password)

Sets or unsets the password needed to join the server.

Parameters:
  • password (const char*) – The new password
Raises:

vcmpErrorNullArgument if password is null

vcmpErrorTooLargeInput if password is longer than 64 characters

Note

To remove the server password, pass an empty string, not a null pointer.

vcmpError PluginFuncs.GetServerPassword(char* buffer, size_t size)

Gets the password needed to join the server.

Parameters:
  • buffer (char*) – A pointer to a char buffer to store the password in
  • size (size_t) – The size of the buffer
Raises:

vcmpErrorNullArgument if buffer is null

vcmpErrorBufferTooSmall if buffer is too small to fit the password

vcmpError PluginFuncs.SetGameModeText(const char* gameMode)

Sets the gamemode name advertised to the server browser.

Parameters:
  • gameMode (const char*) – The new gamemode name
Raises:

vcmpErrorNullArgument if gameMode is null

vcmpErrorTooLargeInput if gameMode is longer than 64 characters

vcmpError PluginFuncs.GetServerGameModeText(char* buffer, size_t size)

Gets the gamemode name advertised to the server browser.

Parameters:
  • buffer (char*) – A pointer to a char buffer to store the gamemode name in
  • size (size_t) – The size of the buffer
Raises:

vcmpErrorNullArgument if buffer is null

vcmpErrorBufferTooSmall if buffer is too small to fit the gamemode name

void PluginFuncs.ShutdownServer(void)

Gracefully stops the server.