Advertisement
Guest User

Untitled

a guest
Sep 4th, 2013
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.00 KB | None | 0 0
  1.    SendPacket(&data);
  2. }
  3.  
  4. void WorldSession::HandleCharEnumOpcode(WorldPacket & /*recvData*/)
  5. {
  6.     if(++protectedPacketsCounter[PACKET_CMSG_CHAR_ENUM] >= 3)
  7.     {
  8.         std::ostringstream ss;
  9.             if(protectedPacketsCounter[PACKET_CMSG_CHAR_ENUM] < 5 || protectedPacketsCounter[PACKET_CMSG_CHAR_ENUM] % 25 == 0)
  10.             {
  11.                 ss << "[Overflood Protection] : Session with ";
  12.                 ss << "IP address ";
  13.                 ss << GetRemoteAddress();
  14.                 ss << " triggered OverFlood Protection for packet CMSG_CHAR_ENUM. info : ";
  15.                 ss << "Account ID : ";
  16.                 ss << GetAccountId();
  17.                 ss << " Account Name : ";
  18.                 std::string accountName;
  19.                 sAccountMgr->GetName(GetAccountId(), accountName);
  20.                 ss << accountName;
  21.                 ss << " Player Name : ";
  22.                 if(GetPlayer() && GetPlayer()->IsInWorld())
  23.                     ss << GetPlayer()->GetName();
  24.                 else
  25.                     ss << " No Name ( not logged in )";
  26.                 ss << " current packet count : ";
  27.                 ss << (uint32)protectedPacketsCounter[PACKET_CMSG_CHAR_ENUM];
  28.                 ss << ", ignoring.";
  29.                 sLog->outError(LOG_FILTER_GENERAL, ss.str().c_str());
  30.             }
  31.         return;
  32.     }
  33.     // remove expired bans
  34.     PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_EXPIRED_BANS);
  35.     CharacterDatabase.Execute(stmt);
  36.  
  37.     /// get all the data necessary for loading all characters (along with their pets) on the account
  38.  
  39.     if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED))
  40.         stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ENUM_DECLINED_NAME);
  41.     else
  42.         stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ENUM);
  43.  
  44.     stmt->setUInt8(0, PET_SAVE_AS_CURRENT);
  45.     stmt->setUInt32(1, GetAccountId());
  46.  
  47.     _charEnumCallback = CharacterDatabase.AsyncQuery(stmt);
  48. }
  49. {                                                                            // <------- 289 line
  50.     AntiDOS.AllowOpcode(CMSG_CHAR_ENUM, false);
  51.  
  52.     // remove expired bans
  53.     PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_EXPIRED_BANS);
  54.     CharacterDatabase.Execute(stmt);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement