Posts
283
Likes
386
Background
I've been working on several server scripts the last couple of months one example of which is the money system on my server. These scripts work by reading the g_log for updates, parsing them and then acting on the information. While working with this log I found a couple things that could be improved.

Note: the log snippets in this post are gathered with OpenJK and the following options:
Code:
set g_logExplicit "3"
set g_logClientInfo "1"
set com_logChat "2"

Improvements

1. Reduce the amount of ClientUserinfoChanged spam at round start

Currently ClientUserinfoChanged gets recorded too often at round round start, this results in a larger log file and more data to process that is often completely unnecessary. There are cases where these lines differ but these are few and far between.

Example:
Code:
 27:18 ClientConnect: (redacted) ID: 0 (IP: redacted)
 27:18 ClientUserinfoChanged: 0 n\redacted\t\3\m\clonetrooper_p1/arc\c1\16726784\c2\255\sc\none\s1\single_1\s2\none\sdt\1\v\0\s\0\mbc\14
 27:18 ClientUserinfoChanged: 0 n\redacted\t\3\m\clonetrooper_p1/arc\c1\16726784\c2\255\sc\none\s1\single_1\s2\none\sdt\1\v\0\s\0\mbc\14
 27:18 ClientUserinfoChanged: 0 n\redacted\t\3\m\clonetrooper_p1/arc\c1\16726784\c2\255\sc\none\s1\single_1\s2\none\sdt\1\v\0\s\0\mbc\14
 27:18 ClientBegin: 0
 27:18 ClientConnect: (redacted) ID: 1 (IP: redacted)
 27:18 ClientUserinfoChanged: 1 n\redacted\t\3\m\mbmandy/mbrgb1\c1\16711904\c2\16711904\sc\none\s1\single_1\s2\none\sdt\2\v\0\s\0\mbc\13
 27:18 ClientUserinfoChanged: 1 n\redacted\t\3\m\mbmandy/mbrgb1\c1\16711904\c2\16711904\sc\none\s1\single_1\s2\none\sdt\2\v\0\s\0\mbc\13
 27:18 ClientUserinfoChanged: 1 n\redacted\t\3\m\mbmandy/mbrgb1\c1\16711904\c2\16711904\sc\none\s1\single_1\s2\none\sdt\2\v\0\s\0\mbc\13
 27:18 ClientBegin: 1
 27:18 ClientConnect: (redacted) ID: 2 (IP: redacted)
 27:18 ClientUserinfoChanged: 2 n\redacted\t\1\m\clonetrooper_p2/501_rgb\c1\16726784\c2\255\sc\none\s1\single_1\s2\none\sdt\1\v\0\s\0\mbc\12
 27:18 ClientUserinfoChanged: 2 n\redacted\t\3\m\clonetrooper_p2/501_rgb\c1\16726784\c2\255\sc\none\s1\single_1\s2\none\sdt\1\v\0\s\0\mbc\12
 27:18 ClientUserinfoChanged: 2 n\redacted\t\3\m\clonetrooper_p2/501_rgb\c1\16726784\c2\255\sc\none\s1\single_1\s2\none\sdt\1\v\0\s\0\mbc\12
 27:18 ClientBegin: 2
 27:18 ClientConnect: (redacted) ID: 3 (IP: redacted)
 27:18 ClientUserinfoChanged: 3 n\redacted\t\1\m\bespin_cop/default\c1\64767\c2\255\sc\none\s1\single_1\s2\none\sdt\1\v\0\s\0\mbc\2
 27:18 ClientUserinfoChanged: 3 n\redacted\t\3\m\bespin_cop/default\c1\64767\c2\255\sc\none\s1\single_1\s2\none\sdt\1\v\0\s\0\mbc\2
 27:18 ClientUserinfoChanged: 3 n\redacted\t\3\m\bespin_cop/default\c1\64767\c2\255\sc\none\s1\single_1\s2\none\sdt\1\v\0\s\0\mbc\2

2. Log teamkills explicitly
Currently I have to record a game state to determine if players got a kill or teamkill. It would be much easier and less error prone if the Kill message in the log states if its a teamkill or not.

Example:
Code:
 43:10 Kill: 8 0 87: <teamkiller> killed <redacted> by MOD_SABER
 43:11 Kill: 2 11 62: <redacted> killed <redacted> by MOD_ROCKET_SPLASH
 43:18 Kill: 8 7 87: <teamkiller> killed <redacted> by MOD_SABER
 43:23 Kill: 12 2 62: <redacted> killed <redacted> by MOD_ROCKET_SPLASH
 43:23 Kill: 12 3 62: <redacted> killed <redacted> by MOD_ROCKET_SPLASH
 43:25 Kill: 12 17 6: <redacted> killed <redacted> by MOD_FALLING
 43:29 Kill: 8 8 11: <teamkiller> killed <teamkiller> by MOD_TOOMANYTKS
 43:29 Kill: 8 4 87: <teamkiller> killed <redacted> by MOD_SABER
 43:29 Kill: 18 5 32: <redacted> killed <redacted> by MOD_BOWCASTER
 43:29 Kill: 12 10 62: <redacted> killed <redacted> by MOD_ROCKET_SPLASH
 43:29 ClientDisconnect: 8
 43:29 Client 8 dropped: Kicked due to too many teamkill points!

3. Log objective completions
Objective completions are not recorded in the g_log at all and I have to extrapolate the data from the print command in the console. I would like to know the client ID of the person completing the objective and if possible also know if any secondary objectives are completed throughout the round.

4. Log NPC names
Currently NPCs get logged as a kill with only the internal ID and the name missing. It would be amazing if the internal name could be added to this line. Additionally it would also be nice if teamkills could be worked in here too.

Example youngling on mb2_jeditemple:
Code:
 2:11 Kill: 1 451 87: <redacted> killed  by MOD_SABER
 

Defiant

Nerd
Project Leader
Movie Battles II Team
Code Leader
Posts
1,038
Likes
1,514
The log file is not an API. It is for fault finding and moderation purposes. Specifically flagging team kills is probably the only thing on that list that is valid for the log file.
 
Posts
268
Likes
249
Would it be possible to have vstr on smod level to be also logged ? As well as smod say ? In the future, this helps for moderation purposes. Thanks
 
Posts
283
Likes
386
The log file is not an API. It is for fault finding and moderation purposes. Specifically flagging team kills is probably the only thing on that list that is valid for the log file.
You are right it's not an API. But besides me framing the issues I raised in this post like I want to use it as an API, I really think all of the improvements are justified.
 
Top