about summary refs log tree commit diff homepage
path: root/torus.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-07-17 23:23:16 -0400
committerJune McEnroe <june@causal.agency>2018-07-17 23:35:21 -0400
commitd60d2573ad7ab869d040a438b328d5abc3bcebae (patch)
tree3d31cdeadae3739faebf103eafe53e5e1fc3df39 /torus.h
parentTabify source (diff)
downloadtorus-d60d2573ad7ab869d040a438b328d5abc3bcebae.tar.gz
torus-d60d2573ad7ab869d040a438b328d5abc3bcebae.zip
Add server map generation
Diffstat (limited to '')
-rw-r--r--torus.h17
1 files changed, 17 insertions, 0 deletions
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 {