A bit of an architectural change before we progress further. Moved
player code into a shared PlayerBass class to elimnate some severe code
duplication while i was getting things working.
Added linear interpolation for remote player movement to provide a
smoother and more visually appealing experience.
Where previously remote players would snap directly to their new coords
on receiving a game state update, making it a bit jerky, now we get a
smoothe ride.
Initial implementation of server-side reconciliation for player
movement.
Clients respect the server as the authoritative source for game state.
In 'process_game_state', the client compares its locally predicted pos
with the state received from the server and snaps to the server's
position if they diverge.
Had to add a defensive check to the server-side Player constructor to
fix a bug where the first connecting client was incorrectly assigned an
ID of 0. This prevented it from sending or recieving any game data.
- Server can handle multiple clients simultaneously.
- Client can see other players in the game.
- Server broadcasts the game state to all clients.
- Client receives the game state and renders the other players.
- Server assigns a unique ID to each player.
- Client receives its player ID form the server.
- Server handles client disconnections.. Kinda... Server is ignoring
SIGPIPE signal.
- Server and client signals are non-blocking.
- Moved player objects off the stack and onto the heap.