|
|
#1 (permalink) |
|
Honorary Member
Join Date: Jun 2006
Age: 32
Posts: 1,039
Rep Power: 4
|
HI,
Can anyone show me or provide me with a script to be able get log output from a css server via php?, i think from there i can send it straight into the database. I want to have a look if its possible to integrate into my stats program. At the moment im thinking it wont provide much benefit over me manually importing the logfiles (5 min job per match, provided all playes have correct steam id's). There are a number of reasons why grabbing the logs from the server through UDP might not provide much benefit - match starting times can be different - who playes who - which event to choose - registered vs unregistered players - server crashes Please bear in mind im not a coder by profession or make out to be one , have an understanding of arrays and functions, but no object orientated php.Thanks in advance. Happy to work with someone on this. |
|
|
|
|
|
|
|
#2 (permalink) |
|
Participating Member
|
Your best bet is to look at PHP KBot written by Khaless (http://sourceforge.net/projects/kbot-irc/).
That has logComms.class.php, logParser.class.php which appear to provide code which handles recieving log information from the server. css_rconpugbot.php appears to have code which should show how to use it, although you'll need the RCon code to send the rcon command to tell the server your listening. css_defines.inc.php seems to have the information that the log can process, I think. Your other option is to look at automating the process that you currently do manually.
__________________
KeyDecoder This is where I say something witty and original, like this. |
|
|
|
|
|
#3 (permalink) |
|
Honorary Member
Join Date: Jun 2006
Age: 32
Posts: 1,039
Rep Power: 4
|
Cheers Key, will look and see it can work.
All do manually atm is - dload the logfile via FTP to me local desktop - using my upload script i upload to www.euro26.com.au and the rest is automated |
|
|
|
|
|
#5 (permalink) |
|
Contributing Member
Join Date: Jun 2006
Posts: 607
Rep Power: 3
|
Here's some help.
Instantiate the log parser (http://kbot-irc.svn.sourceforge.net/...74&view=markup) $logParser = new logParser; then you can use an event driven model. Register events like so $logParser->registerHandler(PATTERN, $object, 'methodNameToCall'); Please note, I define a few patterns in http://kbot-irc.svn.sourceforge.net/...21&view=markup so one can say: $logParser->registerHandler(KILLS, $object, 'kill'); Once you have this setup you can then either a) pipe the file into the log handler or b) pipe UDP data to the log handler (buffering on lines)
__________________
92% of teens have moved on to rap. If you are part of the 8% who still listen to real music, copy and paste this into your signature. |
|
|
|
|
|
#8 (permalink) | |
|
Contributing Member
Join Date: Jun 2006
Posts: 607
Rep Power: 3
|
Quote:
The log format is plain text sent in upd packets (remote logging) or written to a local file.
__________________
92% of teens have moved on to rap. If you are part of the 8% who still listen to real music, copy and paste this into your signature. |
|
|
|
|
|
|
#9 (permalink) | |
|
Honorary Member
Join Date: Jun 2006
Age: 32
Posts: 1,039
Rep Power: 4
|
Quote:
I had no idea about define and constants (one of the issues of self teaching i guess with no structure), looks like they will be good to use. |
|
|
|
|
|
|
#18 (permalink) |
|
Honorary Member
Join Date: Jun 2006
Age: 32
Posts: 1,039
Rep Power: 4
|
Im liking this OOP, its good to be able to change the state of an object, e.g. for a match class, setting which half it is, max rounds etc. Far easier than using if :then, do:while statements.
I also like how the objects can hold arrays as well as other info and the inheritance side of things. yes im a noob.
|
|
|
|
|
|
#21 (permalink) |
|
Contributing Member
Join Date: Jun 2006
Posts: 607
Rep Power: 3
|
OOP is actually quite an interesting road and many times (including by me) done completely incorrectly. Make sure (as well as practicing it!) to read up on the theory.
__________________
92% of teens have moved on to rap. If you are part of the 8% who still listen to real music, copy and paste this into your signature. |
|
|
|


, have an understanding of arrays and functions, but no object orientated php.



