• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling Problem to compile

Felipe Monteiro

Webmaster
Joined
Feb 27, 2009
Messages
460
Reaction score
59
Location
Brasil
I have an erro in some functions.. like that

Code:
error C2601: 'ProtocolGame::onConnect' : local function definitions are illegal

its the function above

Code:
void ProtocolGame::onConnect()
{
    OutputMessage_ptr output = OutputMessagePool::getInstance()->getOutputMessage(this, false);
    if (output) {
        static std::random_device rd;
        static std::ranlux24 generator(rd());
        static std::uniform_int_distribution<uint16_t> randNumber(0x00, 0xFF);

        // Skip checksum
        output->SkipBytes(sizeof(uint32_t));

        // Packet length & type
        output->add<uint16_t>(0x0006);
        output->AddByte(0x1F);

        // Add timestamp & random number
        m_challengeTimestamp = static_cast<uint32_t>(time(nullptr));
        output->add<uint32_t>(m_challengeTimestamp);

        m_challengeRandom = randNumber(generator);
        output->AddByte(m_challengeRandom);

        // Go back and write checksum
        output->SkipBytes(-12);
        output->add<uint32_t>(adlerChecksum(output->getOutputBuffer() + sizeof(uint32_t), 8));

        OutputMessagePool::getInstance()->send(output);
    }
}
 
Back
Top