In the Networking or the Voxel handling?
Here is a more detailed explanation of the Server/Client model.
‘C’ is the Client, ‘S’ is the Server. ‘>>’ means that ‘X goes from A to B’.
C: Create Socket and try to connect to Server
S: Accepts Connection
C >> S: Sends Login Request Packet
S: Checks if the login is valid (Player isn ot already there/Server is not full, etc.etc.)
Not-Accepted: Send ConnectionKill Packet to Client and Stop.
Accepted{
S >> C: Send Asset-Count and Assets //NYI
C: Receive Assets and use them //NYI
C >> S: Send the Asset Packet back
C: Create local World Instance
C: Go into infinite Packet reading loop
S: Start a new Thread and go into an infinite Packet reading loop
S >> C: Send Spawn-Area Chunks
// LOOP START
C: Read every Packet and execute it using the assigned Handler
S: Read every Packet and execute it using the assigned Handler
}
Btw:
The NetPac system is a modular multipurpose tcp-packet networking system i made for my applications.
How Packet’s are handled still has to be specified for every Server/Client instance.
But that isn’t really hard to do.