Initial work on connecting clients over UDP.

This commit is contained in:
2023-07-02 23:08:59 +01:00
parent e3b3ce4582
commit 72009e5c4b
4 changed files with 81 additions and 8 deletions

View File

@ -2,7 +2,7 @@
#define CSPT_STATE_H
#include <time.h>
#include <stdbool.h>
#include <netinet/in.h>
struct clientMovement
{
double xPosition, yPosition, xVelocity, yVelocity;
@ -20,6 +20,14 @@ struct gameState
struct clientMovement clients[16];
};
struct networkThreadArguments
{
int * clientSockets;
struct gameState * state;
};
void updateInput(struct gameState * state, struct clientInput * message, struct sockaddr_in * address, int * clientSockets);
void doGameTick(struct gameState * state);
#endif