yes that's correct.
I have a main function where I set some general variables, then a few IFDEFs with the client and server code in them (seperated). In the client code I set the on_client function and on the server I set the on_server function. Then I continue to call functions that belong strictly to the client or server side.