Author Topic: FS2NetD 0.1 (DEMO!)  (Read 4769 times)

0 Members and 1 Guest are viewing this topic.

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
i am starting to add the FS2NetD code into the client - i have it where it will hit the server with a server list request packet.. but it kinda freeze on return rightn ow - probably a time out thing ... i'm working on it

================= EDIT UPDATE ==============

a working demo is available here: http://deepbluebettas.com/Fs2Open/fs2netd_demo.zip

contains Special version of FS2 Open (CVS Build actually)

Full FS2NetD support
Also has my new D3D 8 screenshots fix.
« Last Edit: September 25, 2003, 05:04:32 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 Starks

  • 29
FS2NetD 0.1 (FS2Open PXO server) stuff
HOLY TARANIS BATMAN!
Formerly of the Dark Wings and Legion of Apocalypse

 
FS2NetD 0.1 (FS2Open PXO server) stuff
any ETC?

wasn't there the need for a IRC client first or something?

note: i have the flue right now, and i am not thinking clearly, ignore this if it doesn't make sense.
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
FS2NetD 0.1 (FS2Open PXO server) stuff
no ETC

IRC is seperate from my code
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
FS2NetD 0.1 (FS2Open PXO server) stuff
this mass of code gives me headaches - you cannot find where anything is - especially since [V] removed all evidence of the PXO code ever having existed - and since they code is so..... cornfusing..
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
FS2NetD 0.1 (FS2Open PXO server) stuff
i have a server pinging the fs2open PXO server with heartbeat packets... now to get the damn client list request to succeed
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
FS2NetD 0.1 (FS2Open PXO server) stuff
a couple of changed functions

Code: [Select]

void multi_join_load_tcp_addrs()
{
char line[MAX_IP_STRING];
net_addr addr;
server_item *item;
CFILE *file = NULL;
static char Server[32];
static int port = -1;

//if (On_FS2Open_PXO)
if (true) // THIS TO BE FIXED WHEN WE'RE FINISHED!
{
//FS2OpenPXO code

if (port == -1)
{
ml_printf("Network: Attempting to load config file\n");
// load the multi.cfg file
file = cfopen("fs2open_pxo.cfg","rt",CFILE_NORMAL,CF_TYPE_DATA);
if(file == NULL){
ml_printf("Network: Error loading fs2open_pxo.cfg file!\n");
return;
}

char Port[32];

if (cfgets(Server, 32, file) == NULL)
{
ml_printf("Network", "No Masterserver definition!\n");
return;
}

if (cfgets(Port, 32, file) != NULL)
port = atoi(Port);
else
port = 12000;

   cfclose(file);
}


// free up any existing server list
multi_free_server_list();


net_server *servers;
int numServersFound;

ml_printf("Network (FS2OpenPXO): Requesting server list\n");
servers = GetServerList(Server, numServersFound, port);


ml_printf("Network (FS2OpenPXO): Got %d servers.\n", numServersFound);

for (int i = 0; i < numServersFound; i++)
{
// copy the server ip address

memset(&addr,0,sizeof(net_addr));
addr.type = NET_TCP;

ml_printf("Network (FS2OpenPXO): Server %d ip is %s\n", i, servers[i].ip);
psnet_string_to_addr(&addr,servers[i].ip);

if ( addr.port == 0 ){
addr.port = DEFAULT_GAME_PORT;
}

// create a new server item on the list
item = multi_new_server_item();

if(item != NULL){

ml_printf("Network (FS2OpenPXO): Memcpy'ing Server %d into position\n", i);
memcpy(&item->server_addr,&addr,sizeof(net_addr));
}
}
delete servers;



ml_printf("Network (FS2OpenPXO): Finished adding servers - exiting multi_join_load_tcp_addrs()\n", i);
}
else
{
// --------------- Origional Code Provided by Volition -----------------
// attempt to open the ip list file
file = cfopen(IP_CONFIG_FNAME,"rt",CFILE_NORMAL,CF_TYPE_DATA);
if(file == NULL){
nprintf(("Network","Error loading tcp.cfg file!\n"));
return;
}

// free up any existing server list
multi_free_server_list();

// read in all the strings in the file
while(!cfeof(file)){
line[0] = '\0';
cfgets(line,MAX_IP_STRING,file);

// strip off any newline character
if(line[strlen(line) - 1] == '\n'){
line[strlen(line) - 1] = '\0';
}

// empty lines don't get processed
if( (line[0] == '\0') || (line[0] == '\n') ){
continue;
}

if ( !psnet_is_valid_ip_string(line) ) {
nprintf(("Network","Invalid ip string (%s)\n",line));
} else {
// copy the server ip address
memset(&addr,0,sizeof(net_addr));
addr.type = NET_TCP;
psnet_string_to_addr(&addr,line);
if ( addr.port == 0 ){
addr.port = DEFAULT_GAME_PORT;
}

// create a new server item on the list
item = multi_new_server_item();
if(item != NULL){
memcpy(&item->server_addr,&addr,sizeof(net_addr));
}
}
}

cfclose(file);
// --------------- end Origional Code Provided by Volition -----------------
}
}


