Im trying to create a pluggin to enable messaging trading between diferent machines using the MessageBus.
I had the server part done, it compiled correctly but once I tried to compile with the client part the following compiler error ocurred: “error : struct: ‘Message’ conflicts with class name”.
In both classes (server and client) I need a struct with the message to be sent, I simply copied and pasted the UStruct from the server to the client as the name has to be the same so it can be recognized by both endpoints.
So you are telling me ot crate a new header (FMessageHeader) only for the struct? I tried that but had some errors still. I must include the header in both server and client .h files right? what about the FMessageHeader file, what should I include there? TapPlugin.h? any other weird dependency?
If you take a look at WidgetSnapshotMessages.h (in Engine\Source\Developer\SlateReflector\Private) you can see the MessageBus events header used by FWidgetSnapshotService. In this case both the sending and receiving is handled by the same class, but we could just include WidgetSnapshotMessages.h anywhere that we needed access to those event types.
Splitting common types off into their own header (rather than copying types) is the standard way to share types between files in C/C++.