c# - Masterserver.UnregisterHost? -


I am trying to exclude the old code from Masterserver.PollHostData () When a game is over, I run the following scripts that the client still has PollHostData () .

Get the game from (if Network.isClient) {if (Network Connection Length == 1) {debug.log ("Disconnecting from server"); Networks Close Connection (Network Connection [0], True); MasterServer.UnregisterHost (); // UngerHost () tried even before. } Else {Debug.log ("Not connected to server"); }} And if (Network.isServer) {if (Network.connections.Length & gt; 0) {Network.Disconnect (1000); MasterServer.UnregisterHost (); // UngerHost () tried even before. } Else {Debug.log ("No customer is connected."); Network.Disconnect (0); MasterServer.UnregisterHost (); // Try UnregisterHost () as before}}

Although the client restarts the game, then I will not get the HostData of the previous game It has tried to clearing the host data before voting for it, but without success. The player who created the server is not getting the game, which is strange because I clear my hostData array before re-assigning it.

I'm saying some old posts UnregisterHost is not working, if so, what are my options?

First of all, why do not I understand

  master server.nagarsterhost (); // UngerHost () tried even before.  

Here it is because the master server has server information, not the client information.

  if (Network.isClient) {if (Network.connections.Length == 1) {debug.log ("Disconnecting from server"); Networks Close Connection (Network Connection [0], True); MasterServer.UnregisterHost (); //Why? } Else {Debug.log ("Not connected to server"); }}  

The solution is:

On behalf of the client, you must request from the master server before MasterServer.ClearHostList (); Need to call.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -