This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [TrinityCore] Remove AFK kicking/disconnecting?  (Read 2724 times)

spiderwaseem

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 154
    • View Profile
    • http://anarchy-wow.com/
[TrinityCore] Remove AFK kicking/disconnecting?
« 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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [TrinityCore] Remove AFK kicking/disconnecting?
« Reply #1 on: April 11, 2015, 05:32:52 pm »
the client decides this itself
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

spiderwaseem

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 154
    • View Profile
    • http://anarchy-wow.com/
Re: [TrinityCore] Remove AFK kicking/disconnecting?
« Reply #2 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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [TrinityCore] Remove AFK kicking/disconnecting?
« Reply #3 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
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

spiderwaseem

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 154
    • View Profile
    • http://anarchy-wow.com/
Re: [TrinityCore] Remove AFK kicking/disconnecting?
« Reply #4 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

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).
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [TrinityCore] Remove AFK kicking/disconnecting?
« Reply #5 on: April 11, 2015, 06:55:58 pm »
yes
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

spiderwaseem

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 154
    • View Profile
    • http://anarchy-wow.com/
Re: [TrinityCore] Remove AFK kicking/disconnecting?
« Reply #6 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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [TrinityCore] Remove AFK kicking/disconnecting?
« Reply #7 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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

spiderwaseem

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 154
    • View Profile
    • http://anarchy-wow.com/
Re: [TrinityCore] Remove AFK kicking/disconnecting?
« Reply #8 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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

fakepanda

  • Registred Member
  • Race Changer
  • *****
  • Posts: 29
    • View Profile
Re: [TrinityCore] Remove AFK kicking/disconnecting?
« Reply #9 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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

spiderwaseem

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 154
    • View Profile
    • http://anarchy-wow.com/
Re: [TrinityCore] Remove AFK kicking/disconnecting?
« Reply #10 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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

kojak488

  • Registred Member
  • Creator of Worlds
  • *****
  • Posts: 351
    • View Profile
Re: [TrinityCore] Remove AFK kicking/disconnecting?
« Reply #11 on: April 18, 2015, 04:24:53 pm »
The suspense is killing me.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »