Blackops Log Access

General Support & Discussion related to the Call of Duty Series including COD1, COD2, COD4, COD:WAW, United Offensive and Blackops.
TracerNZ
No Longer a Newb
Posts: 45
Joined: Thu Dec 16, 2010 11:15 am

Re: Blackops Log Access

Post by TracerNZ » Wed Mar 02, 2011 1:50 am

Would be great if it logged caps/defends/plants/defuses.
BLACKOPS.NET.NZ
PUGs at 9:30pm(NZ) most nights on BLACKOPS.NET.NZ PUG/Scrim [Unranked]

whitebox
No Longer a Newb
Posts: 130
Joined: Fri Nov 12, 2010 2:25 pm

Re: Blackops Log Access

Post by whitebox » Wed Mar 02, 2011 7:20 am

TracerNZ wrote:Would be great if it logged caps/defends/plants/defuses.


and IP (only on quit or join would be enough) :D

sCon
What's Frag Mean?
Posts: 250
Joined: Tue Feb 22, 2011 5:44 pm
Location: At My Desk!
Contact:

Re: Blackops Log Access

Post by sCon » Thu Mar 03, 2011 10:59 am

Would be awesome if they recorded score as well ...
Image
sCon Mod - 100% Online InGame Admin Tool! http://www.sconmod.com
Join us on Facebook - http://www.facebook.com/sConMod

hogrampage
No Longer a Newb
Posts: 36
Joined: Mon Nov 08, 2010 6:49 pm

Re: Blackops Log Access

Post by hogrampage » Thu Mar 03, 2011 7:04 pm

@whitebox, I have a test version of ultra stats getting stats from a log file every 30 minutes (I read the log file every minute or so with a cron job that updates a separate log file on our FTP, then I use the query script to read the one that's updated on our FTP). Is that similar to what you're doing? I started on modifying the code just last weekend, but I'm not good with the looks or anything lol:

http://hog-hq.com/newmodules/bostats/index.php?

I also added a signature for players because I thought it would be nice to have that. As you can see from the stats pages a) I'm a terrible page designer and b) it's not even close to done lol. College is taking up all my time :(.

If you need any help, I'd be interested.

SJ777
No Longer a Newb
Posts: 132
Joined: Mon Nov 08, 2010 3:02 pm
Location: Orrstraalia

Re: Blackops Log Access

Post by SJ777 » Thu Mar 03, 2011 8:47 pm

I wonder if some of you experienced php devs might be able to help me.

Im not a noob at php but Im not an expert either in terms of the best way to do certain things. Specifically im looking for a "best practice" way of getting the last 50k or whatever of logs and then doing the parsing. I am able to get the log using the range header etc using a curl get method and have done some chat log parsing.

But the thing I'm trying to do is figure out the best way to continually get the "next" set of log lines I need and I've seen references to stream_contexts and reading from file versions of the log rather than just straight from the http get response in memory.

can anyone suggest or provide code that will do this?

Thanks in advance.

TracerNZ
No Longer a Newb
Posts: 45
Joined: Thu Dec 16, 2010 11:15 am

Re: Blackops Log Access

Post by TracerNZ » Thu Mar 03, 2011 11:24 pm

The trickiest part is deciding which is a new line since the last scan and which is not, particularly with multiple damage lines which are potentially(and likely) identical. When you come up with a good method which isn't slow let me know. ;)
BLACKOPS.NET.NZ
PUGs at 9:30pm(NZ) most nights on BLACKOPS.NET.NZ PUG/Scrim [Unranked]

whitebox
No Longer a Newb
Posts: 130
Joined: Fri Nov 12, 2010 2:25 pm

Re: Blackops Log Access

Post by whitebox » Fri Mar 04, 2011 6:13 am

@hogrampage I am not working on ultra stats, i did everything from the scratch. Also I dont use FTP.
Directly fetching the file with the range header and running though the lines every minute.
The log-fetcher is completly finished and supports multiple servers at once.

@TracerNZ,@SJ777 When log file is fetched I put it into an array, then remove the first line
and check the last timestamp. This timestamp i put into a cache file. Then I let the code
run though all lines starting from the previous timestamp cache file until smaller then the current timestamp.
Also other checks are beeing done, for instance if the server would have crashed.

TracerNZ
No Longer a Newb
Posts: 45
Joined: Thu Dec 16, 2010 11:15 am

Re: Blackops Log Access

Post by TracerNZ » Fri Mar 04, 2011 8:28 am

Yes but the timestamps are only down to 1 second resolution so you will get duplicate damage lines or miss some that way. I find g_logTimestampInSeconds is awesome though, gives you a unix timestamp of exactly when the line occured rather than time since server restart.
BLACKOPS.NET.NZ
PUGs at 9:30pm(NZ) most nights on BLACKOPS.NET.NZ PUG/Scrim [Unranked]

whitebox
No Longer a Newb
Posts: 130
Joined: Fri Nov 12, 2010 2:25 pm

Re: Blackops Log Access

Post by whitebox » Fri Mar 04, 2011 10:17 am

TracerNZ wrote:Yes but the timestamps are only down to 1 second resolution so you will get duplicate damage lines or miss some that way. I find g_logTimestampInSeconds is awesome though, gives you a unix timestamp of exactly when the line occured rather than time since server restart.


I am not using unix timestamp.

I let the coderun though all lines starting from the previous timestamp cache file [del]until[/del] while smaller then the current timestamp.

while ($line_timestamp < $cached_timestamp) ... not =<

I dont get dups.

SJ777
No Longer a Newb
Posts: 132
Joined: Mon Nov 08, 2010 3:02 pm
Location: Orrstraalia

Re: Blackops Log Access

Post by SJ777 » Sat Mar 05, 2011 11:11 pm

Thanks for the responses guys. I'm also using the unixtimestamp format but I'm only looking for Join and Chat info at this stage so I should have no problems with the methods suggested.

I'll do some some tests.

TracerNZ
No Longer a Newb
Posts: 45
Joined: Thu Dec 16, 2010 11:15 am

Re: Blackops Log Access

Post by TracerNZ » Sat Mar 05, 2011 11:44 pm

whitebox wrote:
TracerNZ wrote:Yes but the timestamps are only down to 1 second resolution so you will get duplicate damage lines or miss some that way. I find g_logTimestampInSeconds is awesome though, gives you a unix timestamp of exactly when the line occured rather than time since server restart.


I am not using unix timestamp.

I let the coderun though all lines starting from the previous timestamp cache file [del]until[/del] while smaller then the current timestamp.

while ($line_timestamp < $cached_timestamp) ... not =<

I dont get dups.

As an example, how will your code handle this if it were split? Doesn't matter if you use linux timestamp or time since server reboot, it's still only 1 second resolution.

Code: Select all

1296537925 D;***;7;axis;[zOps]tw!tch.zOps;***;5;allies;TwoToes;spas_mp;30;MOD_HEAD_SHOT;head
1296537925 D;***;7;axis;[zOps]tw!tch.zOps;***;5;allies;TwoToes;spas_mp;30;MOD_HEAD_SHOT;head
1296537925 D;***;7;axis;[zOps]tw!tch.zOps;***;5;allies;TwoToes;spas_mp;30;MOD_HEAD_SHOT;head
1296537925 K;***;7;axis;[zOps]tw!tch.zOps;***;5;allies;TwoToes;spas_mp;30;MOD_HEAD_SHOT;head

Code: Select all

1296537796 K;***;2;allies;Claytonator;***;6;axis;Nudie;knife_mp;136;MOD_MELEE;left_arm_upper
1296537796 D;***;7;allies;[zOps]tw!tch.zOps;***;8;allies;T0X1C;aug_mp;35;MOD_RIFLE_BULLET;right_leg_upper
1296537796 D;***;7;allies;[zOps]tw!tch.zOps;***;8;allies;T0X1C;aug_mp;35;MOD_RIFLE_BULLET;torso_lower
1296537796 K;***;7;allies;[zOps]tw!tch.zOps;***;8;allies;T0X1C;aug_mp;35;MOD_RIFLE_BULLET;torso_lower

Code: Select all

1296537676 D;***;8;allies;T0X1C;***;2;allies;Claytonator;spas_mp;13;MOD_PISTOL_BULLET;right_leg_upper
1296537676 D;***;8;allies;T0X1C;***;2;allies;Claytonator;spas_mp;13;MOD_PISTOL_BULLET;left_leg_upper
1296537676 D;***;8;allies;T0X1C;***;2;allies;Claytonator;spas_mp;16;MOD_PISTOL_BULLET;right_hand
1296537676 D;***;8;allies;T0X1C;***;2;allies;Claytonator;spas_mp;18;MOD_PISTOL_BULLET;torso_lower
1296537676 K;***;8;allies;T0X1C;***;2;allies;Claytonator;spas_mp;18;MOD_PISTOL_BULLET;torso_lower


Code: Select all

3977:56 D;***;11;allies;HappyStar;***;4;axis;Fordfreak;famas_gl_mp;35;MOD_RIFLE_BULLET;torso_lower
3977:56 D;***;17;allies;[1337]TehTommeh=;***;10;axis;A Dodgy Violin;mp5k_rf_mp;20;MOD_PISTOL_BULLET;left_hand
3977:56 D;***;11;allies;HappyStar;***;4;axis;Fordfreak;famas_gl_mp;35;MOD_RIFLE_BULLET;right_foot
3977:56 K;***;17;allies;[1337]TehTommeh=;***;10;axis;A Dodgy Violin;mp5k_rf_mp;20;MOD_PISTOL_BULLET;torso_lower
3977:56 K;***;11;allies;HappyStar;***;4;axis;Fordfreak;famas_gl_mp;35;MOD_RIFLE_BULLET;torso_lower
BLACKOPS.NET.NZ
PUGs at 9:30pm(NZ) most nights on BLACKOPS.NET.NZ PUG/Scrim [Unranked]

whitebox
No Longer a Newb
Posts: 130
Joined: Fri Nov 12, 2010 2:25 pm

Re: Blackops Log Access

Post by whitebox » Sun Mar 06, 2011 7:30 am

TracerNZ wrote:Yes but the timestamps are only down to 1 second resolution so you will get duplicate damage lines or miss some that way. I find g_logTimestampInSeconds is awesome though, gives you a unix timestamp of exactly when the line occured rather than time since server restart.


Mate.. your logfile examples are way too short.

I thought it was pretty clear.. but.. here another example of the process.

4:08 is cached. Then the code will run through 4:08 until 4:11 ...... 4:15 will be cached

Code: Select all

  3:41 J;64331657;1;[ArA]WHiTEBOX
  3:47 J;0;0;[3arc]democlient
  4:08 D;20637605;5;allies;dTeam # LiQuiD;21593468;4;axis;Rueg] Operator;ak74u_rf_m...
  4:10 D;64331657;1;allies;[ArA]WHiTEBOX;55528309;2;axis;[ArA]Mr100[SwE];ak74u_rf_...
  4:10 D;64331657;1;allies;[ArA]WHiTEBOX;55528309;2;axis;[ArA]Mr100[SwE];ak74u_rf_...
  4:10 K;64331657;1;allies;[ArA]WHiTEBOX;55528309;2;axis;[ArA]Mr100[SwE];ak74u_rf_...
  4:11 D;21593468;4;axis;Rueg] Operator;20637605;5;allies;dTeam # LiQuiD;ak47_silenc...
  4:11 D;21593468;4;axis;Rueg] Operator;20637605;5;allies;dTeam # LiQuiD;ak47_silenc...
  4:11 K;21593468;4;axis;Rueg] Operator;20637605;5;allies;dTeam # LiQuiD;ak47_silenc...
  4:15 D;50151117;3;allies;[Stz]Saintz | Baal;29097130;6;axis;[SEF]Ra[V]eN;ak74u_rf_m...
  4:15 D;50151117;3;allies;[Stz]Saintz | Baal;29097130;6;axis;[SEF]Ra[V]eN;ak74u_rf_m...



