I'm working on a multiplayer game using C++. I've also worked on multiplayer games in the past, but one of the thinks I like to prevent is code duplication... But it seems that I still haven't found a good approach for that and I couldn't find much about it on the internet. As the server I'm writing is fully-authorative but the clients still need to interpolate, they both need most of the data. Except for the drawing obviously; the server should not have vertex data or textures in memory, and even better would be not to even have a draw method at all on the server.
One of the possibilities I could think of was just creating similar but different classes on the server and client. There is however much code duplication involved here. The other possibility I could think of was using the same classes but using macro's to disable the drawing-related code on the server. This may even be a worse approach because it's hacky, ugly, hard to maintain and a lot of other things.
I'm interested in how more experienced people would tackle this problem, or is it just an ugly part of network programming?