Difference between revisions of "Generic Source Server Events"

From AlliedModders Wiki
Jump to: navigation, search
(Generic Source Server Events)
m (player_info)
 
(12 intermediate revisions by 6 users not shown)
Line 1: Line 1:
These 'should' apply to all Source Engine Servers
+
:''Refer back to [[Game Events (Source)]] for more events.''
 +
 
 +
These '''should''' apply to all Source Engine Servers
 
=== server_spawn ===
 
=== server_spawn ===
{{qnotice|Send once a server starts}}<br>
+
{{qnotice|Send once a server starts (spawns)}}<br>
{{begin-hl2msg|server_start|string}}
+
{{begin-hl2msg|server_spawn|string}}
{{hl2msg|string|hostname}}
+
{{hl2msg|string|hostname|public host name}}
{{hl2msg|string|address}}
+
{{hl2msg|string|address|hostame, IP or DNS name}}
{{hl2msg|string|port}}
+
{{hl2msg|string|ip|}}
{{hl2msg|string|game}}
+
{{hl2msg|string|port|server port}}
{{hl2msg|string|mapname}}
+
{{hl2msg|string|game|game dir}}
{{hl2msg|long|maxplayers}}
+
{{hl2msg|string|mapname|map name}}
{{hl2msg|string|os}}
+
{{hl2msg|long|maxplayers|max players}}
{{hl2msg|bool|dedicated}}
+
{{hl2msg|string|os|WIN32, LINUX}}
{{hl2msg|bool|password}}
+
{{hl2msg|bool|dedicated|true if dedicated server}}
 +
{{hl2msg|bool|official|true if official valve dedicated server}}
 +
{{hl2msg|bool|password|true if password protected}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 17: Line 21:
 
{{qnotice|Server shut down}}
 
{{qnotice|Server shut down}}
 
{{begin-hl2msg|server_shutdown|string}}
 
{{begin-hl2msg|server_shutdown|string}}
{{hl2msg|string|reason}}
+
{{hl2msg|string|reason|reason why server was shut down}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 23: Line 27:
 
{{qnotice|A server console var has changed}}
 
{{qnotice|A server console var has changed}}
 
{{begin-hl2msg|server_cvar|string}}
 
{{begin-hl2msg|server_cvar|string}}
{{hl2msg|string|cvarname}}
+
{{hl2msg|string|cvarname|cvar name, eg "mp_roundtime"}}
{{hl2msg|string|cvarvalue}}
+
{{hl2msg|string|cvarvalue|new cvar value}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
=== server_msg ===
+
=== server_message ===
 
{{qnotice|A generic server message}}
 
{{qnotice|A generic server message}}
 
{{begin-hl2msg|server_message|string}}
 
{{begin-hl2msg|server_message|string}}
{{hl2msg|string|text}}
+
{{hl2msg|string|text|the message text}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 36: Line 40:
 
{{qnotice|When the server has a ban added}}
 
{{qnotice|When the server has a ban added}}
 
{{begin-hl2msg|server_addban|string}}
 
{{begin-hl2msg|server_addban|string}}
{{hl2msg|string|name}}
+
{{hl2msg|string|name|player name}}
{{hl2msg|string|userid}}
+
{{hl2msg|string|userid|user ID on server}}
{{hl2msg|string|networkid}}
+
{{hl2msg|string|networkid|player network (i.e steam) id}}
{{hl2msg|string|ip}}
+
{{hl2msg|string|ip|IP address}}
{{hl2msg|string|duration}}
+
{{hl2msg|string|duration|length of the ban}}
{{hl2msg|string|by}}
+
{{hl2msg|string|by|banned by...}}
{{hl2msg|bool|kicked}}
+
{{hl2msg|bool|kicked|whether the player was also kicked}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 48: Line 52:
 
{{qnotice|When the server has a ban removed}}
 
{{qnotice|When the server has a ban removed}}
 
{{begin-hl2msg|server_removeban|string}}
 
{{begin-hl2msg|server_removeban|string}}
{{hl2msg|string|networkid}}
+
{{hl2msg|string|networkid|player network (i.e steam) id}}
{{hl2msg|string|ip}}
+
{{hl2msg|string|ip|IP address}}
{{hl2msg|stsring|by}}
+
{{hl2msg|string|by|removed by...}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
 
=== player_connect ===
 
=== player_connect ===
{{qnotice|A new player connected}}
+
{{qnotice|A new client connected}}
 
{{begin-hl2msg|player_connect|string}}
 
{{begin-hl2msg|player_connect|string}}
{{hl2msg|string|name}}
+
{{hl2msg|string|name|player name}}
{{hl2msg|byte|index}}
+
{{hl2msg|byte|index|player slot (entity index-1)}}
{{hl2msg|short|userid}}
+
{{hl2msg|short|userid|user ID on server (unique on server)}}
{{hl2msg|string|networkid}}
+
{{hl2msg|string|networkid|player network (i.e steam) id}}
{{hl2msg|string|address}}
+
{{hl2msg|string|address|ip:port}}
 +
{{hl2msg|short|bot|is a bot}}
 +
{{end-hl2msg}}
 +
 
 +
=== player_connect_client ===
 +
{{qnotice|A new client connected, only present in OB}}
 +
{{begin-hl2msg|player_connect_client|string}}
 +
{{hl2msg|string|name|player name}}
 +
{{hl2msg|byte|index|player slot (entity index-1)}}
 +
{{hl2msg|short|userid|user ID on server (unique on server)}}
 +
{{hl2msg|string|networkid|player network (i.e steam) id}}
 +
{{hl2msg|short|bot|is a bot}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
 
=== player_info ===
 
=== player_info ===
{{qnotice|A player changed his name}}
+
{{qnotice|A player changed their name}}
 
{{begin-hl2msg|player_info|string}}
 
{{begin-hl2msg|player_info|string}}
{{hl2msg|string|name}}
+
{{hl2msg|string|name|player name}}
{{hl2msg|byte|index}}
+
{{hl2msg|byte|index|player slot (entity index-1)}}
{{hl2msg|short|userid}}
+
{{hl2msg|short|userid|user ID on server (unique on server)}}
{{hl2msg|string|networkid}}
+
{{hl2msg|string|networkid|player network (i.e steam) id}}
{{hl2msg|bool|bot}}
+
{{hl2msg|bool|bot|true if player is a AI bot}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 76: Line 91:
 
{{qnotice|A client was disconnected}}
 
{{qnotice|A client was disconnected}}
 
{{begin-hl2msg|player_disconnect|string}}
 
{{begin-hl2msg|player_disconnect|string}}
{{hl2msg|short|userid}}
+
{{hl2msg|short|userid|user ID on server}}
{{hl2msg|string|reason}}
+
{{hl2msg|string|reason|reason the player left the server}}
{{hl2msg|string|name}}
+
{{hl2msg|string|name|player name}}
{{hl2msg|string|networkid}}
+
{{hl2msg|string|networkid|player network (i.e steam) id}}
 +
{{hl2msg|short|bot|is a bot}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 85: Line 101:
 
{{qnotice|A client has entered the game (connected and loaded)}}
 
{{qnotice|A client has entered the game (connected and loaded)}}
 
{{begin-hl2msg|player_activate|string}}
 
{{begin-hl2msg|player_activate|string}}
{{hl2msg|short|userid}}
+
{{hl2msg|short|userid|user ID on server}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 91: Line 107:
 
{{qnotice|When a client sends a message in chat}}
 
{{qnotice|When a client sends a message in chat}}
 
{{begin-hl2msg|player_say|string}}
 
{{begin-hl2msg|player_say|string}}
{{hl2msg|short|userid}}
+
{{hl2msg|short|userid|user ID on server}}
{{hl2msg|string|text}}
+
{{hl2msg|string|text|the say text}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}

Latest revision as of 19:40, 4 May 2022

Refer back to Game Events (Source) for more events.

These should apply to all Source Engine Servers

server_spawn

Note: Send once a server starts (spawns)

Name: server_spawn
Structure:
string hostname public host name
string address hostame, IP or DNS name
string ip
string port server port
string game game dir
string mapname map name
long maxplayers max players
string os WIN32, LINUX
bool dedicated true if dedicated server
bool official true if official valve dedicated server
bool password true if password protected


server_shutdown

Note: Server shut down

Name: server_shutdown
Structure:
string reason reason why server was shut down


server_cvar

Note: A server console var has changed

Name: server_cvar
Structure:
string cvarname cvar name, eg "mp_roundtime"
string cvarvalue new cvar value


server_message

Note: A generic server message

Name: server_message
Structure:
string text the message text


server_addban

Note: When the server has a ban added

Name: server_addban
Structure:
string name player name
string userid user ID on server
string networkid player network (i.e steam) id
string ip IP address
string duration length of the ban
string by banned by...
bool kicked whether the player was also kicked


server_removeban

Note: When the server has a ban removed

Name: server_removeban
Structure:
string networkid player network (i.e steam) id
string ip IP address
string by removed by...


player_connect

Note: A new client connected

Name: player_connect
Structure:
string name player name
byte index player slot (entity index-1)
short userid user ID on server (unique on server)
string networkid player network (i.e steam) id
string address ip:port
short bot is a bot


player_connect_client

Note: A new client connected, only present in OB

Name: player_connect_client
Structure:
string name player name
byte index player slot (entity index-1)
short userid user ID on server (unique on server)
string networkid player network (i.e steam) id
short bot is a bot


player_info

Note: A player changed their name

Name: player_info
Structure:
string name player name
byte index player slot (entity index-1)
short userid user ID on server (unique on server)
string networkid player network (i.e steam) id
bool bot true if player is a AI bot


player_disconnect

Note: A client was disconnected

Name: player_disconnect
Structure:
short userid user ID on server
string reason reason the player left the server
string name player name
string networkid player network (i.e steam) id
short bot is a bot


player_activate

Note: A client has entered the game (connected and loaded)

Name: player_activate
Structure:
short userid user ID on server


player_say

Note: When a client sends a message in chat

Name: player_say
Structure:
short userid user ID on server
string text the say text