diff options
author | June McEnroe <june@causal.agency> | 2017-07-31 19:21:50 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2017-07-31 19:21:50 -0400 |
commit | f7bdd3ce58117d17a24d81eacff41db43fa1f9d8 (patch) | |
tree | 48e4778a17104fcaf1f472eabed201307e534215 | |
parent | Adjust move speed in client (diff) | |
download | torus-f7bdd3ce58117d17a24d81eacff41db43fa1f9d8.tar.gz torus-f7bdd3ce58117d17a24d81eacff41db43fa1f9d8.zip |
Track tile access counts
-rwxr-xr-x | server.c | 1 | ||||
-rw-r--r-- | torus.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/server.c b/server.c index cea66c1..46f4c06 100755 --- a/server.c +++ b/server.c @@ -44,6 +44,7 @@ static struct Tile *tileGet(uint32_t tileX, uint32_t tileY) { tile->create = time(NULL); } tile->access = time(NULL); + tile->accessCount++; return tile; } diff --git a/torus.h b/torus.h index 3a98fe3..ff9c0e8 100644 --- a/torus.h +++ b/torus.h @@ -30,6 +30,7 @@ struct Tile { time_t access; char cells[CELL_ROWS][CELL_COLS] ALIGNED(16); uint8_t colors[CELL_ROWS][CELL_COLS] ALIGNED(16); + uint32_t accessCount; } ALIGNED(4096); static_assert(sizeof(struct Tile) == 4096, "struct Tile is page-sized"); static_assert(offsetof(struct Tile, cells) == 16, "stable cells offset"); |