fgms 0.11.8
The
FlightGear MultiPlayer Server
project
FG Tracker

The FlightGear Tracker tracks flights performed on multiplayer server.

Note
  • Flights are indexed and stored by their Callsign
  • The following data is logged
    • Start Time
    • End Time
    • Max altitude
    • Aircraft
    • Duration
    • Total distance
    • Max ground speed
    • Max Mach

The Tracker comprises:

Tracker Protocol

  • There are five types of messages exchanged:
    • CONNECT
    • POSITION
    • DISCONNECT
    • PING
    • PONG

Originally, the tcp exchange between Tracker Client and the Tracker Server only occurred when there was a message to send. This meant it was unknown if the Tracker Server was connected until it actually came time to send the message.

The way it was written originally meant messages would be lost. So hazuki introduced the PING/PONG messages at the same time he added a save so no messages would be lost.

Todo:
(pete) Expalin messages more

Tracker Server

  • The Tracker server is run as a standalone application, seperate from fgms
  • It could be located on another machine on the internet
  • It can track more than one mpserver
  • The tracker is created as part of the install process, see Tracker Install

Dev Info

The source code for the tracker server is in the contrib/fgtracker/ directory and the application is written is c. (see server.c).

Tracker Client

  • The client is embedded in fgms itelf (see FG_TRACKER by julien)
  • The tracker client is configured in tracker_config section of the Configuration file
Note
  • Only locally attached clients are forwarded to the tracker.
  • Pilots connected to fgms with server.tracked disabled will never appear on the tracker.

Dev Info

Internally fgms prepares the messages, and sends them

  • first to an IPC msgsnd (m_ipcid, &buf, ... )
  • and are received by FG_TRACKER, msgrcv (ipcid, &buf, ...)
  • then written to the tracker socket - SWRITE( m_TrackerSocket, msg, ... )

The reason for using the unix IPC mechanism was due to the FG_TRACKER being run in a fork() process, thus does not have shared memory. Hence the unix msgsnd/msgrcv IPC.

For windows, a FG_TRACKER thread, was introduced by geoff since there is no fork() in windows; a simple vector msg_queue, protected by a mutex is used to pass these messages internally from FG_SERVER to FG_TRACKER.