Log Files

From WinBolo

(Difference between revisions)
Jump to: navigation, search
Line 3: Line 3:
== File Format ==
== File Format ==
-
Log files are stored in a zip compressed file with the extension of wlg. The zip file contains a single file log.dat which contains the log file data.
+
Log files are stored in a zip compressed file with the extension of wlg. The zip file contains a single file log.dat which contains the log file data encrypted using XOR with a rotating key.
 +
 
 +
The file format could be described as a finite state machine that follows the following
 +
 
 +
<HEADER>  -> <SNAPSHOT> -> <STATE> or <SNAPSHOT>  -> <QUIT>
Line 34: Line 38:
=== Snapshot ===
=== Snapshot ===
-
=== Log Items ===
+
=== Log States ===
 +
 
 +
The list of log states that are stored in the log file are located in bolo/log.h. The are:
 +
 
 +
<pre>
 +
#define LOG_QUIT 0
 +
#define LOG_NOEVENTS 1
 +
#define LOG_NOEVENTS_LONG 2
 +
#define LOG_EVENT 3
 +
#define LOG_EVENT_LONG 4
 +
#define LOG_EVENT_SNAPSHOT 5
 +
</pre>
 +
 
 +
 
 +
=== Log Event Items ===

Revision as of 18:41, 26 November 2008

Winbolo log files are server recorded files that allow a game to be replayed via the Log Viewer application.

Contents

File Format

Log files are stored in a zip compressed file with the extension of wlg. The zip file contains a single file log.dat which contains the log file data encrypted using XOR with a rotating key.

The file format could be described as a finite state machine that follows the following

<HEADER> -> <SNAPSHOT> -> <STATE> or <SNAPSHOT> -> <QUIT>


Header

The header of the log file is as followed

  • 8 byte header WBOLOMOV
  • 1 byte version number (currently 0)
  • Map name stored as a Pascal String
  • 1 byte Game Type
  • 1 byte boolean allow hidden mines setting
  • 1 byte AI Type
  • 1 byte boolean password used
  • 1 byte maximum number of players in the game
  • 1 byte WinBolo major version number
  • 1 byte WinBolo minor version number
  • 1 byte WinBolo revision version number
  • 4 bytes server IP address (sprintf(serverIP, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);)
  • 2 bytes server port in host network byte order.
  • 4 bytes game creation time in network byte order.
  • 32 byte WBN server key (all 0's for non participant)


The last byte of the creation time (network byte order) becomes the first encryption key.

The header must be immediately followed by a snapshot.


Snapshot

Log States

The list of log states that are stored in the log file are located in bolo/log.h. The are:

#define LOG_QUIT 0
#define LOG_NOEVENTS 1
#define LOG_NOEVENTS_LONG 2
#define LOG_EVENT 3
#define LOG_EVENT_LONG 4
#define LOG_EVENT_SNAPSHOT 5


Log Event Items

The list of log items that are stored in the log file are located in bolo/log.h. The are:

/* The events we record in our log file */
typedef enum {
log_PlayerJoined=1,
log_PlayerQuit,
log_PlayerLocation,
log_LgmLocation,
log_MapChange,
log_Shell,
log_SoundBuild,
log_SoundFarm,
log_SoundShoot,
log_SoundHitTank,
log_SoundHitTree,
log_SoundHitWall,
log_SoundMineLay,
log_SoundMineExplode,
log_SoundExplosion,
log_SoundBigExplosion,
log_SoundManDie,
log_MessageServer,
log_MessageAll,
log_MessagePlayers,
log_ChangeName,
log_AllyRequest,
log_AllyAccept,
log_AllyLeave,
log_BaseSetOwner,
log_BaseSetStock,
log_PillSetOwner,
log_PillSetHealth,
log_PillSetPlace,
log_PillSetInTank,
log_SaveMap,
log_LostMan,
log_KillPlayer,
log_PlayerRejoin,
log_PlayerLeaving,
log_PlayerDied
} logitem;
Personal tools