Original Post
I'm about to start implementing a multiplayer system (on top of SDL_net) for an FPS-type game. I want to build a dedicated server as well as a client. The server will compute and send deltas from the previously sent object states as they are relevant (for example, only in a certain radius around a client). The client plugs the data into its objects via de-serialization and does some sort of compensation logic to alleviate warping. This means that although the client and server objects are similar, they also have functionality specific to each (server needs to compute relevant sets and deltas per client, client needs warp compensation and extra graphical data). Anyway, I'm trying to figure out how to maximize code re-use between my client and server. Any ideas? How is this usually done? Should I make every class have a base class with shared functionality and then one derived class for the client and one for the server? Or just implement both client and server functions in one class? Has anyone tried these and decided what's easier? I'm trying to shortcut some lengthy prototyping by getting advice from people with more multiplayer coding experience.