Navigation

    Colyseus
    • Login
    • Search
    • Recent
    • Tags
    • Users
    1. Home
    2. lqvinh2
    L

    lqvinh2

    @lqvinh2

    Chat Follow Unfollow
    0
    Reputation
    3
    Posts
    1090
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    • Profile
    • More
      • Continue chat with lqvinh2
      • Flag Profile
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups
    lqvinh2 Follow

    Posts made by lqvinh2

    [UNITY] How to create new Scene and match client join

    I already have many room and client can connected to every room, now in unity i want to create new Scene. But i dont know how to match client join Scene exactly which client choose.

    Please give some recommanded thing to do this

    thank all.

    posted in Questions & Help •
    RE: [UNITY] I using broadcast(bc) but server only bc to 1 client itselft

    @lqvinh2 said in [UNITY] I using broadcast(bc) but server only bc to 1 client itselft:

    SERVER CODE
    onCreate (options: any) {

        this.setState(new State());
    
        this.setMetadata({
            str: "hello",
            number: 10
        });
    
        this.setPatchRate(1000 / 20);
        this.setSimulationInterval((dt) => this.update(dt));
    
        this.onMessage("cl_move_right", (client) => {
            const p = this.state.players[client.sessionId];
            this.broadcast("sv_move_right", p );
        })
    }
    

    // CLIENT (UNITY)
    void RegisterRecMess()
    {
    room.OnMessage<Player>("sv_move_right", (plaayer) =>
    {
    Debug.Log(player);
    inputText.text += "__" + player.sessionId;
    });
    }

    async void OnMoveRight()
    {
        await room.Send("cl_move_right");
    }
    posted in Questions & Help •
    [UNITY] I using broadcast(bc) but server only bc to 1 client itselft

    SERVER CODE
    onCreate (options: any) {

        this.setState(new State());
    
        this.setMetadata({
            str: "hello",
            number: 10
        });
    
        this.setPatchRate(1000 / 20);
        this.setSimulationInterval((dt) => this.update(dt));
    
        this.onMessage("cl_move_right", (client) => {
            const p = this.state.players[client.sessionId];
            this.broadcast("sv_move_right", p );
        })
    }
    

    // CLIENT (UNITY)
    room.OnMessage<Player>("sv_move_right", (plaayer) =>
    {
    Debug.Log(player);
    inputText.text += "__" + player.sessionId;
    });

    posted in Questions & Help •