SRCDS Steam group


SRCDS log format
#1
I'd like to write a custom log/stats engine for some LAN parties I'll be hosting at a conference later this year. I want to build somethign geared around LAN parties/tournaments that tracks players and performs some "ticket" issuing that players can copy onto USB dongles as proof of how well they did (long story).

Anyhoo, I'm probably just being a dork, but I can't find any online docs about the log format from SRCDS. I'm reading through the hlstats source code, but I'd prefer to have a real document that describtes the logs rather than hoping that hlstats gets everything right.

Any pointers would be appreciated.
Reply
#2
Hey, gdead. Just out of curiosity, are you an admin on the Khaos TF2 server?
Anyways, I turned srcds logging on and can show you an example of what it looks like, if you want.

Code:
L 10/11/2008 - 06:42:08: Log file started (file "logs\L1011000.log") (game "f:\hlserver\orangebox\tf") (version "3575")
L 10/11/2008 - 06:42:14: server_cvar: "sm_nextmap" "ctf_2fort"
L 10/11/2008 - 06:42:58: World triggered "Round_Start"
L 10/11/2008 - 07:18:54: "-ct- Geoff<3><STEAM_ID_PENDING><>" connected, address "24.11.220.195:27005"
L 10/11/2008 - 07:18:55: "-ct- Geoff<3><STEAM_0:0:13712451><>" STEAM USERID validated
L 10/11/2008 - 07:20:45: "-ct- Geoff<3><STEAM_0:0:13712451><>" entered the game
L 10/11/2008 - 07:20:55: "-ct- Geoff<3><STEAM_0:0:13712451><Unassigned>" joined team "Red"
L 10/11/2008 - 07:20:57: "-ct- Geoff<3><STEAM_0:0:13712451><Red>" changed role to "demoman"
L 10/11/2008 - 07:24:49: Team "Red" triggered "pointcaptured" (cp "0") (cpname "The Roof") (numcappers "1") (player1 "-ct- Geoff<3><STEAM_0:0:13712451><Red>") (position1 "-86 -182 816")

L 10/11/2008 - 14:35:52: "Alfred E. Obama '08<39><STEAM_0:0:18910799><>" entered the game
L 10/11/2008 - 14:35:55: "Alfred E. Obama '08<39><STEAM_0:0:18910799><Unassigned>" joined team "Blue"
L 10/11/2008 - 14:35:56: "Alfred E. Obama '08<39><STEAM_0:0:18910799><Blue>" changed role to "demoman"
L 10/11/2008 - 14:35:57: "Alfred E. Obama '08<39><STEAM_0:0:18910799><Blue>" say "hi"

I usually find it kind of hard to read, so don't know if you want to give this to whoever's going to be at your lan parties. I hope this helped you!
Reply
#3
Yep, I'm one of the admins. I saw you posting on here yesterday. Small world Smile

We're actually building a pretty neat interface for a scoreboard for our LAN party at ShmooCon (a hacker con I help run in DC). The idea is to give ppl in the room who aren't playing something interesting to watch during the games. So we'll be showing real time stats, SRCDS TV, historic stats, and we're also going to periodically be screen cap'ing the various clients to show random pics from different players. Hopefully we'll be able to automatically screen cap each death scene. We'll see how that goes. We've got 4 months to code this up, so it should be pretty cool.

Thanks for the pointers for looking at the logs. I've been heads down in the HLStats code for awhile, and never thought to just look at the logs themselves. It seems that it's basically
- Timestamp
- Player
- Verb (joined, changed teams, killed, etc)
- noun (red, player name, etc).

I'm gutting the hlstats code right now to build a prototype. I think we'd like to write our own version of this from scratch in some other language that's not perl, so I'm hoping to get a complete listing of all possible verb/nouns that might be used in the logs so I don't miss anything.
Reply
#4
gdead Wrote:The idea is to give ppl in the room who aren't playing something interesting to watch during the games. So we'll be showing real time stats, SRCDS TV, historic stats, and we're also going to periodically be screen cap'ing the various clients to show random pics from different players.

Maybe you want to use Psychostats' live view too. See http://www.psychostats.com/forums/index.php?showtopic=18390 and http://www.psychostats.com/pslive-demo/

Here's something for the original topic. These are regular expressions which are used in Psychostats to parse the logs. The columns are gametype, modtype, eventname and regex. Psychostats uses these regular expressions to map each log line to specific function, which in turn parses the log line.

