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

C++ tfs 1.3 - remove level in chat

emil92b

Intermediate OT User
Joined
Aug 21, 2013
Messages
335
Solutions
13
Reaction score
135
Location
Sweden
is there a way to remove the level next to player name from private chat, without getting debug?

20:30 Test [60]: <---

protocolgame.cpp
otland/forgottenserver

tfs 1.3
 
is there a way to remove the level next to player name from private chat, without getting debug?

20:30 Test [60]: <---

protocolgame.cpp
otland/forgottenserver

tfs 1.3
I would try to send level 0:
PHP:
if (speaker) {
    msg.addString(speaker->getName());
    msg.add<uint16_t>(0x00);
} else {
    msg.add<uint32_t>(0x00);
}
As it works in this line:
otland/forgottenserver

If it does not work, then it's not possible.
 
I tested @Gesior.pl solution a moment ago and it works fine.
Remember to change it in two places:
void ProtocolGame::sendCreatureSay
for default chat channel
and
void ProtocolGame::sendToChannel
for Help,Trade, etc. channels.

I tested that to remove it completely from sources but client debugs when you trying to remove entire "if" with the level. It's because client must receive an packet so changing it to 0x00 works because server sending empty packet (and level is hidden on chat channels) to client without getting debug. :p
 
ye i already tested that, the debug apparently appeared when i used uint32_t instead of uint16_t in sendPrivateMessage()

sendCreatureSay()
sendToChannel()
sendPrivateMessage()

but sending these seem to also remove right click functions such as send message etc

and the sender can still see his level in the private message chat
 
what your video is showing works for me too, but test what i wrote above

K0b5yez.png
 
Yeah. I tested it and it behaves the same with me.
(Right Click -> message to.) It seems that 10+ client adding something like context menu if he sees level then you can write to person who send you message.
So it's not possible without custom client or DLL injection.
 
Sorry to relive, but I passed here because I needed to do the same in my sourcer.
I got it like this programming like this:

Alter:
C++:
void ProtocolGame::sendCreatureSay(const Creature* creature, SpeakClasses type, const std::string& text, const Position* pos/* = nullptr*/)

{

    if (!creature) {

        return;

    }



    NetworkMessage msg;

    msg.addByte(0xAA);

    msg.add<uint32_t>(0x00);



    msg.addString(creature->getName());



    //Add level only for players

    if (const Player* speaker = creature->getPlayer()) {

        msg.add<uint16_t>(speaker->getLevel());

    } else {

        msg.add<uint16_t>(0x00);

    }



    msg.addByte(type);

    if (pos) {

        msg.addPosition(*pos);

    } else {

        msg.addPosition(creature->getPosition());

    }



    msg.addString(text);

    writeToOutputBuffer(msg);

}

For
C++:
void ProtocolGame::sendCreatureSay(const Creature* creature, SpeakClasses type, const std::string& text, const Position* pos/* = nullptr*/)

{

    if (!creature) {

        return;

    }



    NetworkMessage msg;

    msg.addByte(0xAA);

    msg.add<uint32_t>(0x00);



    msg.addString(creature->getName());



    //Add level only for players

    const Player* speaker = creature->getPlayer();

    if (speaker != creature->getNpc() || speaker != creature->getMonster()) {

        msg.add<uint16_t>(0x00);

    } else {

        msg.add<uint16_t>(0x00);

    }

    msg.addByte(type);

    if (pos) {

        msg.addPosition(*pos);

    } else {

        msg.addPosition(creature->getPosition());

    }



    msg.addString(text);

    writeToOutputBuffer(msg);

}
 
Last edited:
Back
Top