I have a Dedicated Standalone player Server, and two clients. Each client runs on a different platform, and has various code and libraries which do not work on the other client platform.
I initially started using platform dependant compilation, and excluding folders from the build, so that the incompatible code (various libraries etc… not all my code) did not try to compile on the other platform.
Hurrah, both clients build now!
This, however, led to various [SyncVar], [Command] etc… tags not existing on one client, but existing on the other. The server is able to run all the code so far.
Having this mismatch seems to break the UNET networking, which I guess is understandable. The server will be compiled with, for example, a [SyncVar] which doesn’t exist on the client it’s talking to, even though that SyncVar will never be used.
How would you approach solving this problem?
A) . I could separate all the UNET calls away from any platform specific code, but this will be a large change, and add another layer which I hope I don’t need. Say the server needs to receive a complex object which is defined on one of the clients libraries. And that library can only exist on that type of client, and the server. I would have to create a copy of that object in my own code, modified to compile on both platforms, and use that for UNET calls… but then I have to maintain my copy with future versions of the client library.
A2) . I could make my own wrappers of the types which need to touch the UNET system, but
B) . I could hack away at the platform dependant bits of my dependencies (mostly it’s just various system calls that don’t exist on the other hardware) and repeat the process each time I upgrade to a new version. I tried this and it gets horrible very quickly, understandably.
I hope there might be an [OptionalSyncVar]? Or a way to make UNET otherwise handle (or ignore) the case that each client has a different UNET interface to the server.
Sorry if this is unspecific, or overly broad.
Unity 2017.2.1f1. First client is Android, Second is UWP (Hololens)