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

Exit Character

IgoR lYCAN

New Member
Joined
Dec 1, 2018
Messages
169
Reaction score
4
Based on TFS 1.3
When You made exit with "battle" <- ( -> Without pz locked. <- )

The character doenst logout!
It should after 1 minute exited.

1579955213305.png
 
The problem is exactly this :

When I exit, with battle ( normal battle )

1580176611802.png

The character doenst logout, if there is monsters on his screen <--

After he lose the battle, the character logout.

But the thing is: if you exit, with these conditions, the character should logout after 60 seconds.
 


C++:
void Player::sendPing()

here you can see
C++:
if (noPongTime >= 60000 && canLogout()) {
        if (g_creatureEvents->playerLogout(this)) {
            if (client) {
                client->logout(true, true);
            } else {
                g_game.removeCreature(this, true);
            }
        }
    }

so you need to look at canLogout func:

C++:
bool Player::canLogout()
{
    if (isConnecting) {
        return false;
    }

    if (getTile()->hasFlag(TILESTATE_NOLOGOUT)) {
        return false;
    }

    if (getTile()->hasFlag(TILESTATE_PROTECTIONZONE)) {
        return true;
    }

    return !isPzLocked() && !hasCondition(CONDITION_INFIGHT);
}

which says
C++:
return !isPzLocked() && !hasCondition(CONDITION_INFIGHT);

so you can just remove
C++:
 && !hasCondition(CONDITION_INFIGHT)

what is not good idea in my opinion cuz a few bad things can happen then
 
C++:
void Player::sendPing()

here you can see
C++:
if (noPongTime >= 60000 && canLogout()) {
        if (g_creatureEvents->playerLogout(this)) {
            if (client) {
                client->logout(true, true);
            } else {
                g_game.removeCreature(this, true);
            }
        }
    }

so you need to look at canLogout func:

C++:
bool Player::canLogout()
{
    if (isConnecting) {
        return false;
    }

    if (getTile()->hasFlag(TILESTATE_NOLOGOUT)) {
        return false;
    }

    if (getTile()->hasFlag(TILESTATE_PROTECTIONZONE)) {
        return true;
    }

    return !isPzLocked() && !hasCondition(CONDITION_INFIGHT);
}

which says
C++:
return !isPzLocked() && !hasCondition(CONDITION_INFIGHT);

so you can just remove
C++:
 && !hasCondition(CONDITION_INFIGHT)

what is not good idea in my opinion cuz a few bad things can happen then
Which kinda of problems this config avoids?

You recommend dont change it?
 
@Perun ? '---'

It worked;

but
Which kinda of problems this config avoids?

You recommend dont change it?

Hey IgoR lYCAN, I know this is an old post but I just want to add that if you remove that condition players would be able to be logged out during a battle with any monster or player, even if this player is PK.

Your character was not being logged out due to the conditions shared by Perun, you could try debugging the project to make sure which one is preventing the disconnection, seems like the player is attacking or being attacked, I use TFS 1.3 and have not seen this issue
 
Back
Top