-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Help with Generating code for Unreal Engine and GRPC [C++, MSVC 2017, Windows, master] #4469
Comments
I'm not entirely sure what you're asking. First, for the actual request/response messages, those will need to be in FlatBuffer format, so there is no automatic way to create those from a UObject / UProperties currently. You'll have to write code to construct a FlatBuffer from whatever is in your game objects explicitly. For the client, there is no class structure requirement, you can put the code that creates a request wherever you want, including presumably inside these Unreal classes. For the server, you need to inherit from the generated interface (in the sample case that is |
Sorry for not being clear. I want to generate a wrapper for
and convert it to something like:
This should be possible to do within the flatc executable. |
Where should I place this code to generate the wrappers? |
https://github.com/google/flatbuffers/blob/master/grpc/src/compiler/cpp_generator.cc is pretty ugly with its strings. |
That file is verbatim from the gRPC project.. to modify it, you'd make a PR with them first I guess. Not sure if they'd welcome an Unreal specific code generator. What is ugly about it? Instead you may want to just add an Unreal specific generator to FlatBuffers. Have a look to see how all the current generators work to get some inspiration for how to do that. |
This issue has been automatically marked as stale because it has not had activity for 1 year. It will be automatically closed if no further activity occurs. To keep it open, simply post a new comment. Maintainers will re-open on new activity. Thank you for your contributions. |
I've stopped using ue4. |
Unreal engine has special macros for implementing instance method access.
How would I put this code generation in flat buffers and grpc?
Here is an example UE4 class.
https://www.unrealengine.com/en-US/blog/unreal-property-system-reflection
Given the example greeter https://github.com/google/flatbuffers/blob/master/grpc/samples/greeter/greeter.fbs
It would probably look something like
Note that the coding standard for UE4 says that variables and functions should be PascalCased.
Edit #1: Changed from class to struct.
Edit #2: Added prefix to struct names.
Edit #3: Add delegate
The text was updated successfully, but these errors were encountered: