Navigation

  • Recent
  • Tags
  • Users
  • Search
  • Login
Colyseus
  • Login
  • Search
  • Recent
  • Tags
  • Users

Documentation GitHub

We're migrating to GitHub Discussions. This forum does not accept new registrations since April 6, 2023.
  1. Home
  2. Soh Sea Kiat
  3. Posts
  • Profile
  • More
    • Continue chat with Soh Sea Kiat
    • Flag Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

Posts made by Soh Sea Kiat

RE: Question on login from second device and close first device login

Solve it. Need to check for sessionId also. Thanks for help ! cheers !

posted in Questions & Help • 11 Sept 2018, 09:40
Question on login from second device and close first device login

Hi I tried to remove the previous login client at requestJoin part by matching client Id and I can successfully remove the previous login client. But If the client is the last person in the room, the room will get disposed and new room will be created for the second login client. And this will cause a remoteroom call promised error. Is there better way for kick out first login client instead of detecting at requestJoin? Please advise please.

requestJoin (options) {

console.log("request join!", options);

for(var id in this.clients)
{
  if(options.clientId == this.clients[id].id)
  {
    this.clients[id].close();
  }
}
return true;

}

posted in Questions & Help • 10 Sept 2018, 12:24
RE: Bug on Unity Colyseus after reconnect client

Hi @endel I already used client.Rejoin() to get reconnect back from client side, and I can successfully reconnect back to server with a new coroutine, just that after the reconnection, I couldn't recieve any update from server side but still can room.send() data to the server.

posted in Questions & Help • 17 Aug 2018, 13:19
RE: Bug on Unity Colyseus after reconnect client

@endel Yup, after Rejoin,

anything in try block still can pass back to client, but when client send message to the room, or any update on roomstate, client won't listen any changes anymore, seems to me server is not casting data back to reconnected client

code block

async onLeave (client, options) {

    console.log(client.id+ " Leaving...");
    
    // inactivateclient
    this.state.deactivateClient(client);
    this.broadcast({isDeactivated: client.id});

    try {
        // allow disconnected client to rejoin into this room until 20 seconds
        await this.allowReconnection(client, 300);

        // client returned! let's re-activate it.
        console.log(client.id + " reconnect back !");
        this.state.activateClient(client);
      
        // push updated roominfo to reconnect client
        this.broadcast({isActivated: client.id});
        
    } catch (e) {

        // 20 seconds expired. let's remove the client.
        this.state.removePlayer(client);
    }
} 

onMessage (client, data) {

            if(data.isInit != undefined){
                this.state.changePlayerReady(client, data.color, data.isReady);
                this.broadcast({test: "message"});
            }

}

posted in Questions & Help • 16 Aug 2018, 01:10
Bug on Unity Colyseus after reconnect client

After reconnect client, if there is any state changes, the unity client room listener won't pick up any update on room state.
The reconnected client can send signal to server, but server update on roomstate, or broadcast, or send message to client all failed. The client stop receive any feedback. Anyone can help me?

posted in Questions & Help • 15 Aug 2018, 10:13

© 2023 Endel Dreyer