Server:Web Interface

From Silent Wings Wiki
Jump to: navigation, search

The MP server will post info by HTTP to a web server at regular intervals.

The web server can be specified with the -web command line switch:

swserver -web=www.silentwings.no


Server info

On startup it sends the following parameters in a HTTP POST:

script name: /multiplayer/server_update/

Name=<server name>
Scenery=<scenery name>
Address=<ip address>
Task=<task string>
TaskDist=<task distance>
Port=<port number>
NumPlayers=<num players>
MaxPlayers=<max num players>
Uptime=<current uptime>

If there is a task, the task points are specified as:

TP<n>=<name>,<lat>,<lon>,<elev>,<beercan radius>,<angle1>,<angle2>,<obs.zone>

where <n> is a number from 0 to num TP-1.

This script should return a single line

ID=<integer>

This ID will be used for subsequent server updates

At regular intervals, this info is updated with the same script the two parameters

ID=<server id>
NumPlayers=<num players>
Uptime=<current uptime>


Player info

When a new player joins, the following info is sent:

script name: /multiplayer/player_update/

Name=%s&Nick=%s&Aircraft=%s&Reg=%s&CompID=%s&ServerID=%d

Returns

ID=<player id>

Subsequent updates:

ID=%d&ServerID=%d&Crashed=%d&OnGround=%d&Idle=%d&Altitude=%d&Latitude=%.5f&Longitude=%.5f&Speed=%.1f&Heading=%d&TaskDist=%.1f&TaskTime=%d&Finished=%d