multiplayer-community-contributions icon indicating copy to clipboard operation
multiplayer-community-contributions copied to clipboard

[WebGL build] Client connection event is not firing and client is disconnecting immediately

Open rohanrhu opened this issue 3 years ago • 4 comments

Hi, on web export, client connected event is not firing and client is disconnecting immediately (disconnected event is being called)

My plyer object's Start() method:


void Start() {
    print("Player.Start()");
    
    multiplayerManager = GameObject.Find("MultiplayerManager").GetComponent<MultiplayerManager>();
    
    if (IsOwnedByServer) {
        clients = new ArrayList();
        waiters = new ArrayList();
        
        NetworkManager.Singleton.OnClientConnectedCallback += OnClientConnected;
        NetworkManager.Singleton.OnClientDisconnectCallback += OnClientDisconnected;
        NetworkManager.Singleton.OnServerStarted += OnServerStarted;
    }

    if (NetworkManager.Singleton.IsServer) {
        return;
    }
    
    if (IsOwner) {
        HelloServerRpc();
        JoinGameServerRpc();
    }
}

Please let's fix these bugs :(

rohanrhu avatar Feb 07 '22 17:02 rohanrhu

Unity and this things are totally broken and buggy.

rohanrhu avatar Feb 07 '22 20:02 rohanrhu

Which transport are you using and could you provide some more informations and steps to reproduce this?

LukeStampfli avatar Mar 29 '22 14:03 LukeStampfli

Which transport are you using and could you provide some more informations and steps to reproduce this?

WebSocket

rohanrhu avatar Apr 11 '22 20:04 rohanrhu

I am facing the same issue but with Unity Transport.

saqibkhan2523 avatar May 17 '23 17:05 saqibkhan2523