Zum Inhalt springen

Archiviert

Dieses Thema ist jetzt archiviert und für weitere Antworten gesperrt.

murxx

Neues XML-Log Parsing Tool: select(bf)

Empfohlene Beiträge

Gast

Hi!

Zuerst einmal, ich hab null Ahnung was diese XML- Logs enthalten bzw. wie sie funktionieren.

Aber im BF1942 Linuxserver- Archiv ist unter /readmes/ eine "readme xml-logging.txt mit diesem Inhalt hier enthalten:

------------------------------------------------------------------------------

Battlefield 1942 dedicated server: XML event logging

------------------------------------------------------------------------------

Background

------------------------------------------------------------------------------

To better support server administrators who wish to provide their own player

statistics, DICE has incorporated a new logging system called XML event

logging into the game server.

Available both on Linux and win32, the logger will collect game events and

write them to a file in the "Logs" directory of the currently running game

mod.

The feature is intented for advanced server administrators and is currently

not available through the dedicated server launcher.

Usage

------------------------------------------------------------------------------

To enable the event logger, add the following to your ServerSettings.con file:

  game.serverEventLogging 1

By default the event logger writes uncompressed XML files directly to disk.

These files can easily grow to contain several megabytes during the course of

a game level. Therefore you can enable compression on the files to save disk

space by adding the following line to your ServerSettings.con file:

  game.serverEventLogCompression 1

With compression enabled, files will have a "zxml" extension instead of the

usual "xml" extension to indicate that they are compressed.  The compression

used is the standard zlib compression, and to uncompress the files you will

need to use a zlib-aware program or library. In the Python scripting language,

this can be accomplished by using code such as this:

#! /usr/bin/python

import zlib

import sys

input = open("input.zxml", "r")

output = open("output.xml", "w")

decomp_obj = zlib.decompressobj()

while 1:

  data = input.read(256)

  if len(data) == 0: break

  output.write( decomp_obj.decompress(data) )

input.close()

output.close()

This script snippet will decompress the file "input.zxml" and write the

uncompressed result to the file "output.xml".

Please note that enabling compression will load the server CPU slightly more

and that compressed files are flushed to disk in blocks in a deferred manner

due to the compression algorithms.  Therefore the compression option is

unsuitable for "realtime" monitoring of the xml files.

File format description

------------------------------------------------------------------------------

The resulting XML files are in a well-formed format using XML namespaces.

There is currently no DTD or XML schema for the file format.

Rounds are encapsulated in bf:round tag sections. The total number of rounds

can be found in the bf:server section. Keep in mind that the actual number of

rounds can vary if a server administrator has issued remote commands to change

maps or to restart the level.

Each round contains bf:server section that lists all the server settings in

play for the round. These can be useful if you want to process older statistics

and don't have the ServerSettings.con file at hand or if you prefer to not

process anything but the XML file to generate stats.

Inside a bf:round block you will find bf:event tags. The bf:event tags

together with their children describe something that has happened in the game

server during the course of play. All events have a name tag and a timestamp

to make it clear to the processing program when the event happened. The events

are also sorted in order of occurance.

When a round ends a bf:roundstats block is written out, describing a snapshot

of the scoring similar to what you would see playing the game. The accumulated

statistics for all players are included together with the overall status of

the round such as the winning team and remaining number of tickets. To

calculate the length of the round, subtract the timestamp of the first event

in the round from the timestamp of the bf:roundstats tag.

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi .... :blink:

Hat das schon mal einer unter Windoof zum laufen gebracht .... ????

Also ich bekomme das Tool einfach nicht in gang ....

Help

Speed2207

Link zu diesem Kommentar
Auf anderen Seiten teilen

Gast

Und jetzt soll ich raten was nicht läuft? :D

Schreib doch einfach mal was nicht geht. Hab das zwar nicht unter Windows laufen, aber vielleicht kann ich Dir trotzdem helfen.

Alternativ schau Doch einfach mal bei www.selectbf.org vorbei, vielleicht hatte da wer das gleiche Problem...

Link zu diesem Kommentar
Auf anderen Seiten teilen

Ja das Tool geht ja soweit ... was das Php angeht, aber wie bekomme ich da eine XML Datei oder die CSV rein .... ich bin in PHP oder Java nicht so der beste :)

Hier mal ein Link Selectbf

Er läd mir die log Datein nicht ... der will das immer per FTP laden ... es liegt doch aber auf der selben Festplatte ... :blink:

Link zu diesem Kommentar
Auf anderen Seiten teilen

Gast

Hi!

In der config.xml im Verzeichniss /bin/ hast Du bestimmt noch das hier drinstehen:

