schema
schema copied to clipboard
An incremental binary state serializer with delta encoding for games.
In its current version, the codegen cli script relies on the respective shell to expand globs for code generation. This does, for example, not work in a windows cmd. This...
The problem is message with integer, but we can declare custom types only for schemas, and interfaces can't use decorators, so below code will always generate float type use-card.message.ts ```...
previous value needs to be assigned (cloned) before decoding. may need to do this on array and map as well - I didn't check...
This PR adds a failing test for when deleting a property from a schema object does not trigger change events.
Code to reproduce ``` import { ArraySchema } from '@colyseus/schema'; const deckCards: ArraySchema = new ArraySchema(); deckCards.push(1); deckCards.push(2); deckCards.shift(); deckCards.unshift(3); deckCards.at(0); // should be 3 ```
Due to how new connections receive the full state through `.encodeAll()`, and incoming patches through `.encode()` right after, it is a known issue that `onAdd` is going to be called...
I've made this bug reproducible at State handling example of `colyseus-example`: https://github.com/Zielak/colyseus-examples - branch master. ## My use case I want mark cards selected by the player in their hand....
In my application, a field is only synchronized to some clients that are specified to be admins of the room. The filter works fine as long as no client changes...
I'm trying to replace a value in an ArraySchema at a certain position. The obvious choice was the `splice()`method. After looking at the [code](https://github.com/colyseus/schema/blob/6213126d4e3cc88469bbb457f5ab078978931b0f/src/types/ArraySchema.ts#L289), it seems that the third argument...
This feature request arises from [some discussion on Discord](https://discord.com/channels/525739117951320081/564076279444406292/761272900790910987). ## The challenge Sometimes it is useful to listen to changes on a state object in multiple "locations" in the implementation...