Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Kazan on September 19, 2003, 12:00:30 pm
-
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.
-
HOLY TARANIS BATMAN!
-
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.
-
no ETC
IRC is seperate from my code
-
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..
-
i have a server pinging the fs2open PXO server with heartbeat packets... now to get the damn client list request to succeed
-
a couple of changed functions
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
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);
}
}
-
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]
-
good news.
this uses your sql based master server, right?
-
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]
-
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™
-
yep, he was ever so helpful - and KT tried to help .... someone else tried to help too... i think it was cptwhite
-
Kinda funny how you froze my PC like that... :p
-
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
-
Heh, I did, FS2 froze, so I hit the magical Ctrl-Alt-Del and switched out of it... :)
-
helps when i remember in the really old thread there is phpMyAdmin mysql dumb of the dbase structure...
-
You can't freeze my pc, it freezes you. :drevil:
-
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
-
I couldn't have said it better myself. Beautiful, really. :devil:
;)
-
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
-
Originally posted by Kazan
cornfusing..
-
Originally posted by Carl
[image that won't link]
rotfl
Mission validation is mostly working now (it generate's a new mvalid.cfg file.... FS2 isn't using it though ---- and it's kinda slow but i cannot help that - it's the VCode that is holding **** up)
-
it fully uses the validation code now
for benchmark purposes is validates 54 missions in 1.6 seconds including drawing to screen and playing a sonud for each...
-
btw that was commited
i think i have stand alone servers almost working again..
-
MANY thanks to Kazan for getting this working.
I would suggest that the lunx guys update and see how it works on their end, and the SCP people to update their CVS to make sure they have no problems compiling.
Good job, K!
-
Originally posted by Inquisitor
MANY thanks to Kazan for getting this working.
I would suggest that the lunx guys update and see how it works on their end, and the SCP people to update their CVS to make sure they have no problems compiling.
Good job, K!
the linux guys need to look in the UDP_Socket::GetPacket function and READ MY COMMENT
I haven't altered that part of the code to be nonblocking yet - and they socket must be nonblocking
-
STATS ARE STORING!
-
demo version above updated - i will leave the masterserver online as much as possible - IF YOU WANT A TRACKER ACCOUNT FOR TESTING POST HERE!
-
FYI: There is a tracker account setup for testing
user: pxotest
pass: pxotest
remember:
Enable PXO - enter above login for user/pass
then you're good to go [the released version WILL NOT tell you if your stats have stored - you'll be able to tell though because every time you hit the server list screen it'll fetch wat the server has for your stats]
-
Sounds good.
-
BUMP!
Support version 1.0 posted at url above
-
The latest version is FRED2...
-
hehe... oopsie :D