aboutsummaryrefslogtreecommitdiff
path: root/dat.h
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2023-02-16 13:35:24 +0000
committerrodri <rgl@antares-labs.eu>2023-02-16 13:35:24 +0000
commitfd5dc301e4a69d7b7c1293aafe5b069b4ff400a4 (patch)
treef9d51305517fe6a5bd0167522be82a0dcc28b38c /dat.h
parent62e75d8830eb56ab03bd4689d51ffd6d4150f461 (diff)
downloadmusw-fd5dc301e4a69d7b7c1293aafe5b069b4ff400a4.tar.gz
musw-fd5dc301e4a69d7b7c1293aafe5b069b4ff400a4.tar.bz2
musw-fd5dc301e4a69d7b7c1293aafe5b069b4ff400a4.zip
implemented a keep alive mechanism.
also changed the newframe fn to take a Udphdr* instead of a Frame*. the verifyframe fn now returns 1 if correct 0 otherwise.
Diffstat (limited to 'dat.h')
-rw-r--r--dat.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/dat.h b/dat.h
index 566c248..0e44b4d 100644
--- a/dat.h
+++ b/dat.h
@@ -47,7 +47,8 @@ enum {
enum {
ProtocolID = 0x5753554d, /* MUSW */
Framehdrsize = 4+1+4+4+2+MD5dlen,
- MTU = 1024
+ MTU = 1024,
+ ConnTimeout = 10000 /* in ms */
};
typedef struct VModel VModel;
@@ -163,12 +164,14 @@ struct NetConn
NCState state;
u32int lastseq;
u32int lastack;
+ ulong lastrecvts; /* last time a packet was received (in ms) */
+ ulong lastnudgets; /* last time a nudge was sent (in ms) */
};
struct Player
{
char *name;
- NetConn conn;
+ NetConn *conn;
ulong okdown, kdown;
};