Author Topic: PXO Replacement - Need FS2Open Team coordination  (Read 4845 times)

0 Members and 1 Guest are viewing this topic.

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
PXO Replacement - Need FS2Open Team coordination
if someone can help me figure out what signals freespace 2 send to the PXO servers over TCP and UDP i should be able to write a linux-based replacement that using an SQL server


[update]

Protocol Finished, i need you guys to start writing a browser in the game and i'll start coding the server
« Last Edit: February 14, 2003, 11:44:08 am by 30 »
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

  

Offline Stealth

  • Braiiins...
  • 211
damn, i have no clue, but i'm interested to seewhat it really does send

 

Offline penguin

  • Eudyptes codus
  • 28
  • Still alive.
Once upon a time (about 8 months ago) I did a tcpdump of the interaction between an FS2 client and the PXO servers.

IIRC, there are 3 servers you are connected to at PXO:
  • a game/channel server (pretty much vanilla IRC); this one is the chat server and it keeps track of the state of all currently running games in each channel
  • a user server, which does the user/password login and validation, and keeps track of stats.  I think this was a binary protocol.
  • a web server (plain old straight HTTP), that I think only serves banner ads
Then of course there are the game servers themselves, but they're outside the realm of PXO (and we have source for this).

This is all from my vague memory, but I think I still have the tcpdump logs on my box at home.

Since you're running Linux, you should have no problem reading them.  Ethereal is a great tool for looking at the dumps.
your source code slave

 

Offline Stealth

  • Braiiins...
  • 211
yeah that sounds about right.  glad you hardcore programmers are doing this and not me :p

 

Offline Inquisitor

I thought you were giving up on helping us, K?
No signature.

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
nah, i was just getting bored
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
looks like they completely ripped every trace of PXO out of the released code

so it looks like we have to design the new protocol


hmm

ok.. let's figure out what the server has to store


1) Active Server List
2) User Accounts
3) Permanant User Stats (pilots)
4) validated missions

now time to figure out what storing this data entails

well

Active Server List contains the following data
[list=1]
  • Status
  • Type (game type, and dedicated/not dedicated)
  • Server Netspeed
  • Server Name
  • Players
  • Ping (handled by client not server)
  • [/list=1]

    permanant users is just username/password/email

[see trailing posts for #3]


Validated missions is just the file name and it's crc
« Last Edit: February 13, 2003, 02:11:36 pm by 30 »
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
ok storing player stats entails storing
[list=1]
  • Name
  • Points
  • Enemy Kills/Friend Kills/Assists
  • Missions Flown
  • Flight Time
  • Last Flown Time
  • Kills by Ship Type
  • Primary Shots/Hits/Friendly Hits
  • Secondary Shots/Hits/Friendly Hits
  • [/list=1]

    and I just remembered that the server also has to know what the valid tables are - names and crcs -- we could also runs seperate ports on the stats server for seperate mods *raises eyebrow*
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 
ignore this if it doesn't makes sence, i'm a n00b in prgramming
what about this:

you simply transfer tables and models the way missions are transfered now. you use a temporary folder, so that yu wn't do anything to backwards compatibility. u use a flag or something in the mission to define wich table it uses, and if no flag is found, the basic table will be used. off course, this will take a long time on slow conections,so i guess hosts should include something of a sign that a player sees before joining on how big the data transfer is. once again, i don't know if this is possible, i'm just trying to help
just another newbie without any modding, FREDding or real programming experience

you haven't learned masochism until you've tried to read a Microsoft help file.  -- Goober5000
I've got 2 drug-addict syblings and one alcoholic whore. And I'm a ****ing sociopath --an0n
You cannot defeat Windows through strength alone. Only patience, a lot of good luck, and a sledgehammer will do the job. --StratComm

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
because you may not need to transfer just tables - you may have to trasnfer hundreds of megabytes of mod files.. so no
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
Quote
Originally posted by Kazan

Active Server List contains the following data
[list=1]
  • Status
  • Type (game type, and dedicated/not dedicated)
  • Server Netspeed
  • Server Name
  • Players
  • Ping (handled by client not server)
  • [/list=1]
     [/B]



these are both UDP packets


this one is sent Client->Server and when the Server receives it sends back the server list to the sender of this packet
Code: [Select]

struct serverlist_request_packet
{
     int pid; //  0x1 : serverlist request
     int type; // so you can request only servers of a certain time
     int status; // so you can request only servers of a certain status
}



the server list will be sent one server at a time - each server being on UDP packet containing this
Code: [Select]

struct serverlist_reply_packet
{
      int pid; // 0x2 : serverlist reply
      char servername[65];
      int netspeed;
      int status;
      short players;
      int type; // binary bitmask for type and dedicated server
}


a server sends this UDP packet to the server every 60 seconds has a "Heartbeat" telling the server it's here - if one isn't received for 120 seconds  the server is dropped from the list
Code: [Select]

struct serverlist_hb_packet
{
      int pid; // 0x3 : serverlist register
      char servername[65];
      int netspeed;
      int status;
      short players;
      int type; // binary bitmask for type and dedicated server
}
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
Quote
Originally posted by Kazan

2) User Accounts


login UDP datagrams

login request
Code: [Select]

struct fs2open_pxo_login
{
         int pid; // 0x4 : fs2open_pxo_login
         char username[65];
         char password[65];        
}

and the reply

Code: [Select]

struct fs2open_pxo_lreply
{
         int pid; // 0x5
         bool login_status; // true if successful, false if failed
         int sid; // if (login_status) sid = session id, ip associated and expires after 1 hour
         int pilots; // if (login_status) pilots = number of pilots for this account
}
« Last Edit: February 14, 2003, 11:17:05 am by 30 »
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
Quote
Originally posted by Kazan

