diff options
author | rodri <rgl@antares-labs.eu> | 2021-07-23 03:38:18 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2021-07-23 03:38:18 +0000 |
commit | 615575f7dca0e43ecb23c4ab1ea7fd2e93c4e3b4 (patch) | |
tree | f7c7052cbbac5b7af14f88adee1072352284d565 /dat.h | |
parent | dfb8bd8c95a5ff8633214f483f358d24071a7d8a (diff) | |
download | musw-615575f7dca0e43ecb23c4ab1ea7fd2e93c4e3b4.tar.gz musw-615575f7dca0e43ecb23c4ab1ea7fd2e93c4e3b4.tar.bz2 musw-615575f7dca0e43ecb23c4ab1ea7fd2e93c4e3b4.zip |
implemented a lobby for users waiting to join a party.
brought the pack/unpack procedures from ssh(1).
Diffstat (limited to 'dat.h')
-rw-r--r-- | dat.h | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -2,7 +2,8 @@ typedef struct GameState GameState; typedef struct Derivative Derivative; -typedef struct Conn Conn; +typedef struct Seats Seats; +typedef struct Lobby Lobby; struct GameState { @@ -14,9 +15,18 @@ struct Derivative double dx, dv; }; -struct Conn +struct Seats { int *fds; - ulong off; + ulong len; ulong cap; }; + +struct Lobby +{ + Seats seats; + + int (*takeseat)(Lobby*, int); + int (*getcouple)(Lobby*, int*); + int (*leaveseat)(Lobby*, ulong); +}; |