Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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':
PHP Code
  1. <?php
  2. // Include the parser class
  3. include_once('Parser.class.php');
  4.  
  5. // Instantiate the parser with the logfile location
  6. $Parser = new Parser('logs/console.log');
  7.  
  8. // Show the final results
  9. $Parser->show();
  10. ?>


Source code 'Parser.class.php':
PHP Code
  1. <?php
  2. class Parser {
  3.  
  4. // Store the players // The keys are the XUID and the value is an array that contains the names
  5. private $players = array();
  6.  
  7. public function __construct($log_file)
  8. {
  9. // Open the log file
  10. $file = @fopen($log_file, "r");
  11. // If fopen returned true
  12. if ($file) {
  13. // Loop the file
  14. while (($line = fgets($file, 4096)) !== false) {
  15. // If the line is a Player connection, spawn or disconnect
  16. 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))
  17. {
  18. // Explode the line to get the infos
  19. $player_info = explode(';', $line);
  20. // If the player array contains the xuid
  21. if(array_key_exists($player_info[1], $this->players))
  22. {
  23. // If the name is not already stored
  24. if (!in_array($player_info[3] ,$this->players[$player_info[1]]))
  25. {
  26. // Store the name
  27. $this->players[$player_info[1]][] = $player_info[3];
  28. }
  29. }
  30. else
  31. {
  32. // Add the XUID key
  33. $this->players[$player_info[1]] = array();
  34. // Store the name
  35. $this->players[$player_info[1]][] = $player_info[3];
  36. }
  37. }
  38. }
  39. // If failed
  40. if (!feof($file)) {
  41. echo "Error: fgets() failed\n";
  42. }
  43. // Close the file
  44. fclose($file);
  45. }
  46. }
  47.  
  48. public function show()
  49. {
  50. // Loop the players array
  51. foreach($this->players as $key => $value)
  52. {
  53. // Print the XUID key
  54. echo '<strong>'.$key.'</strong>';
  55. // Loop the names linked to the XUID
  56. foreach($this->players[$key] as $name)
  57. {
  58. // Print Names
  59. echo '   - '.$name.'';
  60. }
  61. echo '';
  62. }
  63. }
  64.  
  65. public function __destruct()
  66. {
  67. }
  68. }
  69. ?>


[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: 33)
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 8,711 10-01-2013, 21:54
Last Post: DeHEnergY
  Help MW3 (External) Console - TeknoMW3? Strazeeh 2 4,368 09-30-2013, 19:19
Last Post: surtek
  [Request] MW2 EXTERNAL CONSOLE!!! thomiromi 4 5,711 09-26-2013, 18:02
Last Post: Rendflex
  console or server browser MW2 kerm007 1 3,588 08-30-2013, 21:52
Last Post: Nekochan
  [News] T6 Console [PC] zer0w 42 31,561 08-08-2013, 17:27
Last Post: Bandarigoda123
Wink Help MW3 Server Console Bandarigoda123 0 3,210 07-26-2013, 04:01
Last Post: Bandarigoda123
  Help Help in address console Bandarigoda123 2 3,402 07-20-2013, 15:46
Last Post: Bandarigoda123
  [Release] Black Ops 1 "External" Console barata 16 19,127 07-19-2013, 21:15
Last Post: Jakeyellis
  [HELP] bo2 - FD1 - dis-attach the console from the game masis 8 5,880 07-17-2013, 23:01
Last Post: surtek
  Black Ops 1 External Console meowgasm 8 9,616 07-04-2013, 00:57
Last Post: Nekochan

Forum Jump:


Users browsing this thread:
1 Guest(s)

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