コード例 #1
0
 // Token: 0x0600097E RID: 2430 RVA: 0x000292B8 File Offset: 0x000274B8
 private static void HandleLog(string message, string stackTrace, LogType logType)
 {
     if (logType == LogType.Error)
     {
         message = string.Format(CultureInfo.InvariantCulture, "<color=#FF0000>{0}</color>", message);
     }
     else if (logType == LogType.Warning)
     {
         message = string.Format(CultureInfo.InvariantCulture, "<color=#FFFF00>{0}</color>", message);
     }
     Console.Log log = new Console.Log
     {
         message    = message,
         stackTrace = stackTrace,
         logType    = logType
     };
     Console.logs.Add(log);
     if (Console.maxMessages.value > 0)
     {
         while (Console.logs.Count > Console.maxMessages.value)
         {
             Console.logs.RemoveAt(0);
         }
     }
     if (Console.onLogReceived != null)
     {
         Console.onLogReceived(log);
     }
 }
コード例 #2
0
        // Token: 0x06000987 RID: 2439 RVA: 0x00029714 File Offset: 0x00027914
        public void SubmitCmd(NetworkUser sender, string cmd, bool recordSubmit = false)
        {
            if (recordSubmit)
            {
                Console.Log log = new Console.Log
                {
                    message    = string.Format(CultureInfo.InvariantCulture, "<color=#C0C0C0>] {0}</color>", cmd),
                    stackTrace = "",
                    logType    = LogType.Log
                };
                Console.logs.Add(log);
                if (Console.onLogReceived != null)
                {
                    Console.onLogReceived(log);
                }
                Console.userCmdHistory.Add(cmd);
            }
            Queue <string> tokens = new Console.Lexer(cmd).GetTokens();
            List <string>  list   = new List <string>();
            bool           flag   = false;

            while (tokens.Count != 0)
            {
                string text = tokens.Dequeue();
                if (text == ";")
                {
                    flag = false;
                    if (list.Count > 0)
                    {
                        string concommandName = list[0].ToLower(CultureInfo.InvariantCulture);
                        list.RemoveAt(0);
                        this.RunCmd(sender, concommandName, list);
                        list.Clear();
                    }
                }
                else
                {
                    if (flag)
                    {
                        text = this.GetVstrValue(sender, text);
                        flag = false;
                    }
                    if (text == "vstr")
                    {
                        flag = true;
                    }
                    else
                    {
                        list.Add(text);
                    }
                }
            }
        }