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

Secure Mode on/off - tfs 1.3

dunno321

New Member
Joined
Aug 2, 2017
Messages
20
Reaction score
3
Hey, where i can change the default secure mode to OFF? Everytime when i die/relog its set's to ON.
ZAjnQ21.gif
 
Solution
Emm, can you write easier? What should i change? This?
Code:
addGameTask(&Game::playerSetFightModes, player->getID(), fightMode, rawChaseMode != 0, rawSecureMode != 0);

Emm where did you even get that code haha?

Well if you always want it to be "on" then just change this; forgottenserver/protocolgame.cpp at 68ab2c606782fe9a38c5a0013a0df25588cabe26 · otland/forgottenserver · GitHub
To true, then here; forgottenserver/protocolgame.cpp at 68ab2c606782fe9a38c5a0013a0df25588cabe26 · otland/forgottenserver · GitHub
Write
C++:
sendFightModes();
Emm, can you write easier? What should i change? This?
Code:
addGameTask(&Game::playerSetFightModes, player->getID(), fightMode, rawChaseMode != 0, rawSecureMode != 0);
 
Emm, can you write easier? What should i change? This?
Code:
addGameTask(&Game::playerSetFightModes, player->getID(), fightMode, rawChaseMode != 0, rawSecureMode != 0);

Emm where did you even get that code haha?

Well if you always want it to be "on" then just change this; forgottenserver/protocolgame.cpp at 68ab2c606782fe9a38c5a0013a0df25588cabe26 · otland/forgottenserver · GitHub
To true, then here; forgottenserver/protocolgame.cpp at 68ab2c606782fe9a38c5a0013a0df25588cabe26 · otland/forgottenserver · GitHub
Write
C++:
sendFightModes();
 
Solution
Most likely the same, if you encounter any diffrences just quote this post.
it didn't work for my idk ( i have tfs 1.2 with protocolgame.cpp / protocolgamebase.cpp and their .h ) and id didn't work for me at all :S tried too many times and idk what do you mean with this xD can you explain more ?

Bump

Most likely the same, if you encounter any diffrences just quote this post.
still there?
 
Last edited by a moderator:
Is there any function to check the status of the secure mode? Thx

otland/forgottenserver

it didn't work for my idk ( i have tfs 1.2 with protocolgame.cpp / protocolgamebase.cpp and their .h ) and id didn't work for me at all :S tried too many times and idk what do you mean with this xD can you explain more ?

Bump


still there?

Any errors when you compile? Any errors when you start the server?
Otherwise you have to check if there are any differences with the code.

Make sure to read the rules; OtLand - The Official Rules for OTLand
 
otland/forgottenserver



Any errors when you compile? Any errors when you start the server?
Otherwise you have to check if there are any differences with the code.

Make sure to read the rules; OtLand - The Official Rules for OTLand
no there is no errors but i found some lines in another places let me show you me my secure mode codes and its places,
protocolgame.cpp
Code:
void ProtocolGame::parseFightModes(NetworkMessage& msg)
{
    uint8_t rawFightMode = msg.getByte(); // 1 - offensive, 2 - balanced, 3 - defensive
    uint8_t rawChaseMode = msg.getByte(); // 0 - stand while fightning, 1 - chase opponent
    uint8_t rawSecureMode = msg.getByte(); // 0 - can't attack unmarked, 1 - can attack unmarked
    // uint8_t rawPvpMode = msg.getByte(); // pvp mode introduced in 10.0

    chaseMode_t chaseMode;
    if (rawChaseMode == 1) {
        chaseMode = CHASEMODE_FOLLOW;
    } else {
        chaseMode = CHASEMODE_STANDSTILL;
    }

    fightMode_t fightMode;
    if (rawFightMode == 1) {
        fightMode = FIGHTMODE_ATTACK;
    } else if (rawFightMode == 2) {
        fightMode = FIGHTMODE_BALANCED;
    } else {
        fightMode = FIGHTMODE_DEFENSE;
    }

    addGameTask(&Game::playerSetFightModes, player->getID(), fightMode, chaseMode, rawSecureMode != 0);
}
protocolgame.cpp
Code:
void ProtocolGame::sendFightModes()
{
    NetworkMessage msg;
    msg.addByte(0xA7);
    msg.addByte(player->fightMode);
    msg.addByte(player->chaseMode);
    msg.addByte(player->secureMode);
    msg.addByte(PVP_MODE_DOVE);
    writeToOutputBuffer(msg);
}
protocolgame.h
Code:
        void sendFightModes();
player.cpp
Code:
    secureMode = false;
game.cpp
Code:
void Game::playerSetFightModes(uint32_t playerId, fightMode_t fightMode, chaseMode_t chaseMode, bool secureMode)
{
    Player* player = getPlayerByID(playerId);
    if (!player) {
        return;
    }

    player->setFightMode(fightMode);
    player->setChaseMode(chaseMode);
    player->setSecureMode(secureMode);
}
Code:
        void playerSetFightModes(uint32_t playerId, fightMode_t fightMode, chaseMode_t chaseMode, bool secureMode);
player.h
Code:
        bool hasSecureMode() const {
            return secureMode;
        }
Please tell me which lines i should change it to what and sorry for spamming i just forgot to quote your post so i sent another post.
 
Back
Top