4) validated missions



request
Code: [Select]

struct fs2open_file_check
{
          int pid; // 0x5 for missions 0x7 for tables
}


reply
Code: [Select]

struct file_record
{
         char name[60];
         int crc32;
}

struct fs2open_pxo_missreply
{
         int pid; // 0x6 for missions 0x8 for tables
         int num_files;
         file_record files[num_files];
}
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline IceFire

  • GTVI Section 3
  • 212
    • http://www.3dap.com/hlp/hosted/ce
In terms of interface...some kind of external software (like Gamespy for instance) or would we be able to use the art provided in the game?
- IceFire
BlackWater Ops, Cold Element
"Burn the land, boil the sea, you can't take the sky from me..."

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
Quote
Originally posted by IceFire
In terms of interface...some kind of external software (like Gamespy for instance) or would we be able to use the art provided in the game?


since the protocol is published you could have an internal browser and an external browser
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
here's a dump of the mysql database

# phpMyAdmin MySQL-Dump
# version 2.3.2
# http://www.phpmyadmin.net/ (download page)
#
# Host: localhost
# Generation Time: Feb 14, 2003 at 11:36 AM
# Server version: 3.23.54
# PHP Version: 4.3.0
# Database : `FS2Open`
# --------------------------------------------------------

#
# Table structure for table `Missions`
#

CREATE TABLE Missions (
  FileName text,
  CRC32 int(11) default NULL,
  Type tinytext,
  Players tinyint(4) default NULL,
  Description text,
  Mod tinytext NOT NULL
) TYPE=MyISAM;
# --------------------------------------------------------

#
# Table structure for table `Pilot`
#

CREATE TABLE Pilot (
  UserName tinytext,
  PilotName tinytext,
  Points bigint(20) unsigned NOT NULL default '0',
  Missions int(10) unsigned NOT NULL default '0',
  Time bigint(20) unsigned NOT NULL default '0',
  LastFlight timestamp(14) NOT NULL,
  Kills int(10) unsigned NOT NULL default '0',
  Assists int(10) unsigned NOT NULL default '0',
  FriendlyKills int(10) unsigned NOT NULL default '0',
  PriShots int(10) unsigned NOT NULL default '0',
  PriHits int(10) unsigned NOT NULL default '0',
  PriFHits int(10) unsigned NOT NULL default '0',
  SecShots int(10) unsigned NOT NULL default '0',
  SecHits int(10) unsigned NOT NULL default '0',
  SecFHist int(10) unsigned NOT NULL default '0',
  KillsType blob
) TYPE=MyISAM;
# --------------------------------------------------------

#
# Table structure for table `Tables`
#

CREATE TABLE Tables (
  FileName tinytext NOT NULL,
  CRC32 int(11) NOT NULL default '0',
  Mod tinytext NOT NULL
) TYPE=MyISAM;
# --------------------------------------------------------

#
# Table structure for table `UserAccounts`
#

CREATE TABLE UserAccounts (
  UserName tinytext,
  PassWord tinytext,
  Email tinytext,
  Squadron tinytext
) TYPE=MyISAM;
« Last Edit: February 15, 2003, 05:20:42 pm by 30 »
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
Quote
Originally posted by Kazan
ok storing player stats entails storing
[list=1]
  • Name
  • Points
  • Enemy Kills/Friend Kills/Assists
  • Missions Flown
  • Flight Time
  • Last Flown Time
  • Kills by Ship Type
  • Primary Shots/Hits/Friendly Hits
  • Secondary Shots/Hits/Friendly Hits
  • [/list=1]

     [/B]


Code: [Select]

struct fs2open_get_pilot
{
          int pid; // 0x9
          int sid; // session id returned upon login
          char pilotname[65];
          bool create; // create pilot
}

struct fs2open_ship_typekill
{
          char name[65];
          unsigned int kills;
}

struct fs2open_pilot_reply
{
         int pid; // 0x0A
         int replytype; // 0 = pilot retrieved, 1 = pilot created, 2 = invalid pilot, 3 = invalid (expired?) sid, 4 = pilot already exists

         // if and only if (replytype == 0) then the rest of this data
         unsigned double points; // need large values, closest we can internally get to mySQL's bigint
         unsigned int missions;
         unsigned double flighttime;
         int LastFlight;
         int Kills;
         int Assists;
         int FriendlyKills;
         int PriShots;
         int PriHits;
         int PriFHits;
         int SecShots;
         int SecHits;
         int SecFHist;
         
         int ship_types;
         fs2open_ship_typekill type_kills[ship_types];
}



struct fs2open_pilot_update
{
         int pid; // 0x0B
         int sid; // session ud
         unsigned double points; // need large values, closest we can internally get to mySQL's bigint
         unsigned int missions;
         unsigned double flighttime;
         int LastFlight;
         int Kills;
         int Assists;
         int FriendlyKills;
         int PriShots;
         int PriHits;
         int PriFHits;
         int SecShots;
         int SecHits;
         int SecFHist;
         
         int ship_types;
         fs2open_ship_typekill type_kills[ship_types];          

         
}

struct fs2open_pilot_updatereply
{
         int pid; // 0x0C
         int replytype; // 0 = pilot updated, 1  = invalid pilot, 2 = invalid (expired?) sid
         
}
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
I'm working on the server software right now
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
getting back to the transfer of mods, though it is not feasable to transfer hundreds of megabytes of mod data, could it be posable to set up a system were smaller mods could be transfered, maybe have a list of files in the current data directory that are vital to the current mod so normaly that would just be the tables a few models and a few PCXs, all we would realy need then is a way to update the ship statistics and models and all that other good stuff wich should be in it's own topic
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together