I've created a VoxelGame but nowvoxel game in C++, OpenGL and SFML, and I want to make it multiplayer.
How would I go about makingI'd like to make it similar to minecraft's serverMinecraft's client-clientserver model where the: The single player-player is just a client to the underneath hidden server; Butserver underneath; but can be configured to connect to multiplayer as well so that the single player and multiplayer code are one and the same.
My spitball ideasSpitball-ideas:
1.) I was thinking maybe to use a separate thread for the server logic and then share the data between a synchronized point in the code for the client.
2.) Or maybe just send packets to local host from the server thread and collect them from the client thread.
- 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.
My game is written in C++, OpenGL and SFML.How should I do this?