I've created a voxel game in C++, OpenGL and SFML, and I want to make it multiplayer.
I'd like to make it similar to Minecraft's client-server model: The single-player is just a client to the hidden server underneath; but can be configured to connect to multiplayer as well so that the single player and multiplayer code are one and the same.
Spitball-ideas:
- Use a separate thread for the server logic and then share the data between a synchronized point in the code for the client.
- Just send packets to local host from the server thread and collect them from the client thread.
How should I do this?