stoneharry

Untitled

Apr 20th, 2013
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.86 KB | None | 0 0
  1. void WorldSession::HandleBugOpcode(WorldPacket & recv_data)
  2. {
  3.     CHECK_INWORLD_RETURN
  4.  
  5.     uint32 suggestion, contentlen;
  6.     std::string content;
  7.     uint32 typelen;
  8.     std::string type;
  9.  
  10.     recv_data >> suggestion >> contentlen >> content >> typelen >> type;
  11.  
  12.     if(suggestion == 0)
  13.         LOG_DEBUG("WORLD: Received CMSG_BUG [Bug Report]");
  14.     else
  15.         LOG_DEBUG("WORLD: Received CMSG_BUG [Suggestion]");
  16.  
  17.     uint64 AccountId = GetAccountId(true);
  18.     uint32 TimeStamp = uint32(UNIXTIME);
  19.     uint32 ReportID = objmgr.GenerateReportID();
  20.  
  21.     std::stringstream ss;
  22.  
  23.     ss << "INSERT INTO playerbugreports VALUES('";
  24.     ss << ReportID << "','";
  25.     ss << AccountId << "','";
  26.     ss << TimeStamp << "','";
  27.     ss << suggestion << "','";
  28.     ss << CharacterDatabase.EscapeString(type) << "','";
  29.     ss << CharacterDatabase.EscapeString(content) << "')";
  30.  
  31.     CharacterDatabase.ExecuteNA(ss.str().c_str());
  32. }
Advertisement
Add Comment
Please, Sign In to add comment