and

Code: [Select]

void multi_create_do_netstuff()
{

// send Heartbeat to the FS2OpenPXO master server



static int LastSend = -1;
static char Server[32];

static int port;

if (LastSend == -1)
{
CFILE *file = cfopen("fs2open_pxo.cfg","rt",CFILE_NORMAL,CF_TYPE_DATA);
if(file == NULL){
ml_printf("Network","Error loading fs2open_pxo.cfg file!\n");
return;
}


char Port[32];
if (cfgets(Server, 32, file) == NULL)
{
ml_printf("Network", "No Masterserver definition!\n");
return;
}

if (cfgets(Port, 32, file) != NULL)
port = atoi(Port);
else
port = 12000;
}

if ((clock() - LastSend) >= 60000 || LastSend == -1)
{
LastSend = clock();

// finish implementation!
SendHeartBeat(Server, port, "Kazan's Alighty Test!", 10000, 0x1, 0x1, 4);
}
}
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
FS2NetD 0.1 (FS2Open PXO server) stuff
YEAH MOTHER****ER! I GOT LISTING WORKING (95% working that is) - enough that you see other games!!!

[one place somewhere lurking that i have to add in another get list call]
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

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

 

Offline Inquisitor

FS2NetD 0.1 (FS2Open PXO server) stuff
good news.

this uses your sql based master server, right?
No signature.

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
FS2NetD 0.1 (FS2Open PXO server) stuff
Quote
Originally posted by Inquisitor
good news.

this uses your sql based master server, right?


yep - though ATM i still have to rebuild the database structure from my code... so right now im using the test server with NO_MYSQL defined so it automatically removes mysql references

tommorow im going to get the computer that had the database on it so hopefully i should be able to get a mysql dump of the structure


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

Server listing if fully functional... now i get to work on stats.. but not today - must work on some other things [non-fs2]
« Last Edit: September 20, 2003, 05:42: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 Taristin

  • Snipes
  • 213
  • BlueScalie
    • Skelkwank Shipyards
FS2NetD 0.1 (FS2Open PXO server) stuff
Quote
Originally posted by Kazan
Server listing is fully functional... now i get to work on stats.. but not today - must work on some other things [non-fs2]


Yep. I'm a witness. He tested it with me. :) Uber coolness™
Freelance Modeler | Amateur Artist

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
FS2NetD 0.1 (FS2Open PXO server) stuff
yep, he was ever so helpful - and KT tried to help .... someone else tried to help too... i think it was cptwhite
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

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

 

Offline Taristin

  • Snipes
  • 213
  • BlueScalie
    • Skelkwank Shipyards
FS2NetD 0.1 (FS2Open PXO server) stuff
Kinda funny how you froze my PC like that... :p
Freelance Modeler | Amateur Artist

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
FS2NetD 0.1 (FS2Open PXO server) stuff
Quote
Originally posted by Raa Tor'h
Kinda funny how you froze my PC like that... :p


yeah... trying to traverse a circularily linked linked as a normal linked list.. the termination condition kinda never happens (cur never = NULL) -- just continuously bombarded your system with server queries... hehehehe

locked both systems up infact... your system would have unfroze the moment i killed the process on mine if you would have let it sit
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

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

 

Offline Taristin

  • Snipes
  • 213
  • BlueScalie
    • Skelkwank Shipyards
FS2NetD 0.1 (FS2Open PXO server) stuff
Heh, I did, FS2 froze, so I hit the magical Ctrl-Alt-Del and switched out of it... :)
Freelance Modeler | Amateur Artist

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
FS2NetD 0.1 (FS2Open PXO server) stuff
helps when i remember in the really old thread there is phpMyAdmin mysql dumb of the dbase structure...
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

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

 

Offline Knight Templar

  • Stealth
  • 212
  • I'm a magic man, I've got magic hands.
FS2NetD 0.1 (FS2Open PXO server) stuff
You can't freeze my pc, it freezes you. :drevil:
Copyright ©1976, 2003, KT Enterprises. All rights reserved

"I don't want to get laid right now. I want to get drunk."- Mars

Too Long, Didn't Read

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
FS2NetD 0.1 (FS2Open PXO server) stuff
Quote
Originally posted by Knight Templar
You can't freeze my pc, it freezes you. :drevil:


actually it doesn't freeze it - your pc sends a malformed UDP packet which causes the server to crashola
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

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

 

Offline Knight Templar

  • Stealth
  • 212
  • I'm a magic man, I've got magic hands.
FS2NetD 0.1 (FS2Open PXO server) stuff
I couldn't have said it better myself. Beautiful, really. :devil:



;)
Copyright ©1976, 2003, KT Enterprises. All rights reserved

"I don't want to get laid right now. I want to get drunk."- Mars

Too Long, Didn't Read

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
FS2NetD 0.1 (FS2Open PXO server) stuff
the PXO part of the multiconfig screen is fully operational again - and now applies to FS2OpenPXO --- btw that screen crashing _should_ be fixed... the PXO password box config was fux0red - someone messed up the code for how long the textbox's capacity should be
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

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