From d60d2573ad7ab869d040a438b328d5abc3bcebae Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Tue, 17 Jul 2018 23:23:16 -0400 Subject: Add server map generation --- torus.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'torus.h') diff --git a/torus.h b/torus.h index d3c0d81..918a131 100644 --- a/torus.h +++ b/torus.h @@ -88,12 +88,28 @@ static const struct { }; static const size_t SPAWNS_LEN = sizeof(SPAWNS) / sizeof(SPAWNS[0]); +enum { + MAP_ROWS = 11, + MAP_COLS = 11, +}; + +struct Map { + struct MapTile { + time_t createTime; + time_t modifyTime; + time_t accessTime; + uint32_t modifyCount; + uint32_t accessCount; + } tiles[MAP_ROWS][MAP_COLS]; +}; + struct ServerMessage { enum PACKED { SERVER_TILE, SERVER_MOVE, SERVER_PUT, SERVER_CURSOR, + SERVER_MAP, } type; union { struct { @@ -122,6 +138,7 @@ struct ClientMessage { CLIENT_MOVE, CLIENT_PUT, CLIENT_SPAWN, + CLIENT_MAP, } type; union { struct { -- cgit 1.4.1