diff options
author | rodri <rgl@antares-labs.eu> | 2023-02-16 13:35:24 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2023-02-16 13:35:24 +0000 |
commit | fd5dc301e4a69d7b7c1293aafe5b069b4ff400a4 (patch) | |
tree | f9d51305517fe6a5bd0167522be82a0dcc28b38c /dat.h | |
parent | 62e75d8830eb56ab03bd4689d51ffd6d4150f461 (diff) | |
download | musw-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.h | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; }; |