Welcome, Guest
Username Password: Remember me

HOW TO: shut down server/client to go back to non multiplayermode?
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: HOW TO: shut down server/client to go back to non multiplayermode?

1 month, 2 weeks ago HOW TO: shut down server/client to go back to non multiplayermode? #190

  • Memnarch
  • OFFLINE
  • Fresh Boarder
  • Posts: 18
  • Karma: 0
HI
I have currently a big problem:
I dont know how to shutdown the serverside of the Programm correctly.
It always keeps active(even if the server_poll loop isnt executed anymore).
And GSTNet_Connection() stays > 0

What i trie to do is the possiblity to switch between Client and Server/Client mode.

Imagen You hosted a game, and after playing you want to join a server. Shutting down the serverside isnt possible atm(as far as i see, cause when you try to start 2 servers on one pc for example, the new app will close imediately when using same port, that shows me that the server shutdown of the first app hasnt been executed in a clean way).

Some tips?


GReets
Memnarch

1 month, 2 weeks ago Re:HOW TO: shut down server/client to go back to non multiplayermode? #192

  • admin
  • NOW ONLINE
  • Administrator
  • Posts: 27
  • Karma: 0
there was a non documented function GSTNet_Exit, but it was not working either

here is a working version 0.7.6.50
disconnect the client on the server machine before and then call GSTNet_Exit()
this should work now

File Attachment:

File Name: GSTNet-20100719.zip
File Size: 147963
Attachments:

1 month, 2 weeks ago Re:HOW TO: shut down server/client to go back to non multiplayermode? #194

  • Memnarch
  • OFFLINE
  • Fresh Boarder
  • Posts: 18
  • Karma: 0
Hi,
Well..its working in some way but a bit strange too.

When exiting the server i do this:

if(logout)
{
GSTNet_Disconnect(GSTNetId);
wait(-1);
GSTNet_Exit();
wait(-1);
proc_kill((void*)GSTNet_StartClient);
proc_kill((void*)GSTNet_StartServer);
GSTNetId = 0;
switch_to_mainmenu();
}

But when this programm tries to connect as normal client, it'll get GSTNetId=1 o.o.

Noticed when i do this:

if(logout)
{
GSTNet_Disconnect(GSTNetId);
wait(-1);
GSTNet_Exit();
wait(-1);
//proc_kill((void*)GSTNet_StartClient);
proc_kill((void*)GSTNet_StartServer);
GSTNetId = 0;
switch_to_mainmenu();
}

after server shutdown and connecting as normal client, this time GSTNetId is correct.
But this leads to the problem of 2 Client function running.
If you need a log i'll post it later.
  • Page:
  • 1
Time to create page: 0.38 seconds
© 2008 GSTools | Joomla 1.5 Templates by vonfio.de