Next run..
At this point 4:15 is cached. The code will run from 4:15 until 4:29 .. and 4:30 will be cached.

Code: Select all

  4:10 K;64331657;1;allies;[ArA]WHiTEBOX;55528309;2;axis;[ArA]Mr100[SwE];ak74u_rf_...
  4:11 D;21593468;4;axis;Rueg] Operator;20637605;5;allies;dTeam # LiQuiD;ak47_silenc...
  4:11 D;21593468;4;axis;Rueg] Operator;20637605;5;allies;dTeam # LiQuiD;ak47_silenc...
  4:11 K;21593468;4;axis;Rueg] Operator;20637605;5;allies;dTeam # LiQuiD;ak47_silenc...
  4:15 D;50151117;3;allies;[Stz]Saintz | Baal;29097130;6;axis;[SEF]Ra[V]eN;ak74u_rf_m...
  4:15 D;50151117;3;allies;[Stz]Saintz | Baal;29097130;6;axis;[SEF]Ra[V]eN;ak74u_rf_m...
  4:15 K;50151117;3;allies;[Stz]Saintz | Baal;29097130;6;axis;[SEF]Ra[V]eN;ak74u_rf_m...
  4:19 J;47160263;7;[SEF]Ultra
  4:29 Weapon;29097130;6;Ra[V]eN;ak74u_rf_mp
  4:29 D;20637605;5;allies;dTeam # LiQuiD;29097130;6;axis;[SEF]Ra[V]eN;ak74u_rf_mp...
  4:30 D;20637605;5;allies;dTeam # LiQuiD;29097130;6;axis;[SEF]Ra[V]eN;ak74u_rf_mp...
  4:30 K;20637605;5;allies;dTeam # LiQuiD;29097130;6;axis;[SEF]Ra[V]eN;ak74u_rf_mp...


I hope you understand the process by these examples now. There wont be dups or missing data.

originalhandy
Click my affiliate link
Posts: 352
Joined: Fri Feb 05, 2010 12:28 am
Location: Nuevo Mexico

Re: Blackops Log Access

Post by originalhandy » Wed Mar 09, 2011 1:41 am

Where did you get the test ultrastats from ?

PeLeXaT
No Longer a Newb
Posts: 38
Joined: Sun Oct 17, 2010 1:40 pm
Location: Spain
Contact:

Re: Blackops Log Access

Post by PeLeXaT » Mon Mar 14, 2011 9:38 pm

Is it possible make a ultrastats for joomla???

Thanks

eidunet
GameServers.com Forum Newb
Posts: 8
Joined: Wed Feb 02, 2011 12:01 am

Re: Blackops Log Access

Post by eidunet » Wed Mar 16, 2011 2:29 pm

hogramage
If you dont mind me asking how did you setup a file to get the updated server logs?

Does anyone know the command to set up a script to get logs from black ops server?

Thanks

Post Reply