aboutsummaryrefslogtreecommitdiff
path: root/dat.h
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2023-02-21 22:18:56 +0000
committerrodri <rgl@antares-labs.eu>2023-02-21 22:18:56 +0000
commitecc7d34e9229524a8d4340f0e127f1421029141c (patch)
treeb1e1a9dea5f4a31da7a87826d698b709419a5309 /dat.h
parentfd5dc301e4a69d7b7c1293aafe5b069b4ff400a4 (diff)
downloadmusw-ecc7d34e9229524a8d4340f0e127f1421029141c.tar.gz
musw-ecc7d34e9229524a8d4340f0e127f1421029141c.tar.bz2
musw-ecc7d34e9229524a8d4340f0e127f1421029141c.zip
take the packet seq and ack into account during connection setup. added a player queue to keep clients around waiting for a party.
Diffstat (limited to 'dat.h')
-rw-r--r--dat.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/dat.h b/dat.h
index 0e44b4d..5820845 100644
--- a/dat.h
+++ b/dat.h
@@ -64,6 +64,7 @@ typedef struct Frame Frame;
typedef struct DHparams DHparams;
typedef struct NetConn NetConn;
typedef struct Player Player;
+typedef struct Playerq Playerq;
typedef struct Party Party;
/*
@@ -98,7 +99,7 @@ struct Particle
{
Point2 p, v;
double θ, ω;
- double mass; /* kg */
+ double mass; /* in kg */
};
struct Bullet
@@ -172,12 +173,23 @@ struct Player
{
char *name;
NetConn *conn;
- ulong okdown, kdown;
+ ulong oldkdown, kdown;
+ Player *next;
+};
+
+struct Playerq
+{
+ Player *head, *tail;
+ usize len;
+
+ void (*put)(Playerq*, Player*);
+ Player *(*get)(Playerq*);
+ void (*del)(Playerq*, Player*);
};
struct Party
{
- Player players[2]; /* the needle and the wedge */
+ Player *players[2]; /* the needle and the wedge */
Universe *u;
Party *prev, *next;
};