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. colyseus_
C

colyseus_

@colyseus_

Chat Follow Unfollow
0
Reputation
3
Posts
1.3k
Profile views
0
Followers
0
Following
Joined 31 Mar 2018, 23:57 Last Online 5 Jun 2018, 14:21

  • 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 • 6 Apr 2018, 17:29
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 • 6 Apr 2018, 14:24
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 • 1 Apr 2018, 00:28

© 2023 Endel Dreyer