Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void WorldSession::HandleCharEnumOpcode(WorldPacket & /*recvData*/)
- {
- if(++protectedPacketsCounter[PACKET_CMSG_CHAR_ENUM] >= 3)
- {
- std::ostringstream ss;
- if(protectedPacketsCounter[PACKET_CMSG_CHAR_ENUM] < 5 || protectedPacketsCounter[PACKET_CMSG_CHAR_ENUM] % 25 == 0)
- {
- ss << "[Overflood Protection] : Session with ";
- ss << "IP address ";
- ss << GetRemoteAddress();
- ss << " triggered OverFlood Protection for packet CMSG_CHAR_ENUM. info : ";
- ss << "Account ID : ";
- ss << GetAccountId();
- ss << " Account Name : ";
- std::string accountName;
- sAccountMgr->GetName(GetAccountId(), accountName);
- ss << accountName;
- ss << " Player Name : ";
- if(GetPlayer() && GetPlayer()->IsInWorld())
- ss << GetPlayer()->GetName();
- else
- ss << " No Name ( not logged in )";
- ss << " current packet count : ";
- ss << (uint32)protectedPacketsCounter[PACKET_CMSG_CHAR_ENUM];
- ss << ", ignoring.";
- sLog->outError(LOG_FILTER_GENERAL, ss.str().c_str());
- }
- return;
- }
- // remove expired bans
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_EXPIRED_BANS);
- CharacterDatabase.Execute(stmt);
- /// get all the data necessary for loading all characters (along with their pets) on the account
- if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED))
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ENUM_DECLINED_NAME);
- else
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ENUM);
- stmt->setUInt8(0, PET_SAVE_AS_CURRENT);
- stmt->setUInt32(1, GetAccountId());
- _charEnumCallback = CharacterDatabase.AsyncQuery(stmt);
- {
- AntiDOS.AllowOpcode(CMSG_CHAR_ENUM, false);
- // remove expired bans
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_EXPIRED_BANS);
- CharacterDatabase.Execute(stmt);
- /// get all the data necessary for loading all characters (along with their pets) on the account
- if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED))
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ENUM_DECLINED_NAME);
- else
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ENUM);
- stmt->setUInt8(0, PET_SAVE_AS_CURRENT);
- stmt->setUInt32(1, GetAccountId());
- _charEnumCallback = CharacterDatabase.AsyncQuery(stmt);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement