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

Posts made by shophk

RE: How to join a room using javascript game engine Cocos Creator?

Found solution here.

https://github.com/gamestdio/colyseus.js/issues/8

posted in Questions & Help • 12 Dec 2017, 15:03
How to join a room using javascript game engine Cocos Creator?

Hi, I'm testing cocos creator (Javascript) to connect to Colyseus server, any known examples shown how to use javascript client through cocos creator to connect to Colyseus server? Or advise how I should go about doing this?

posted in Questions & Help • 12 Dec 2017, 11:14
RE: About setting number of rooms for a registered room on the server.

@endel Yes, I would like to limit the number of rooms. I want to have the first 10 rooms to have bonus or special effects.
after the first 10 rooms, users will get put into another registered room.

So in a way, yes, I want to limit the number of rooms the server can spawn base on some criteria.

posted in Questions & Help • 8 Nov 2017, 03:05
About setting number of rooms for a registered room on the server.

Hi,

I'm trying to find a way to set the number of rooms.
My code trace has led me to believe I can make changes here:

MatchMaker.prototype.create = function (roomName, clientOptions) { ...}
Change the function so that it checks some flag to decided whether a room should be returned.

My question: I am not suppose to change the code for the files in the Colyseus folder right? What would be the recommended actions or approach to take for handling what I want to do?

posted in Questions & Help • 7 Nov 2017, 15:02
RE: How to push a variable?

My solution to this is using JSON.stringify to parse the variable into a string. I'm hoping there is a better solution.

var roomname = {
roomName : 'a room passed as string'
}
var text = JSON.stringify (roomname);
console.log("stringify text: " + text);

   this.state.roomname.push (text);
posted in Questions & Help • 31 Oct 2017, 15:25
How to push a variable?

I have the following:

class ChatRoom extends Room {

constructor () {
super();

this.setState({
  players: {},
  messages: [],
  roomname: []
});

}

In onJoin(client)...

//it works if I do this, I can retrieve the string in Unity.
this.state.roomname.push ('a room passed as string');

var roomname = {
roomName : 'a room passed as string'
}

//it doesn't work if I do this, I get a '1' as the result when i try to read the object.
this.state.roomname.push (roomname);

How do I push a variable?
I'm thinking like in socket.io . I can send currentUser, in Unity I use a Json deserialiser to read the contents.

var currentUser = {
		msg:data.msg,
		id:id,
		position:data.position,
	}
socket.emit('move', currentUser);

Can I do something similar using this.state.roomname.push(currentUser) ?

posted in Questions & Help • 30 Oct 2017, 16:21
Beginner learning to use Colyseus

Summary:
Learning to use Colyseus as a beginner.
Things I had considered when I started and trying out room handlers, specifically requestJoin(option) function.
https://codefalls.wordpress.com/2017/10/28/learning-colyseus-0-5-0/

posted in Links & Resources • 28 Oct 2017, 14:37

© 2023 Endel Dreyer