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. zzmarkzz321
zzmarkzz321

zzmarkzz321

@zzmarkzz321

Chat Follow Unfollow
0
Reputation
2
Posts
1.1k
Profile views
0
Followers
0
Following
Joined 11 May 2018, 08:03 Last Online 11 May 2018, 18:40

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

Posts made by zzmarkzz321

RE: State Sync change in objects

@endel Wow thanks so much for the quick and helpful response! Looking forward to diving deeper into the framework :)

posted in Questions & Help • 11 May 2018, 16:52
State Sync change in objects

Hi! I'm still a bit new to colyseus, so I apologize if this question might sound dumb:

I'm trying to synchronize my server and client's state with an object

this.setState({
    key: {}
})

On the server, I have a piece of logic that handles messages from the client and modify the entire object, key.

When listening for changes on the client, nothing comes up:

this.room.listen('key', change => {
    console.log('key state has changed');
});

unless I do:

this.room.listen('key/:id', change => {
    console.log('key state has changed');
});

But, I don't want individual attributes of the object that changed. I want the entire object.

Unless the whole point of state sync is to synchronize small changes, then would I just broadcast the new Key Object as a work around?

Any help or suggestions would be greatly appreciated!

posted in Questions & Help • 11 May 2018, 08:09

© 2023 Endel Dreyer