mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 09:33:51 +00:00
Harden packet framing/logging and checkpoint current workspace state
This commit is contained in:
parent
4b48fcdab2
commit
615efd01b7
9 changed files with 290 additions and 147 deletions
|
|
@ -58,6 +58,8 @@ struct ActiveTransport {
|
|||
bool clientAnimationReverse; // Run client animation in reverse along the selected path
|
||||
float serverYaw; // Server-authoritative yaw (radians)
|
||||
bool hasServerYaw; // Whether we've received server yaw
|
||||
bool serverYawFlipped180; // Auto-correction when server yaw is consistently opposite movement
|
||||
int serverYawAlignmentScore; // Hysteresis score for yaw flip detection
|
||||
|
||||
float lastServerUpdate; // Time of last server movement update
|
||||
int serverUpdateCount; // Number of server updates received
|
||||
|
|
|
|||
|
|
@ -18,10 +18,10 @@ namespace network {
|
|||
*
|
||||
* Key Differences from Auth Server:
|
||||
* - Outgoing: 6-byte header (2 bytes size + 4 bytes opcode, big-endian)
|
||||
* - Incoming: 4-byte header (2 bytes size + 2 bytes opcode, big-endian)
|
||||
* - Incoming: 4-byte header (2 bytes size + 2 bytes opcode)
|
||||
* - Headers are RC4-encrypted after CMSG_AUTH_SESSION
|
||||
* - Packet bodies remain unencrypted
|
||||
* - Size field is payload size only (does NOT include header)
|
||||
* - Size field includes opcode bytes (payloadLen = size - 2)
|
||||
*/
|
||||
class WorldSocket : public Socket {
|
||||
public:
|
||||
|
|
@ -89,6 +89,9 @@ private:
|
|||
// This prevents re-decrypting the same header when waiting for more data
|
||||
size_t headerBytesDecrypted = 0;
|
||||
|
||||
// Debug-only tracing window for post-auth packet framing verification.
|
||||
int headerTracePacketsLeft = 0;
|
||||
|
||||
// Packet callback
|
||||
std::function<void(const Packet&)> packetCallback;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -73,6 +73,14 @@ public:
|
|||
*/
|
||||
std::vector<uint8_t> readFile(const std::string& path) const;
|
||||
|
||||
/**
|
||||
* Read optional file data from MPQ archives without warning spam.
|
||||
* Intended for probe-style lookups (e.g. external .anim variants).
|
||||
* @param path Virtual file path
|
||||
* @return File contents (empty if not found)
|
||||
*/
|
||||
std::vector<uint8_t> readFileOptional(const std::string& path) const;
|
||||
|
||||
/**
|
||||
* Get MPQ manager for direct access
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue