refactor: add why-comments to zone tiles, audio cache, socket buffer

- zone_manager: document tile-to-zone key encoding (tileX * 100 + tileY,
  safe because tileY < 64 < 100) and explain that ranges are empirically
  derived from the retail WoW map grid
- audio_engine: expand sample rate comment — miniaudio defaults to
  device rate causing pitch distortion if not set explicitly; name
  kMaxCachedSounds constant with memory budget explanation
- tcp_socket: add why-comment on 4 KB recv buffer sizing — covers
  typical 20-500 byte packets and worst-case ~2 KB UPDATE_OBJECT
This commit is contained in:
Kelsi 2026-03-30 14:52:51 -07:00
parent 8c7db3e6c8
commit d2a7d79f60
3 changed files with 20 additions and 5 deletions

View file

@ -139,6 +139,9 @@ void TCPSocket::update() {
bool sawClose = false;
bool receivedAny = false;
for (;;) {
// 4 KB per recv() call — large enough for any single game packet while keeping
// stack usage reasonable. Typical WoW packets are 20-500 bytes; UPDATE_OBJECT
// can reach ~2 KB in crowded zones.
uint8_t buffer[4096];
ssize_t received = net::portableRecv(sockfd, buffer, sizeof(buffer));