Jump to content

Socket User DC Fix - P2P


GDTR

Recommended Posts

  • Bronze

cmd.h open: 

 

search>

extern void SendNoticeMap(const char* c_pszBuf, int nMapIndex, bool bBigFont);

add on top>

extern const char * userDC(const char * userName);  

cmd_gm.cpp open:

search>

void SendLog(const char * c_pszBuf)
{
    const DESC_MANAGER::DESC_SET & c_ref_set = DESC_MANAGER::instance().GetClientSet();
    std::for_each(c_ref_set.begin(), c_ref_set.end(), log_packet_func(c_pszBuf));
}

add on top>

const char * userDC(const char * userName)
{

    LPDESC d = DESC_MANAGER::instance().FindByCharacterName(userName);
    LPCHARACTER    tch = d ? d->GetCharacter() : NULL;

    if (!tch)
    {
        return "Player not in game";
    }else{
        DESC_MANAGER::instance().DestroyDesc(d);
        return "Player kicked out";
    }


}

input.cpp open:

 

search:

else if (!stBuf.compare(0, 3, "DC "))

change code completely

 

else if (!stBuf.compare(0, 3, "DC "))
                {
                
                
                    std::string msg = stBuf.substr(3, LOGIN_MAX_LEN);

                 ///  dev_log(LOG_DEB0, "DC : '%s'", msg.c_str());


                    stResult = userDC(msg.c_str());
                
                    /*TPacketGGDisconnect pgg;

                    pgg.bHeader = HEADER_GG_DISCONNECT;
                    strlcpy(pgg.szLogin, msg.c_str(), sizeof(pgg.szLogin));

                    P2P_MANAGER::instance().Send(&pgg, sizeof(TPacketGGDisconnect));

                    // delete login key
                    {
                        TPacketDC p;
                        strlcpy(p.login, msg.c_str(), sizeof(p.login));
                        db_clientdesc->DBPacket(HEADER_GD_DC, 0, &p, sizeof(p));
                    }*/
                
                }

@xP3NG3Rx @WeedHex

Test:

 

  • Love 6

No advertising in signatures

Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.