Advertisement
Guest User

Untitled

a guest
Aug 26th, 2016
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. void Talk_Report(Character *character, PacketReader &reader)
  2. {
  3. if (character->muted_until > time(0)) return;
  4.  
  5. std::string message = reader.GetEndString();
  6. limit_message(message, static_cast<int>(character->world->config["ChatLength"]));
  7.  
  8. if (message.empty())
  9. {
  10. return;
  11. }
  12.  
  13. if ( (character->SourceAccess() && message[0] == '$' ) || message[0]=='#')
  14. {
  15. bool player = ( message[0]=='#' ) ;
  16.  
  17. std::string command;
  18. std::vector<std::string> arguments = util::explode(' ', message);
  19. command = arguments.front().substr(1);
  20. arguments.erase(arguments.begin());
  21.  
  22. if(!player)
  23. {
  24. character->world->Command(command, arguments, character);
  25. if (character->world->config["LogCommands"])
  26. {
  27. Console::Out("%s: %s", character->real_name.c_str(), message.c_str());
  28. }
  29. }
  30. else
  31.  
  32. {
  33. if( command == "compare" )
  34. {
  35. character->comp_locker.clear();
  36. PacketBuilder reply(PACKET_LOCKER, PACKET_OPEN,2);
  37. reply.AddChar(0);
  38. reply.AddChar(0);
  39. character->Send(reply);
  40. }
  41. }
  42.  
  43.  
  44. }
  45. else
  46. {
  47. character->map->Msg(character, message, false);
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement