Navigation

    Colyseus
    • Login
    • Search
    • Recent
    • Tags
    • Users
    1. Home
    2. takaaptech
    takaaptech

    takaaptech

    @takaaptech

    Chat Follow Unfollow
    0
    Reputation
    8
    Posts
    2179
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

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

    Posts made by takaaptech

    RE: Please help me how to use simple database inside Colyseus

    Hi @endel ! Thank so much!

    posted in Questions & Help •
    RE: Please help me how to use simple database inside Colyseus

    Hey, thank @endel so much for the super quick help!
    When working with Mongoose Database I guess we should (or must) using Promise like the pattern from this doc:
    http://colyseus.io/docs/api-authentication/
    So would you please help me what is the plugins docs about Promise that Colyseus are using
    Some link about docs and common usage would be great for a newbie like me!
    Thank again for the awesome support!

    posted in Questions & Help •
    Please help me how to use simple database inside Colyseus

    Hi!
    I need a simple feature that can save the high score and the country of the user after match end. And then after that, I can query score by country, by friend and show the leaderboard.
    Would you please comment how to add simple database (likes mysql ...) database to Colyseus, what driver, plugins I should use for simple usage, I just a noob in javascript.
    Thank so much for your support!

    posted in Questions & Help •
    RE: How to get rooms count and clients count that connect to server

    Hi @endel !
    Sorry I just a noob in js. From Server code in unity example, maybe i am using ClusterServer? How to know when we using Server or ClusterServer?

    const cluster = require("cluster");
    const express = require("express");

    const ClusterServer = require("colyseus").ClusterServer;
    const GameRoom = require('./game_room');

    const PORT = process.env.PORT || 9000;
    const gameServer = new ClusterServer();

    // Register GameRoom as "game"
    gameServer.register("game", GameRoom, {
    maxClients: 2
    });

    if (cluster.isMaster) {
    gameServer.listen(PORT);
    gameServer.fork();

    } else {
    let app = new express();

    app.get("/something", function (req, res) {
        console.log("something!", process.pid);
        res.send("Hey!");
    });
    
    // Create HTTP Server
    gameServer.attach({ server: app });
    

    }

    console.log("Listening on " + PORT);

    In that case, can I have a static count in Room so that each time Room Create, the count variable will increment?
    Thanks

    posted in Questions & Help •
    How to get rooms count and clients count that connect to server

    Hi!
    I want to get the number of rooms that are created on the server, how to get that number?
    Thank so much!

    posted in Questions & Help •
    RE: [Unity Client] - Best practice to start a match

    Thank so much @endel !

    posted in Questions & Help •
    RE: Javascript

    @lezanardi From unity client example, inside Server folder there is an example about chat:
    https://github.com/gamestdio/colyseus-unity3d
    It is javascript

    posted in Questions & Help •
    [Unity Client] - Best practice to start a match

    Hi!
    I am using unity client with colyseus server.
    My game room has maxClients: 2
    For now, i check if players.Count == 1 in OnUpdateHandler and e.isFirstState to start a match
    Is there any method to check begin match event? Or could i use some state handle to do this?
    Thank so much for this awesome game server!

    posted in Questions & Help •