Links

Game Server

Like what your seeing?

Support us as a GitHub Sponsor and get instant access to all our assets, exclusive tools and assets, escalated support and issue tracking and our gratitude. These articles are made possible by our GitHub Sponsors ... become a sponsor today!

Introduction

accessed from within the SteamSettings this houses server specific features and functions

Definition

public class SteamSettings : ScriptableObject
{
public class GameServer;
}
A static accessor is available that will access the active server object
SteamSettings.Server

Events

disconnected

occurs when the server disconnects from Steam

connected

occurs when the server connects to Steam

failure

occurs when an error occurs as reported by Steam

Fields and Attributes

autoInitalize

bool autoInitalize;
Indicates rather or not the Server APIs should auto initialize on start up

autoLogon

bool autoLogon;
indicates rather or not the Steam Game Server system should log on after initialization

ip

uint ip;
The uint packed IP address, this is the raw form Steam would use IP address as and is simply the 4 octives of an IP address packed into the 32 bit int value
00000000 00000000 00000000 00000000
each 8 bit segment storing a different octave. We have tools that can convert this to a string or a string based IP to a uint see our Utilities for more information.

queryPort

ushort queryPort;
The query port used by Valve

gamePort

ushort queryPort;
The query port used by Valve

serverVersion

string serverVersion;
The server version to report to Steam Game Server

serverId

CSteamID serverId;
The ID assigned to the Steam Game Server on initialization and logon. This is set by Steam and is what you would as an address to connect to this server

usingGameServerAuthApi

bool usingGameServerAuthApi;
Should the auth API be used

enableHeartbeats

bool enableHeartbeats;
Should we send heartbeats to SGS, if you do not do this then the Steam Game Server Browser will not be able to update ping and other bits of data.

spectatorServerName

bool spectatorServerName;
The name of the server to display in the spectator list

anonymousServerLogin

bool anonymousServerLogin;
Recommended (set this to true)
Should the interface logon anonymously

gameServerToken

string gameServerToken;
if not logging on anonymously then it must have a token https://steamcommunity.com/dev/managegameservers​

isPasswordProtected

bool isPasswordProtected;
Indicate to SGS that this server is password protected, its up to you to set that password and handle its use this only lets the browser know one is required.

gameName

string gameName;
The name to display for the server in the SGS browser

gameDescription

string gameDescription;
The description to display for the server in SGS browser

gameDirectory

string gameDirectory;
the name of the folder in Steam content the game is running from. Usually the same as the game's name.

isDedicated

bool isDedicated;
Indicate to SGS browser this server is dedicated

maxPlayerCount

int maxPlayerCount;
Indicate to SGS what the max player count is

botPlayerCount

int botPlayerCount;
Indicate to SGS what the bot player count is

mapName

string mapName;
reports the map name to SGS

gameData

string gameData;
Delimited string used for matchmaking filtering

rulePairs

List<StringKeyValuePair> rulePairs;
The set of rule pairs for the server

Methods

Init

public void Init();
Used internally to initialize the server APIs

LogOn

public void LogOn();
Used to log the server on, typically this will be called automatically assuming you have set autoLogon to true.