Skip to content

How to Add Modular Stuff to Buildat in the Correct Way

celeron55 edited this page Oct 24, 2014 · 1 revision

Priorities

  1. Have everything defined on the server side if possible (i.e. if you don't need to access unsafe functionality on the client)
  2. If you need to access unsafe functionality on the client, add it to an extension with a minimal portion in C++ if required, and expose what you need to the sandbox environment. Then continue with 1.

Things

Due to this architecture, you do not actually need to maintain any kind of network compatibility in your code. The client-side code that receives your packets is always up-to-date.

The things that are version-dependent are the extensions on the client and the built-in interfaces of the client and the server. Currently there is no explicit versioning of any kind for these - just assume that everyone is using the latest version.

The module interface on the server is quite cheap, so do split your stuff in as many modules as you reasonably can. Design the module's api.h in such a way that you don't need to modify the data structures in an incompatible way. You do not need to care about binary compatibility like usually in C++, as everything is compiled at runtime - but API compatibility is important. You gain API compatibility by not renaming functions, not modifying what parameters functions accept and not removing public stuff in the structs used in your interfaces.

Further reading