Code:
"halflife";;"kill";"/^\"([^\"]+)\" killed \"([^\"]+)\" with \"([^\"]*)\"(.*)/"
"halflife";;"attacked";"/^\"([^\"]+)\" attacked \"([^\"]+)\" with \"([^\"]+)\"(.*)/"
"halflife";;"plrtrigger";"/^\"([^\"]+)\" triggered \"([^\"]+)\"(.*)/"
"halflife";;"round";"/^World triggered \"([^\"]+)\"(.*)/"
"halflife";;"entered_game";"/^\"([^\"]+)\" entered the game(.*)/"
"halflife";;"joined_team";"/^\"([^\"]+)\" joined team \"([^\"]+)\"/"
"halflife";;"suicide";"/^\"([^\"]+)\" committed suicide with \"([^\"]+)\"(.*)/"
"halflife";;"changed_name";"/^\"([^\"]+)\" changed name to \"([^\"]+)\"/"
"halflife";;"connected";"/^\"([^\"]+)\" connected, address \"([^\"]+)\"/"
"halflife";;"connected_steamid";"/^\"([^\"]+)\" (?:STEAM|VALVE) USERID (.+)/"
"halflife";;"disconnected";"/^\"([^\"]+)\" disconnected/"
"halflife";;"chat";"/^\"([^\"]+)\" say(_team)* \"(.*)\"?(.*)/"
"halflife";;"rcon";"/^(Bad )?Rcon: \"rcon (-*\d+) \"?(.*?)\"? (.+?)(?:\" from \"([^\"]+)\")?/"
"halflife";;"cheated";"/^Secure: \"([^\"]+)\" was detected cheating/"
"halflife";;"ban";"/^(Addip|Ban(?:id)?): \"([^\"]+)\" was (?:kicked and )?(?:banned)(?: by IP)? \"([^\"]+)\" by \"([^\"]+)\"(.*)/"
"halflife";;"unban";"/^Remove(id|ip): \"([^\"]+)\" was unbanned by \"([^\"]+)\"(.*)/"
"halflife";;"kick";"/^Kick: \"([^\"]+)\" was kicked by \"([^\"]+)\"(.*)/"
"halflife";;"pingkick";"/^\"([^\"]+)\" kicked due to high ping(.*)/"
"halflife";;"ffkick";"/^\"([^\"]+)\" has been auto kicked from the game for TKing/"
"halflife";;"startedmap";"/^(Started|Loading) map \"([^\"]+)\"(.*)/"
"halflife";;"logstartend";"/^Log file (started|closed)(.*)/"
"halflife";;"ignored1";"/^[Ss]erver (?:cvars?|say|shutdown)/"
"halflife";;"ignored2";"/^\]TSC\[|Succeeded|FATAL|Loaded/"
"halflife";;"ignored3";"/^Config|Swear|server_/"
"halflife";;"ignored4";"/^\"[^\"]+\" = \"/"
"halflife";"cstrike";"cs_teamscore";"/^Team \"([^\"]+)\" scored \"([^\"]+)\" with \"([^\"]+)\" players/"
"halflife";"cstrike|tf2";"teamtrigger";"/^Team \"([^\"]+)\" triggered \"([^\"]+)\"(.*)/"
"halflife";"cstrike";"cs_ignore1";"/^Counter-Strike Plugin/"
"halflife";"cstrike";"cs_ignore2";"/^Votemap/"
"halflife";"dod";"plrtrigger";"/^\"([^\"]+)\" triggered(?: a)? \"([^\"]+)\"(.*)/"
"halflife";"dod";"dods_scores";"/^Team \"([^\"]+)\" (scored|captured)/"
"halflife";"dod";"dods_ignore1";"/^\"([^\"]+)\" blocked/"
"halflife";"dod|tf2|natural";"changed_role";"/^\"([^\"]+)\" changed role to \"([^\"]+)\"/"
"halflife";"dod";"dod_objitem";"/^\"([^\"]+)\" triggered an objective item/"
"halflife";"dod";"dod_teamscore";"/^\"([^\"]+)\" scored \"([^\"]+)\" with \"([^\"]+)\" players/"
"halflife";"dod";"teamtrigger";"/^Team \"([^\"]+)\" triggered(?: a)? \"([^\"]+)\"(.*)/"
"halflife";"dod";"dod_ignore1";"/^(?:Final)/"
"halflife";;"plugin";"/^\[[\w\d]+\]/"
"halflife";"natural|tf2";"plrtrigger";"/^\"([^\"]+)\" triggered \"([^\"]+)\"(?: against \"([^\"]+)\")?(.*)/"
"halflife";"natural";"ns_mapinfo";"/^\(map_name \"([^\"]+)\"\)(.*)/"
"halflife";"natural";"ns_teamlost";"/^Team \d+ has lost/"
"halflife";"natural";"ns_ignore1";"/^(?:Map validity|Game reset|AvHGamerules|Contact|BUG:|AvHVisibleBlipList)/"
"halflife";"natural";"ns_ignore2";"/^Team \"\d+\" scored/"
"halflife";"natural";"ns_eject_fix";"/^Eject commander: \d+ of \d+ votes needed\.(.*)/"
"halflife";"tf2";"tf2_rcon";"/^rcon from/"
"halflife";"tf2";"tf2_kick";"/^Kick:/"
"halflife";;"ktraj";"/^\[KTRAJ\] \"([^\"]+)\" killed \"([^\"]+)\" with \"([^\"]*)\"(.*)/"

Maybe you don't need to invent the wheel again. Maybe you can create your own fork of Psychostats to suit your needs. It's Perl, though.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)