This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

GameTech WarMod


Post New Thread Reply   
 
Thread Tools Display Modes
dangan
Junior Member
Join Date: Jun 2008
Location: Hobart, Tasmania, Austra
Old 08-04-2008 , 07:53  
Reply With Quote #121

Whoa, having problems with 1.3.2 (as opposed to 1.2.10):

Why when I turn on `wm_stats_enabled` and the match is live does the log echo in the console? This is making it hard to debug my own stuff.

I noticed when the match is live kills, attacks, bomb plants, et al. has a lot of extra fields and `hitgroup` has been numerated as well as lots of other cool stats - pity there's no docs to go with.

EDIT: Found the culprit - LogToOpenFileEx() which echos to console and writes to file, it's called in Log2Game() which doesn't seem necessary since the only two advantages of LogToOpenFileEx() seem to be is that it echos to console (sv_logecho does this with main log stream anyway) and it flushes a write to file immediately (sv_logflush does this with the main log stream anyway).

Last edited by dangan; 08-04-2008 at 08:27.
dangan is offline
Twelve-60
Senior Member
Join Date: Aug 2007
Old 08-05-2008 , 05:56   Re: GotGames WarMod
Reply With Quote #122

Hi, the reason is uses Log2Game(), is that it actually calls LogToOpenFileEx() and LogToGame().

LogToOpenFileEx() is used for creating the custom log files to prevent the log files from being touched by "log on" (which closes the log and starts a new one), and also so it can be renamed properly.

LogToGame() is used so it goes through the UDP stream, so the extra stats can be used to either do live statistics on a match, or for doing live scorebots etc

Documentation will soon be written, I just haven't had time lately!

- Twelve-60
__________________
Twelve-60 is offline
dangan
Junior Member
Join Date: Jun 2008
Location: Hobart, Tasmania, Austra
Old 08-05-2008 , 07:29   Re: GotGames WarMod
Reply With Quote #123

Yeah, I understand all that (I have been source-diving today), in that case can there be a cvar to determine whether LogToOpenFileEx() is used in this case because it does clutter my console screen - I know I can fix it fix myself but I'd rather not fork the mod.

(Two other minor things that you might already be aware of; the LogToOpenFileEx() entries don't have the WarMod triggered prefix and WarMod triggered "name<uid><steamid><team>" triggered "ready" is a bit grammatically dodgy.)
dangan is offline
Twelve-60
Senior Member
Join Date: Aug 2007
Old 08-05-2008 , 08:30   Re: GotGames WarMod
Reply With Quote #124

It is the LogToGame() that echos to console, not LogToOpenFileEx(), I can make a CVAR so that it only uses LogToOpenFileEx() if you particularly want.

And I'll change the logs to WarMod triggered "player_ready" "name<uid><steamid><team>"

Edit: On second thought, if you don't need LogToOpenFileEx(), why use the stats feature?

- Twelve-60
__________________

Last edited by Twelve-60; 08-05-2008 at 09:39.
Twelve-60 is offline
dangan
Junior Member
Join Date: Jun 2008
Location: Hobart, Tasmania, Austra
Old 08-05-2008 , 17:58  
Reply With Quote #125

Nah, it's definitely LogToOpenFileEx() that echos to console, since the echos in the console and the _yyyy-mm-dd-hhmm-map.log are both missing the 'WarMod triggered' prefix when the main log stream (and main log files) has the prefix.

warmod.sp
Code:
Log2Game(const String:Format[], any:...) {
	[...]
	LogToGame("WarMod triggered %s", buffer); // <- with prefix, goes to main log stream
	if (g_log_file != INVALID_HANDLE)
		LogToOpenFileEx(g_log_file, buffer); // <- without prefix, echos and goes to _yyyy-mm-dd-hhmm-map.log
}
svn.alliedmods.net sourcemod/trunk/core/Logger.cpp
Code:
void Logger::LogToOpenFileEx(FILE *fp, const char *msg, va_list ap)
{
	[...]
	fprintf(fp, "L %s: %s\n", date, buffer); // <- I assume this writes to filehandle
	g_SMAPI->ConPrintf("L %s: %s\n", date, buffer); // <- I assume this Prints to Con(sole)
}
dangan is offline
Twelve-60
Senior Member
Join Date: Aug 2007
Old 08-06-2008 , 05:03   Re: GotGames WarMod
Reply With Quote #126

Strange, no idea why that would log to console, but my point still stands haha, if you aren't using LogToOpenFileEx(), then you might as well just turn stats off

- Twelve-60
__________________
Twelve-60 is offline
dangan
Junior Member
Join Date: Jun 2008
Location: Hobart, Tasmania, Austra
Old 08-06-2008 , 07:09   Re: GotGames WarMod
Reply With Quote #127

I disagree - as I understand it, if you turn on wm_stats_enabled then Log2Game() is called on events like player_hurt, live_on_3, full_time et al.
Log2Game() calls both LogToGame() and LogToOpenFileEx().
LogToGame() sends to main log (file and udp - the 'log on' server log).
LogToOpenFileEx() sends to alternate log (echo and flushed file - the warmod only log).
If wm_stats_enabled is off, then I don't get any stats at all. (I want the stats but not on LogToOpenFileEx(), just through LogToGame())

What I wanted is the cvar to select between
  • No stats at all OR
  • Stats only on main log OR <- this is the mode I want to use which cannot be done with the 1.3.2
  • Stats only on alternate log OR
  • Stats on both logs
dangan is offline
Twelve-60
Senior Member
Join Date: Aug 2007
Old 08-08-2008 , 12:27   Re: GotGames WarMod
Reply With Quote #128

Fair enough, i'd like to know your reasoning for only wanting the server logs as they contain warmod logs AND the normal servers logs, being extremely cluttered, whereas the warmod logs have all the stats and everything contained in the server log but only 1 copy

I'll add wm_stats_method anyway

- Twelve-60
__________________
Twelve-60 is offline
Twelve-60
Senior Member
Join Date: Aug 2007
Old 08-08-2008 , 13:12   Re: GotGames WarMod
Reply With Quote #129

Updated to 1.3.3

- Twelve-60
__________________
Twelve-60 is offline
dangan
Junior Member
Join Date: Jun 2008
Location: Hobart, Tasmania, Austra
Old 08-09-2008 , 02:21  
Reply With Quote #130

Thanks, good work by the way.

As for why I wanted it like that, I am writing a stats program in Perl/PHP. The Perl listens to the UDP traffic, uses a bunch of regex on it and sends it to mysql server. The PHP then displays what is in the db.

I organise the CSS comp for Dark-Media Lans in Tassie, I usually have multiple servers so I needed a stats system that would work with that and all my other requirements. So I started writing it off the back of WarMod logs.

Since I am looking into the logs so much I decided to write some documentation for it. It's not great but it's a start.
dangan is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode