Skip to content

Provide a custom "LANG.ts" option in code generator cli #57

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

Open
zgz682000 opened this issue Mar 3, 2020 · 4 comments
Open

Provide a custom "LANG.ts" option in code generator cli #57

zgz682000 opened this issue Mar 3, 2020 · 4 comments

Comments

@zgz682000
Copy link

the inner-provided LANG.ts in code generator may not satisfy everyone's need, such as me. It will be perfect if I can implement my own LANG.ts by responding some kind of protocol (interface or methods) . BTW, I also defined some enum type in my server side schema, generate them into the client side code is a reasonable requirement, isn't it.

@endel
Copy link
Member

endel commented Mar 3, 2020

Hi @zgz682000, thanks for the feedback. Such API may not be easy to expose, but I think we can adapt the parser to identify and generate ENUM and INTERFACE types.

Which other changes you'd make to the default codegen output? You mind providing a comparison of what is generated, and what you'd like to have generated instead? So I can wrap my head around your requirements and try to come up with something. Cheers!

@zgz682000
Copy link
Author

ENUM and INTERFACE type will be enough temporarily. The other changes I prefer to make are about removing the default generated functions, because I am developing a message based game without any state patching, and message schema don't need onChange and so on. That would makes code looks cleaner.

Even If I develop a state patching game, I still don't hope these functions in my generated code files, because when some of the schemas modified, the regenerated code files will cover the code I wrote manually. That makes me trouble

@endel
Copy link
Member

endel commented Mar 3, 2020

Nice @zgz682000, which client integration are you using? AFAIK for C#/Unity there are no onChange callbacks and such. Cheers!

@zgz682000
Copy link
Author

Typescript right now and u3d will be the next. Thank you very much for colyseus's support, it helps me a lot

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

No branches or pull requests

2 participants