So hier post ich auch nochmal meinen server und client code . Also könnte mir bitte jemand sagen was ich falsch gemacht habe ?
Der Server funktioniert aber ich kann mit dem Client den Server nicht finden . Hier der ausschnitt :
Code:
function startserver()
{
serverstatus = 2;
GSTNet_StartServer(2030,1);
while(GSTNet_Connection() ==0)
{
wait(1);
}
reset(hostnumber,VISIBLE);
setString (strInstructions,"You logged in as server. Press s to spawn");
setString (strServerStatus ,"Server status : Connected");
while(joined == 0)
{
if(key_s)
{
joined = 1;
//GSTNet_SendString(0,"gm");
setString (strServerStatus ,"Server status : Connected transfering data.");
wait(-0.5);
setString (strServerStatus ,"Server status : Connected transfering data..");
wait(-0.5);
setString (strServerStatus ,"Server status : Connected transfering data...");
wait(-0.5);
setString (strServerStatus ,"Server status : Connected transfering data..");
wait(-0.5);
setString (strServerStatus ,"Server status : Connected transfering data.");
wait(-0.2);
//GSTNet_SendVar(0,_str("serverstatus"));
setString (strServerStatus ,"Server status : Connected and data transfered");
setString (strInstructions ,"Succesfully spawned");
joined = 1;
ent = GSTNet_ent_create(_str("submarine.mdl"),vector(1000,0,-100),_str("submarineonline"));
wait(1);
diag("\n prepare to start");
}
wait(1);
}
}


function startclient()
{
serverstatus = 1;
GSTNet_StartClient(serverip,2300,1); // _str("255.255.255.255")
wait(1);
setString (strClientStatus,"Client status : Searching for connection");
wait(-1);
if (GSTNet_Connection() ==0)
{
setString (strClientStatus,"Client status : No server found");
setString (strInstructions,"Please try again or search for another server");
inkey(serverip);
joined = 0;
while(joined == 0)
{
if(key_enter)
{
joined = 1;
startclient();
}
wait(1);
}
}

while((GSTNet_ClientId() == 0)||(GSTNet_Connection == 0))//wait for the connection to be established and the ID given by the server to proceed
{
wait(1);
}
setString(strInstructions, "You logged in as client");
setString(strClientStatus, "Client status : Connected");
gamenumber = str_stri(gm,"c");
wait(1);
if (gamenumber == 1) mode_capturethefish_client();
}


function host()
{
setString(strServerStatus,"Server status: Prepare to start ");
setString(strInstructions,"Choose your gamemode to start");
getip();
serverstatus = 10;
level_load("3dgs2.wmb");
wait(1);
set (host_panel,SHOW);
}

function join()
{
joined = 0;
setString(strClientStatus,"Client status: Prepare to start ");
setString(strInstructions,"Type in the ip number you want to join");
serverstatus = 10;
level_load("3dgs2.wmb");
wait(1);
set(join_panel,SHOW);
inkey(serverip);
while(joined == 0)
{
if(key_enter)
{
joined = 1;
startclient();
}
wait(1);
}

}



Last edited by chrisp1; 12/16/10 16:07.

---------------------------------------------------
My new project: www.sfc.de.to
My old project: www.littlesubmarine.de.to
My Youtubechannel: http://www.youtube.com/user/darkchrisp#p/a/u/0/5idMXmCDdmA
---------------------------------------------------