Navigation

    Colyseus
    • Login
    • Search
    • Recent
    • Tags
    • Users
    1. Home
    2. colyseus_
    C

    colyseus_

    @colyseus_

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

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

    Posts made by colyseus_

    RE: Authorization in all rooms

    :astonished: this is suitable, thank you very much!

    posted in Questions & Help •
    Authorization in all rooms

    I created an auth room where I load the player data from the database

        async onAuth(options) {
            //FIXME check fb auth key
            const data = await gameDao.fetchPlayer(options.uid);
            if (data.rows.length > 0) {
                return data.rows[0];
            }
            return false;
        }
    
        onJoin(client, options, auth) {
            var player = new Player(client.id, auth.name);
            client.player = player;
        }
    

    how to check in another room player data?

        // Code from play room
        async onAuth(options) {
            // this need check player data
            return false;
        }
    

    for example, that players can not enter the location for high levels or the availability of game modes for premium players

    posted in Questions & Help •
    colyseus.js and Cocos Creator

    how use colyseus.js in Cocos Creator ?

    var Colyseus = require("colyseus");
    cc.Class({
        extends: cc.Component,
    
        // use this for initialization
        onLoad: function () {
            var client = new Colyseus.Client('ws://localhost:2657');
        }
    });
    

    Colyseus == undefined

    posted in Questions & Help •