]> git.xonotic.org Git - xonotic/xonotic.wiki.git/blob - Event-logging.md
Upload attachment SpectatorHUD.jpg
[xonotic/xonotic.wiki.git] / Event-logging.md
1 ## CVars (see xonotic.org/tools/cacs for more up-to-date information)
2
3 * `sv_eventlog`: master switch
4 * `sv_eventlog_files`: print frags, scores and captures for separate files each match
5 * `sv_eventlog_console`: print frags, scores and captures to serverconsole during the match
6 * `sv_logscores_bots`: choose whether bot are included in stats or not
7 * `sv_eventlog_files_counter`: number of matches logged until now
8 * `sv_eventlog_files_nameprefix`: file name prefix to be used 
9 * `sv_eventlog_files_namesuffix`: file name extension to be used
10 * `sv_eventlog_files_timestamps`: prefix log lines in the files with time events
11 * `sv_eventlog_ipv6_delimiter`: change `:` in IPv6 addresses to `_` for easy parsing of :join lines with IPv6 IPs
12
13 Also see: [Score logging](./Score-logging)
14
15 ## Log format
16 ```
17 :logversion:3
18 :gamestart:<gametype>_<mapname>:<matchid>
19 :gameinfo:mutators:LIST:mutator1:mutator2:...
20 ```
21 Note that mutators are listed by their cvar name with g_ removed, unless such a cvar is 1 by default - then the mutator is listed with a no_ prefix if the cvar is 0.
22 ```
23 :gameinfo:end
24 :join:<ID>:<slot>:<ip>:<nickname>
25 :join:<ID>:<slot>:bot:<nickname>
26 :name:<ID>:<nickname>
27 :part:<ID>
28 :team:<ID>:<team>:<jointype>
29 :chat:<ID>:<message>
30 :chat_team:<ID>:<team>:<message>
31 :chat_spec:<ID>:<message>
32 :kill:frag:<ID of killer>:<ID of victim>:type=<death type>:items=<itemstring of killer>:victimitems=<itemstring of victim>
33 :kill:tk:<ID of killer>:<ID of victim>:type=<death type>:items=<itemstring of killer>:victimitems=<itemstring of victim>
34 :kill:suicide:<ID>:<ID>:type=<death type>:items=<itemstring>
35 :kill:accident:<ID>:<ID>:type=<death type>:items=<itemstring>
36 :ctf:steal:<flagcolor>:<teamcolor>:<ID of attacker>
37 :ctf:dropped:<flagcolor>:<teamcolor>:<ID of dropper>
38 :ctf:pickup:<flagcolor>:<teamcolor>:<ID of attacker>
39 :ctf:capture:<flagcolor>:<teamcolor>:<ID of attacker>
40 :ctf:return:<flagcolor>:<teamcolor>:<ID of defender>
41 :ctf:returned:<flagcolor>
42 :dom:taken:<previouscolor>:<ID of player>
43 :ft:autorevival:<ID of revived player>
44 :ft:revival:<ID of revived player>:<ID of reviver1>,<ID of reviver2>,...
45 :keyhunt:capture:<ID of player>:<points for player>:<ID of key owner>:<points for key owner>:<name of key>
46 :keyhunt:carrierfrag:<ID of player>:<points for player>:<ID of key owner>:<points for key owner>:<name of key>
47 :keyhunt:collect:<ID of player>:<points for player>:<ID of key owner>:<points for key owner>:<name of key>
48 :keyhunt:destroyed:<ID of player>:<points for player>:<ID of key owner>:<points for key owner>:<name of key>
49 :keyhunt:destroyed_holdingkey:<ID of player>:<points for player>:<ID of key owner>:<points for key owner>:<name of key>
50 :keyhunt:dropkey:<ID of player>:<points for player>:<ID of key owner>:<points for key owner>:<name of key>
51 :keyhunt:losekey:<ID of player>:<points for player>:<ID of key owner>:<points for key owner>:<name of key>
52 :keyhunt:push:<ID of player>:<points for player>:<ID of key owner>:<points for key owner>:<name of key>
53 :keyhunt:pushed:<ID of player>:<points for player>:<ID of key owner>:<points for key owner>:<name of key>
54 :scores:<gametype>_<mapname>:<map runtime>
55 :labels:player:<head1><flags>,<head2><flags>,...
56 :player:see-labels:<score1>,<score2>,...:<playtime>:<team>:<ID>:<nickname>
57 :player:see-labels:<score1>,<score2>,...:<playtime>:spectator:<ID>:<nickname>
58 :labels:teamscores:<head1><flags>,<head2><flags>,...
59 :teamscores:see-labels:<score1>,<score2>,...:<team>
60 :end
61 :restart
62 :gameover
63 :vote:suggested:<mapname>:<playerid>
64 :vote:keeptwo:<mapname>:<mapvotes>:<mapname>:<mapvotes>:::<mapname>:<mapvotes>:...:didn't vote:<notvoters>
65 :vote:finished:<mapname>:<mapvotes>:::<mapname>:<mapvotes>:<mapname>:<mapvotes>:...:didn't vote:<notvoters>
66 :vote:suggestion_accepted:<mapname>
67 :vote:vcall:<ID of player>:<vote command display string>
68 :vote:vyes:<yescount>:<nocount>:<abstaincount>:<notvoters>:<mincount>
69 :vote:vno:<yescount>:<nocount>:<abstaincount>:<notvoters>:<mincount>
70 :vote:vtimeout:<yescount>:<nocount>:<abstaincount>:<notvoters>:<mincount>
71 :vote:vstop:<ID of stopper>
72 :vote:vlogin:<ID of player>
73 :vote:vdo:<ID of player>:<do command display string>
74 :time:<YYYY-MM-DD HH:MM:SS>
75 :recordset:<ID of player>:<time in seconds>
76 ```
77 Note that only the :join, :name and :player lines ever contain player names. When splitting on ':', keep in mind that those 2 and (and all :chat* message texts) can contain ':'. The :time event only appears in the log files if sv_eventlog_files_timestamps is 1; there is no way to log these time stamps to the console (for console timestamps, set timestamps to 1).
78
79 ### Team colors
80 * 1 = No Team (Domination)
81 * 5 = Red Team
82 * 14 = Blue Team
83 * 13 = Yellow Team
84 * 10 = Pink Team
85
86 ### Join types
87 * 1 = connect
88 * 2 = auto
89 * 3 = manual
90 * 4 = spectating
91 * 6 = adminmove
92
93 ### Label flags
94 * !! = primary sorting key
95 * <!! = primary sorting key, lower is better
96 * ! = secondary sorting key
97 * <! = secondary sorting key, lower is better
98 * < = lower is better
99
100 ### Item string
101 `<weaponid><flags>` or `<weaponid><flags>|<buffs>`
102
103 Where flags can contain:
104 * F = player carries the flag
105 * S = player has strength
106 * I = player has the shield
107 * T = player is typing (console, menu or chat)
108    
109 and weapon IDs are:
110 * 1 = Blaster
111 * 2 = Shotgun
112 * 3 = Machine Gun
113 * 4 = Mortar
114 * 5 = Electro
115 * 6 = Crylink
116 * 7 = Vortex
117 * 8 = Hagar
118 * 9 = Rocket Launcher
119 * 10 = Port-O-Launch
120 * 11 = Vaporizer
121 * 12 = Grappling Hook
122 * 13 = Heavy Laser Assault Cannon
123 * 14 = T.A.G. Seeker
124
125 Weapon IDs are below 10000.
126
127 ### Death type
128 Either a weapon ID ORed with weapon death flags, or one of the notifications in `common/deathtypes.qh` in the form of a string.
129
130 Weapon death flags are:
131 * 256 = secondary fire
132 * 512 = splash damage
133 * 1024 = bounced projectile
134 * 2048 = head shot (Vaporizer only)
135 * 4096 = unused flag
136
137 #### Example programs making use of event logs:
138
139 * [incognico/erebus.pl](https://gitlab.com/incognico/erebus/-/blob/master/erebus.pl) - Links Discord<->Xonotic
140 * [rcon2irc.pl](https://gitlab.com/xonotic/xonotic/-/blob/master/server/rcon2irc/rcon2irc.pl) Links IRC<->Xonotic (a bit outdated)