MW3 console log Parser
#1
Hi guys,
I am wondering if someone can help me out. I am after a MW3 console log parser that will extract players GUIDs / XUIDs and their alias.

I would prefer for it to be web based where I can either upload or point to FTP location to the log file and then parser it.
In additon a search feature to allow searches of player names.

eg Cyanide,
Would punch out my GUID and a list of aliases I have used.

Any help is more than appreciated.

Cheers
Reply

#2
Hello,

I made a little parser, i hope this is what you want...
It uses the lines of player connection, disconnection and spawn, if you need other modify the code or ask me...

Source code 'index.php':
[code=php]
<?php
// Include the parser class
include_once('Parser.class.php');

// Instantiate the parser with the logfile location
$Parser = new Parser('logs/console.log');

// Show the final results
$Parser->show();
?>
[/code]

Source code 'Parser.class.php':
[code=php]
<?php
class Parser {

// Store the players // The keys are the XUID and the value is an array that contains the names
private $players = array();

public function __construct($log_file)
{
// Open the log file
$file = @fopen($log_file, "r");
// If fopen returned true
if ($file) {
// Loop the file
while (($line = fgets($file, 4096)) !== false) {
// If the line is a Player connection, spawn or disconnect
if (preg_match("#\[[0-9]{2}:[0-9]{2}:[0-9]{2}\] Connect#", $line) || preg_match("#\[[0-9]{2}:[0-9]{2}:[0-9]{2}\] Spawn#", $line) || preg_match("#\[[0-9]{2}:[0-9]{2}:[0-9]{2}\] Disconnect#", $line))
{
// Explode the line to get the infos
$player_info = explode(';', $line);
// If the player array contains the xuid
if(array_key_exists($player_info[1], $this->players))
{
// If the name is not already stored
if (!in_array($player_info[3] ,$this->players[$player_info[1]]))
{
// Store the name
$this->players[$player_info[1]][] = $player_info[3];
}
}
else
{
// Add the XUID key
$this->players[$player_info[1]] = array();
// Store the name
$this->players[$player_info[1]][] = $player_info[3];
}
}
}
// If failed
if (!feof($file)) {
echo "Error: fgets() failed\n";
}
// Close the file
fclose($file);
}
}

public function show()
{
// Loop the players array
foreach($this->players as $key => $value)
{
// Print the XUID key
echo '<strong>'.$key.'</strong><br />';
// Loop the names linked to the XUID
foreach($this->players[$key] as $name)
{
// Print Names
echo '&nbsp;&nbsp;&nbsp;- '.$name.'<br />';
}
echo '<br />';
}
}

public function __destruct()
{
}
}
?>
[/code]

[Edit]
In the second block of code, at the line 59 the &nbsp; are interpreted... why????? it is between [kode=php] [/kode]


Attached Files
.zip   mw3_consolelog_parser.zip (Size: 1.43 KB / Downloads: 56)
Reply

#3
Narkos,
This is just fantastic,
I appreciate this so much. Cheers.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help MW3 (External) Console - TeknoMW3? Strazeeh 7 10,815 10-01-2013, 21:54
Last Post: DeHEnergY
  Help MW3 (External) Console - TeknoMW3? Strazeeh 2 5,877 09-30-2013, 19:19
Last Post: surtek
  [Request] MW2 EXTERNAL CONSOLE!!! thomiromi 4 7,716 09-26-2013, 18:02
Last Post: Rendflex
  console or server browser MW2 kerm007 1 4,987 08-30-2013, 21:52
Last Post: Nekochan
  [News] T6 Console [PC] zer0w 42 41,207 08-08-2013, 17:27
Last Post: Bandarigoda123
Wink Help MW3 Server Console Bandarigoda123 0 4,100 07-26-2013, 04:01
Last Post: Bandarigoda123
  Help Help in address console Bandarigoda123 2 4,581 07-20-2013, 15:46
Last Post: Bandarigoda123
  [Release] Black Ops 1 "External" Console barata 16 26,331 07-19-2013, 21:15
Last Post: Jakeyellis
  [HELP] bo2 - FD1 - dis-attach the console from the game masis 8 7,976 07-17-2013, 23:01
Last Post: surtek
  Black Ops 1 External Console meowgasm 8 13,455 07-04-2013, 00:57
Last Post: Nekochan

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.