stoneharry

Untitled

Jan 29th, 2012
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. bool ChatHandler::HandleForceLoginCommand(const char* args, WorldSession* m_session)
  2. {
  3.     uint32 accountid = 0;
  4.     if( sscanf(args, "%u", &accountid) != 1)
  5.         return false;
  6.     QueryResult * r = WorldDatabase.Query("select * from `%s`.`accounts` where acct = %u", Config.MainConfig.GetStringDefault("Server", "LogonDatabaseName", "zlogon").c_str(), accountid);
  7.     if(r == NULL)
  8.     {
  9.         RedSystemMessage(m_session, "%u is an invalid account", accountid);
  10.         return true;
  11.     }
  12.     delete r;
  13.     m_session->SetAccountId(accountid);
  14.     m_session->GetPlayer()->Kick();
  15.     sGMLog.writefromsession(m_session, "Force loged into account id %u.", accountid);
  16.     return true;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment