Exemplo n.º 1
0
 public static void HandleCheat(WorldSession session, ClientCheat cheat)
 {
     try
     {
         var target  = session.Player.GetVisible <WorldEntity>(session.Player.TargetGuid);
         var context = new WorldSessionCommandContext(session.Player, target);
         CommandManager.Instance.HandleCommand(context, cheat.Message);
     }
     catch (Exception e)
     {
         log.Warn(e.Message);
     }
 }
Exemplo n.º 2
0
 public static void HandleChat(WorldSession session, ClientChat chat)
 {
     if (chat.Message.StartsWith(CommandPrefix))
     {
         try
         {
             var target  = session.Player.GetVisible <WorldEntity>(session.Player.TargetGuid);
             var context = new WorldSessionCommandContext(session.Player, target);
             CommandManager.Instance.HandleCommand(context, chat.Message.Substring(CommandPrefix.Length));
         }
         catch (Exception e)
         {
             log.Warn($"{e.Message}: {e.StackTrace}");
         }
     }
     else
     {
         SocialManager.Instance.HandleClientChat(session, chat);
     }
 }