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. takaaptech
  3. Posts
  • Profile
  • More
    • Continue chat with takaaptech
    • Flag Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

Posts made by takaaptech

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

Hi @endel ! Thank so much!

posted in Questions & Help • 12 Apr 2018, 02:21
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 • 10 Apr 2018, 03:03
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 • 10 Apr 2018, 02:15
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 • 1 Feb 2018, 02:22
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 • 31 Jan 2018, 10:02
RE: [Unity Client] - Best practice to start a match

Thank so much @endel !

posted in Questions & Help • 30 Jan 2018, 09:45
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 • 29 Jan 2018, 04:09
[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 • 29 Jan 2018, 03:54

© 2023 Endel Dreyer