mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 01:23:51 +00:00
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:
parent
8c7db3e6c8
commit
d2a7d79f60
3 changed files with 20 additions and 5 deletions
|
|
@ -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));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue