Ejemplo n.º 1
0
 private static void OnCommand(RCon.Command cmd)
 {
     try
     {
         RCon.responseIdentifier = cmd.Identifier;
         RCon.responseConnection = cmd.ConnectionId;
         RCon.isInput            = true;
         if (RCon.Print)
         {
             Debug.Log(string.Concat(new object[] { "[rcon] ", cmd.Ip, ": ", cmd.Message }));
         }
         RCon.isInput = false;
         ConsoleSystem.Option server = ConsoleSystem.Option.Server;
         string str = ConsoleSystem.Run(server.Quiet(), cmd.Message, Array.Empty <object>());
         if (str != null)
         {
             RCon.OnMessage(str, string.Empty, UnityEngine.LogType.Log);
         }
     }
     finally
     {
         RCon.responseIdentifier = 0;
         RCon.responseConnection = string.Empty;
     }
 }
Ejemplo n.º 2
0
 private static void OnCommand(RCon.Command cmd)
 {
     try
     {
         RCon.responseIdentifier = cmd.Identifier;
         RCon.responseConnection = cmd.ConnectionId;
         RCon.isInput            = true;
         if (RCon.Print)
         {
             Debug.Log((object)("[rcon] " + (object)cmd.Ip + ": " + cmd.Message));
         }
         RCon.isInput = false;
         ConsoleSystem.Option server = ConsoleSystem.Option.get_Server();
         string message = ConsoleSystem.Run(((ConsoleSystem.Option) ref server).Quiet(), cmd.Message, (object[])Array.Empty <object>());
         if (message == null)
         {
             return;
         }
         RCon.OnMessage(message, string.Empty, (UnityEngine.LogType) 3);
     }
     finally
     {
         RCon.responseIdentifier = 0;
         RCon.responseConnection = string.Empty;
     }
 }