Merge pull request #50 from savisxss/SEQUENCE

This commit is contained in:
rtw1x1
2025-12-29 06:09:54 +00:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@@ -78,6 +78,8 @@ void DESC::Initialize()
m_bChannelStatusRequested = false;
m_SequenceGenerator.seed(SEQUENCE_SEED);
// Pre-generate the first expected sequence to match what client will send
m_bNextExpectedSequence = m_SequenceGenerator(UINT8_MAX + 1);
m_pkLoginKey = NULL;
m_dwLoginKey = 0;
@@ -920,7 +922,10 @@ bool DESC::IsAdminMode()
BYTE DESC::GetSequence()
{
return m_SequenceGenerator(UINT8_MAX + 1);
// Return the next expected sequence and then generate the one after that
BYTE bCurrentExpected = m_bNextExpectedSequence;
m_bNextExpectedSequence = m_SequenceGenerator(UINT8_MAX + 1);
return bCurrentExpected;
}
void DESC::SendLoginSuccessPacket()

View File

@@ -230,6 +230,7 @@ class DESC
bool m_bPong;
pcg32 m_SequenceGenerator;
BYTE m_bNextExpectedSequence; // Next expected sequence number from client
CLoginKey * m_pkLoginKey;
DWORD m_dwLoginKey;