• 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 1.X+ TFS 1.4 PZ lock issue

locoso

New Member
Joined
May 27, 2008
Messages
10
Solutions
2
Reaction score
4
Hey.

I have problem with pk and pz lock.

When i kill someone so pz lock and white skull system is working normally.
But if i forge exit with client so server is kicking player after 1 minute, when he have time left with pz..

Where i can search somethink to edit.
It will be annoying when someone go pk and forge exit and he don't have pz lock white skull

Greetings
 
Solution
Solution:

In player.cpp change lines from 865 till 908 :

Lua:
void Player::sendPing()
{
    int64_t timeNow = OTSYS_TIME();

    bool hasLostConnection = false;
    if ((timeNow - lastPing) >= 5000) {
        lastPing = timeNow;
        if (client) {
            client->sendPing();
        } else {
            hasLostConnection = true;
        }
    }

    int64_t noPongTime = timeNow - lastPong;
    if ((hasLostConnection || noPongTime >= 7000) && attackedCreature && attackedCreature->getPlayer()) {
        setAttackedCreature(nullptr);
    }

    int32_t noPongKickTime = vocation->getNoPongKickTime();
    if (pzLocked && noPongKickTime < 60000) {
        noPongKickTime = 60000;
    }

    if (noPongTime >= noPongKickTime) {...
Solution:

In player.cpp change lines from 865 till 908 :

Lua:
void Player::sendPing()
{
    int64_t timeNow = OTSYS_TIME();

    bool hasLostConnection = false;
    if ((timeNow - lastPing) >= 5000) {
        lastPing = timeNow;
        if (client) {
            client->sendPing();
        } else {
            hasLostConnection = true;
        }
    }

    int64_t noPongTime = timeNow - lastPong;
    if ((hasLostConnection || noPongTime >= 7000) && attackedCreature && attackedCreature->getPlayer()) {
        setAttackedCreature(nullptr);
    }

    int32_t noPongKickTime = vocation->getNoPongKickTime();
    if (pzLocked && noPongKickTime < 60000) {
        noPongKickTime = 60000;
    }

    if (noPongTime >= noPongKickTime) {
        if (isConnecting || getTile()->hasFlag(TILESTATE_NOLOGOUT)) {
            return;
        }
        
        if (pzLocked) {
        return;
        }

        if (!g_creatureEvents->playerLogout(this)) {
            return;
        }

        if (client) {
            client->logout(true, true);
        } else {
            g_game.removeCreature(this, true);
        }
    }
}
 
Solution
Back
Top