• 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!

[TFS 0.3.6pl1] "Catacombs" Teleporter like Diablo 3 Teleport - Great for RPG servers (Remake)

I have changed the protocolgame.cpp code to "work" with 0.4, but it seems to crash the client when using the teleport beacon (I changed it to onUse instead of onStepIn). It has to be something to do with sending the wrong packet, probably while sending the window.

Code:
void ProtocolGame::sendModalWindow(const ModalWindow& modalWindow)
{
    NetworkMessage_ptr msg = getOutputBuffer();
    if(!msg)
        return;

    TRACK_MESSAGE(msg);
 
    msg->put<char>(0xFA);
    msg->put<uint32_t>(modalWindow.id);
    msg->putString(modalWindow.title);
    msg->putString(modalWindow.message);

    msg->put<char>(modalWindow.buttons.size());
    for(ModalWindowMap::const_iterator it = modalWindow.buttons.begin(); it != modalWindow.buttons.end(); it++)
    {
        msg->putString(it->first);
        msg->put<char>(it->second);
    }

    msg->put<char>(modalWindow.choices.size());
    for(ModalWindowMap::const_iterator it = modalWindow.choices.begin(); it != modalWindow.choices.end(); it++)
    {
        msg->putString(it->first);
        msg->put<char>(it->second);
    }

    msg->put<char>(modalWindow.defaultEnterButton);
    msg->put<char>(modalWindow.defaultEscapeButton);
    msg->put<char>(modalWindow.priority ? 0x01 : 0x00);
}

Client error report;
Code:
Player action: 049 051 054 046 049 052 052 046 049 055 052 046 049 049 049 058 055 049 055 050
Player.cpp 36: exception occurred, reason:
Network.cpp 946L exception occurred (ErrorCode = 0), reason:
Control.cpp 1331: exception occurred (Type = 250)(MainWindow = 9614312), reason:
Control.cpp 1325 unknown packet type during game (Type=250)
 
I have changed the protocolgame.cpp code to "work" with 0.4, but it seems to crash the client when using the teleport beacon (I changed it to onUse instead of onStepIn). It has to be something to do with sending the wrong packet, probably while sending the window.

Code:
void ProtocolGame::sendModalWindow(const ModalWindow& modalWindow)
{
    NetworkMessage_ptr msg = getOutputBuffer();
    if(!msg)
        return;

    TRACK_MESSAGE(msg);
 
    msg->put<char>(0xFA);
    msg->put<uint32_t>(modalWindow.id);
    msg->putString(modalWindow.title);
    msg->putString(modalWindow.message);

    msg->put<char>(modalWindow.buttons.size());
    for(ModalWindowMap::const_iterator it = modalWindow.buttons.begin(); it != modalWindow.buttons.end(); it++)
    {
        msg->putString(it->first);
        msg->put<char>(it->second);
    }

    msg->put<char>(modalWindow.choices.size());
    for(ModalWindowMap::const_iterator it = modalWindow.choices.begin(); it != modalWindow.choices.end(); it++)
    {
        msg->putString(it->first);
        msg->put<char>(it->second);
    }

    msg->put<char>(modalWindow.defaultEnterButton);
    msg->put<char>(modalWindow.defaultEscapeButton);
    msg->put<char>(modalWindow.priority ? 0x01 : 0x00);
}

Client error report;
Code:
Player action: 049 051 054 046 049 052 052 046 049 055 052 046 049 049 049 058 055 049 055 050
Player.cpp 36: exception occurred, reason:
Network.cpp 946L exception occurred (ErrorCode = 0), reason:
Control.cpp 1331: exception occurred (Type = 250)(MainWindow = 9614312), reason:
Control.cpp 1325 unknown packet type during game (Type=250)

Modal window is only 10.x client feature.
 
Back
Top