• Hey! Guest! The 37th GMC Jam will take place between May 28th, 12:00 UTC and June 1st, 12:00 UTC. Why not join in! Click here to find out more!

Legacy GM LAN Platformer Demo - Disconnect button

grossik

Member
Hello I have problem with disconnect button.
On map I have object which has step code:
Code:
if(keyboard_check(ord('O'))){
    with(oServer){       
        network_destroy(server);
        global.haveserver = false;
        buffer_delete(player_buffer);
        buffer_delete(broadcast_buffer);
        ds_map_destroy(Clients)
        ds_list_destroy(socketlist);
        game_restart();
    }

    with(oClient){
        network_destroy(client);
        buffer_delete(buff);
        game_restart();
    }
}
This code works smart, but if server is disconnect other players have frozen screen, however they click on disconnect button and it is ok.
But I want to relieve frozen screen. I found that the restart is not working well and the network is running. I have to shut down player (server) game if I disconnect other players. What should I do more so I don't have to shut down the game, but just a restart?

Sorry for my bad English.
 

Odlaw

Member
I would code the restart manually instead of using game_restart(). Destroy everything and clean it all up and then re-create it all.

I hope this helps
 
Top