I am currently writing an object oriented game with a multiplayer. Player inherits from entity and when I send my current players properties via
NetOutgoingMessage outmsg = Server.CreateMessage();
[...]
outmsg.WriteAllProperties(p);
where p is my player object, my clients only receive properties which are declared in my players class and not from the entity class. Therefore my clients can't update the player positions etc.
Any advice?
edit:
It recognizes the inherited objects, but it doesn't send them properly. I think I might need to use some Bindingflags as there is an option to it and it should be possible to send objects which are allocated to a player too. I am using a Vector2 class to specify the position and velocity of my player, but my client either can't receive a Vector2 class or the server can't send it. If I use integers, strings, booleans or anything it works, but not with custom classes.