Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Serverside Modding => Topic started by: spiderwaseem on April 11, 2015, 04:25:00 pm

Title: [TrinityCore] Remove AFK kicking/disconnecting?
Post by: spiderwaseem on April 11, 2015, 04:25:00 pm
Hello everyone.

If you have ever been AFK on WoW, you should already know that after around 5 - 10 minutes of being AFK, you get kicked to the character selection screen (or login screen).

I am using a TrinityCore 3.3.5 Eluna (Self-Compiled) Core.

Quote
Core Info:
Core Version: TrinityCore rev. 64c00b566d81+ 2014-11-16 15:30:42 +0300 (master branch) (Win64, Release)
Core Revision: 64c00b566d81+
DB_Version: TDB 335.53

I would like to make it so that when players go AFK, they don't get disconnected/kicked.
I searched on the web for this and there were a couple of posts, however, non gave me an answer.

If anyone knows how to remove the fact of being kicked/disconnected when you are AFK on TrinityCore (3.3.5), then please do help me in anyway possible.

Thank You.
Title: Re: [TrinityCore] Remove AFK kicking/disconnecting?
Post by: schlumpf on April 11, 2015, 05:32:52 pm
the client decides this itself
Title: Re: [TrinityCore] Remove AFK kicking/disconnecting?
Post by: spiderwaseem on April 11, 2015, 05:43:51 pm
Quote from: "schlumpf"
the client decides this itself

So you happen to know where in the client?
What file or file path?

Thank You.
Title: Re: [TrinityCore] Remove AFK kicking/disconnecting?
Post by: schlumpf on April 11, 2015, 05:49:28 pm
It is _in_ the client, not in some file.

http://www.ownedcore.com/forums/world-o ... e-afk.html (http://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-bots-programs/wow-memory-editing/292949-disable-afk.html" onclick="window.open(this.href);return false;)
Title: Re: [TrinityCore] Remove AFK kicking/disconnecting?
Post by: spiderwaseem on April 11, 2015, 06:02:31 pm
Quote from: "schlumpf"
It is _in_ the client, not in some file.

http://www.ownedcore.com/forums/world-o ... e-afk.html (http://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-bots-programs/wow-memory-editing/292949-disable-afk.html" onclick="window.open(this.href);return false;)

When you said in the client, I thought you meant in one of the MPQs.
So you mean it's in the Wow.exe?
(sorry if I asked a noob question).
Title: Re: [TrinityCore] Remove AFK kicking/disconnecting?
Post by: schlumpf on April 11, 2015, 06:55:58 pm
yes
Title: Re: [TrinityCore] Remove AFK kicking/disconnecting?
Post by: spiderwaseem on April 11, 2015, 07:58:51 pm
Quote from: "schlumpf"
yes

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.
Title: Re: [TrinityCore] Remove AFK kicking/disconnecting?
Post by: schlumpf on April 11, 2015, 09:38:54 pm
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.
Title: Re: [TrinityCore] Remove AFK kicking/disconnecting?
Post by: spiderwaseem on April 11, 2015, 10:08:03 pm
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();
}

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;
    }
}

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());
}

It wasn't a lot really...
But that's all I can find.
Title: Re: [TrinityCore] Remove AFK kicking/disconnecting?
Post by: fakepanda on April 12, 2015, 12:13:27 am
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.
Title: Re: [TrinityCore] Remove AFK kicking/disconnecting?
Post by: spiderwaseem on April 12, 2015, 12:21:53 am
Quote from: "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.

I think I have already tried this...
However it's still worth another shot.

Here is what my configs says now:
Quote
#
#    SocketTimeOutTime
#        Description: Time (in milliseconds) after which a connection being idle on the character
#                     selection screen is disconnected.
#        Default:     900000 - (15 minutes)

SocketTimeOutTime = 90000000

I'll come back in 10 - 15 minutes and tell you if it worked or not.

Thanks. :)
P.S
I don't mind having the AFK tag on, as long as they don't dc or get kicked.
Title: Re: [TrinityCore] Remove AFK kicking/disconnecting?
Post by: kojak488 on April 18, 2015, 04:24:53 pm
The suspense is killing me.