mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-28 09:33:52 +00:00
fix: stabilize classic/turtle world session handling
Some checks failed
Build / Build (arm64) (push) Has been cancelled
Build / Build (x86-64) (push) Has been cancelled
Build / Build (macOS arm64) (push) Has been cancelled
Build / Build (windows-arm64) (push) Has been cancelled
Build / Build (windows-x86-64) (push) Has been cancelled
Security / CodeQL (C/C++) (push) Has been cancelled
Security / Semgrep (push) Has been cancelled
Security / Sanitizer Build (ASan/UBSan) (push) Has been cancelled
Some checks failed
Build / Build (arm64) (push) Has been cancelled
Build / Build (x86-64) (push) Has been cancelled
Build / Build (macOS arm64) (push) Has been cancelled
Build / Build (windows-arm64) (push) Has been cancelled
Build / Build (windows-x86-64) (push) Has been cancelled
Security / CodeQL (C/C++) (push) Has been cancelled
Security / Semgrep (push) Has been cancelled
Security / Sanitizer Build (ASan/UBSan) (push) Has been cancelled
This commit is contained in:
parent
43ebae217c
commit
f0a515ff9c
6 changed files with 522 additions and 179 deletions
|
|
@ -2488,6 +2488,15 @@ private:
|
|||
float pingInterval = 30.0f; // Ping interval (30 seconds)
|
||||
float timeSinceLastMoveHeartbeat_ = 0.0f; // Periodic movement heartbeat to keep server position synced
|
||||
float moveHeartbeatInterval_ = 0.5f;
|
||||
uint32_t lastHeartbeatSendTimeMs_ = 0;
|
||||
float lastHeartbeatX_ = 0.0f;
|
||||
float lastHeartbeatY_ = 0.0f;
|
||||
float lastHeartbeatZ_ = 0.0f;
|
||||
uint32_t lastHeartbeatFlags_ = 0;
|
||||
uint64_t lastHeartbeatTransportGuid_ = 0;
|
||||
uint32_t lastNonHeartbeatMoveSendTimeMs_ = 0;
|
||||
uint32_t lastFacingSendTimeMs_ = 0;
|
||||
float lastFacingSentOrientation_ = 0.0f;
|
||||
uint32_t lastLatency = 0; // Last measured latency (milliseconds)
|
||||
std::chrono::steady_clock::time_point pingTimestamp_; // Time CMSG_PING was sent
|
||||
|
||||
|
|
@ -2588,6 +2597,7 @@ private:
|
|||
// ---- Phase 2: Combat ----
|
||||
bool autoAttacking = false;
|
||||
bool autoAttackRequested_ = false; // local intent (CMSG_ATTACKSWING sent)
|
||||
bool autoAttackRetryPending_ = false; // one-shot retry after local start or server stop
|
||||
uint64_t autoAttackTarget = 0;
|
||||
bool autoAttackOutOfRange_ = false;
|
||||
float autoAttackOutOfRangeTime_ = 0.0f;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include <mutex>
|
||||
#include <atomic>
|
||||
#include <string>
|
||||
#include <array>
|
||||
|
||||
namespace wowee {
|
||||
namespace network {
|
||||
|
|
@ -90,6 +91,8 @@ private:
|
|||
void startAsyncPump();
|
||||
void stopAsyncPump();
|
||||
void closeSocketNoJoin();
|
||||
void recordRecentPacket(bool outbound, uint16_t opcode, uint16_t payloadLen);
|
||||
void dumpRecentPacketHistoryLocked(const char* reason, size_t bufferedBytes);
|
||||
|
||||
socket_t sockfd = INVALID_SOCK;
|
||||
bool connected = false;
|
||||
|
|
@ -131,6 +134,14 @@ private:
|
|||
std::chrono::steady_clock::time_point packetTraceUntil_{};
|
||||
std::string packetTraceReason_;
|
||||
|
||||
struct RecentPacketTrace {
|
||||
std::chrono::steady_clock::time_point when{};
|
||||
bool outbound = false;
|
||||
uint16_t opcode = 0;
|
||||
uint16_t payloadLen = 0;
|
||||
};
|
||||
std::deque<RecentPacketTrace> recentPacketHistory_;
|
||||
|
||||
// Packet callback
|
||||
std::function<void(const Packet&)> packetCallback;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue