Navigation

    Colyseus
    • Login
    • Search
    • Recent
    • Tags
    • Users
    1. Home
    2. Soh Sea Kiat
    Soh Sea Kiat

    Soh Sea Kiat

    @Soh Sea Kiat

    Chat Follow Unfollow
    0
    Reputation
    5
    Posts
    1351
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    • Profile
    • More
      • Continue chat with Soh Sea Kiat
      • Flag Profile
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups
    Soh Sea Kiat Follow

    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 •
    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 •
    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 •
    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 •
    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 •