I had a client-side problem. I wasn't passing the property at all.
Posts made by virtumonde
Client:
client.joinOrCreate("website", { domain: "zuckbuck.com", accessToken: this.props.that.state.token });
Server:
onCreate(options : any) {
console.log(options)
// { accessToken: 'token' }
}
Thoughts?
Is there a way to instantiate different rooms from the client without defining each room id? What I want to achieve is for the players to be able to create their own rooms. I know that the client.joinOrCreate would create a new room only when the room id is defined on the server like this:
gameServer.define('roomId', Room);
How can I create different rooms from the client-side without having to define each id? I want the client to be able to create rooms with any id without defining that id explicitly in the server.
Thank you, @endel. I will publish another quick question as a new thread if you don't mind.
Is there a way to store an instance of a class extending @colyseus/schema directly into a database?
I think I saw exactly the same bug being described previously in this forum, @endel.
@endel Thank you, I am aware of this. As I understand @colyseus/schema doesn't support multiple classes, right?
For whoever may read this: check the state with room.onStateChange, not right away you are connecting to the room.
Is it possible to create a map with multiple types? For example in Typescript you can do something like this:
tiles = new Array < Tile | Gate > ();
You have an array of with Tiles and Gates but as of now, it's not synched with the schema. I can add only one type @type({map: Tile}). How do I write @type with multiple classes e.g. Tile and Gate without creating a separate map for each?
@saucecodefr I am doing exactly this but I do not know how to tell the client what his sessionId is. I cannot override it onJoin.
Now it's broken again. Will check tomorrow.
I am an idiot. I forgot that at the begging of the client connection you can't access the state via room.state, it is blank. I do receive that changed version of the state however.
It didn't solve my problem. At least in my case it is not a client version mismatch.
The same thing occurred when today I created a new server. I am not able to get the contents of a map.
Hey, @SauceCodeFr I use the exact same concept but the problem I am experiencing (just noticed I didn't clarify this in my post) is that on every reconnection the client uses a different sessionId and I am not able to change it.
Oh god of divine authoritative servers, @endel please share your insights about this problem.
I did not have the experience and the need to support this amount of clients but what about splitting the server into different instances?