Hi @endel ! Thank so much!
Posts made by takaaptech
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!
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!
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
Hi!
I want to get the number of rooms that are created on the server, how to get that number?
Thank so much!
@lezanardi From unity client example, inside Server folder there is an example about chat:
https://github.com/gamestdio/colyseus-unity3d
It is javascript
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!