Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add client/server message schemas view #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

beiryu
Copy link

@beiryu beiryu commented Sep 17, 2024

Displaying schemas is a necessary feature to allow clients (game clients) to know which properties they will use in the schema to make requests and receive corresponding responses.

Screenshot_13

@endel
Copy link
Member

endel commented Sep 17, 2024

Hi @beiryu, thanks for the PR - I love the idea of presenting how the structures of each message type should look like. I see you have a custom message type for this ("collect_message_schemas"), but how does it look like?

It would be really great if we could use the types of each message and display it in the front-end, I'm afraid that's not easily possible as TypeScript do not expose its types to the runtime.

The upcoming version 0.16 is going to remove the ability to send schema-encoded messages (colyseus/colyseus#745) - Reasoning is: sending schema-encoded messages was only introduced because the C#/Unity SDK lacked a good way to define strongly-typed messages back then. Since we've changed the MessagePack library to use msgpack-unity3d it became possible to define raw message pack types in C#/Unity.

Currently, the playground module extends the original Room code via "monkey-patching" in order to send the __playground_message_types containing message names. If there's more data required to be sent for the clients, that could be a good place to add them...

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants