Forum > Serverside Modding

[TrinityCore] Remove AFK kicking/disconnecting?

<< < (2/3) > >>

schlumpf:
yes

spiderwaseem:

--- Quote from: "schlumpf" ---yes
--- End quote ---

I'm still a little confused on how to follow the link you have given me.

However, I would like to see if it's possible to somehow remove AFK from the server side instead?
So non-patch or custom exe users don't have AFK.

schlumpf:
The client will still mark you afk, even if the server doesn't know that word. iirc, the server only automatically marks as afk in battlegrounds.

Just search for "afk" in the server source code. It will likely be a lot in player.cpp.

spiderwaseem:
Here is literally everything I found in player.cpp just by looking for "afk":


--- Quote ---void Player::ToggleAFK()
{
    ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK);

    // afk player not allowed in battleground
    if (isAFK() && InBattleground() && !InArena())
        LeaveBattleground();
}

--- End quote ---


--- Quote ---///checks the 15 afk reports per 5 minutes limit
void Player::UpdateAfkReport(time_t currTime)
{
    if (m_bgData.bgAfkReportedTimer <= currTime)
    {
        m_bgData.bgAfkReportedCount = 0;
        m_bgData.bgAfkReportedTimer = currTime+5*MINUTE;
    }
}

--- End quote ---


--- Quote ---void Player::Whisper(const std::string& text, uint32 language, uint64 receiver)
{
    bool isAddonMessage = language == LANG_ADDON;

    if (!isAddonMessage)                                    // if not addon data
        language = LANG_UNIVERSAL;                          // whispers should always be readable

    Player* rPlayer = ObjectAccessor::FindPlayer(receiver);

    std::string _text(text);
    sScriptMgr->OnPlayerChat(this, CHAT_MSG_WHISPER, language, _text, rPlayer);

    WorldPacket data;
    ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER, Language(language), this, this, _text);
    rPlayer->GetSession()->SendPacket(&data);

    // rest stuff shouldn't happen in case of addon message
    if (isAddonMessage)
        return;

    ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER_INFORM, Language(language), rPlayer, rPlayer, _text);
    GetSession()->SendPacket(&data);

    if (!isAcceptWhispers() && !IsGameMaster() && !rPlayer->IsGameMaster())
    {
        SetAcceptWhispers(true);
        ChatHandler(GetSession()).SendSysMessage(LANG_COMMAND_WHISPERON);
    }

    // announce afk or dnd message
    if (rPlayer->isAFK())
        ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_AFK, rPlayer->GetName().c_str(), rPlayer->autoReplyMsg.c_str());
    else if (rPlayer->isDND())
        ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_DND, rPlayer->GetName().c_str(), rPlayer->autoReplyMsg.c_str());
}

--- End quote ---

It wasn't a lot really...
But that's all I can find.

fakepanda:
Hello,

It is possible to remove the afk kicking serverside, however it is not possible to remove the afk taging since that is done client side.

Try changing SocketTimeOutTime in configs if you are using trinitycore to disable auto disconnect. Not sure if it works but it is worth trying.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version