<logs>

  <dir live="false">c:\battlefield\mods\bf1942\logs</dir>

  <dir live="false">c:\battlefield\mods\DesertCombat\logs</dir>

  <ftp host="127.0.0.1" port="21" user="user" password="password" live="false">/mods/bf1942/logs</ftp>

  <ftp host="127.0.0.1" port="21" user="user" password="password" live="false">/mods/DesertCombat/logs</ftp>

 </logs>

Wenn die Stats auf der gleichen Maschine wie der BF Server läuft kannst Du die "ftp host" Einträge rausnehmen. Die anderen sind Beispiele die Du noch ändern musst. Einfach anstatt c:\battlefield\mods\bf1942\logs den Pfad zu Deinem Log- Verzeichnissen angeben und dann sollte das funktionieren. dir live="false" kannst Du dann auch noch auf "true" setzen, somit wird die aktuellste Datei ingoniert.

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hallo ....

Danke, durch deine Hilfe geht jetzt Fast alles ... :danke:

Mir ist noch aufgefallen das die Player in der Linste kein Points haben.

selectbf

und wozu sind genau die 2 Bat. Datein im Bin Verzeichnis. :unsure:

Speed2207

Link zu diesem Kommentar
Auf anderen Seiten teilen

@Fisch

Kleiner Wink mit dem Zaunpfahl. (Hoffe du weisst jetzt wieder :)*lol*:P;) )

Du kannst im Adminpanel eine Formel eingeben, nach welchen kreterien die Punkte errechnet werden.

Die ist völlig beliebeig nach eigenen Wünschen zu erstellen.

Da kannst du zum Beispiel angeben, das wer 10x erster(Goldorden) in der Runde war,

dafür jeweils "x"Punte bekommt für den 2 (Silberorden) dafür "x" Punkte bekommt usw..

Das würde dann wie folgt aussehen: (first*3)+(second*2)+(usw.)

Diese Formel kannst du im Adminpanel unter dem Menuepunkt "Ranking" eingeben und erweitern wie es dir beliebt.

Die .bat Datein sind soweit ich weiss für Windows.

Hoffe es hilft dir weiter.

Link zu diesem Kommentar
Auf anderen Seiten teilen

Gast

@Blacky

Ah ok, stimmt ja. :rolleyes:

Hab mir Deine Formal mal angeschaut, sieht eigentlich ganz gut aus. Verbesserungen dazu sind mir eigentlich nicht eingefallen.

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi Ich noch mal ....

Ich habe da schon wieder so ein komisches Porblem :unsure:

Die Selectbf Statistik wird 1 mal am Tag aktualisiert, das dumme ist nur, das die Werte sich dann verdoppeln, weil die Werte in der Datenbank einfach dazu Addiert werden.

Müssten sich die xml Datein nicht löschen wenn die Statistik die Daten eingelesen hat ?

Hilfe :blink:

Speed2207

Link zu diesem Kommentar
Auf anderen Seiten teilen

Gast

Hi!

Ändere mal folgenden Eintrag in Deiner config.xml von:

<after-parsing>remain</after-parsing>

in

<after-parsing>rename</after-parsing>

um. Dann wird jeder Datei die in die Datenbank eingefügt wurde ein .parsed hintendrangehängt. Damit wird dann verhindert dass die Datei 2x in die Datenbank geparsed wird.

Link zu diesem Kommentar
Auf anderen Seiten teilen

Gast

Hi!

Es gibt jetzt doch ne neue Version von select(bf). Die Version ist jetzt 0.4b und wurde am 10.9.2004 upgedated. Ne Changelog gibt es noch nicht, aber ich hab deswegen mal ne Anfrage im Forum gestartet.

Folgende Dateien wurden geändert:

bin\selectbf.jar

php\_setup.php

php\teamdetail.php

php\admin\admin_func.php

php\admin\r_clantag.php

php\admin\update_clans.php

php\include\func.php

php\templates\Default\head.html

Link zu diesem Kommentar
Auf anderen Seiten teilen

Gast

Hi!

Letzte Woche wurde trotz der Ankündigung dass select(bf) nicht mehr weiterentwickelt wird eine 0.5test Version von select(bf) released:

The 0.5test-Version contains the following new fixes/features:

    * New libraries on all fronts (Therefore perhaps fixes for FTP)

    * Hopefully all MySQL-fixes

    * PHP-page caching for less CPU-usage

Link zu diesem Kommentar
Auf anderen Seiten teilen



  • Wer ist Online   0 Benutzer

    • Keine registrierten Benutzer online.
×
×
  • Neu erstellen...

Wichtige Information

Wir haben Cookies auf Deinem Gerät platziert. Das hilft uns diese Webseite zu verbessern. Du kannst die Cookie-Einstellungen anpassen, andernfalls gehen wir davon aus, dass Du damit einverstanden bist, weiterzumachen.