public TerminalLoggerProcessor(TerminalLoggerOptions options)
        {
            Options = options;
            _queue  = new(options.LogQueueSize);
            _thread = TerminalUtility.StartThread("Terminal Log Processor", () =>
            {
                try
                {
                    foreach (var msg in _queue.GetConsumingEnumerable())
                    {
                        Write(msg);
                    }
                }
                catch (Exception)
                {
                    // The writer method has failed somehow. Ensure that
                    // subsequent writes at least happen in Enqueue.

                    try
                    {
                        _queue.CompleteAdding();
                    }
                    catch (ObjectDisposedException)
                    {
                    }
                }
            });
        }
Ejemplo n.º 2
0
 public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
 {
     //Terminal.AddToEntity(dstManager, entity, Size.x, Size.y, TileSize.x, TileSize.y);
     TerminalUtility.AddComponents(dstManager, entity)
     .WithTileSize(TileSize)
     .WithSize(Size)
     .WithPosition(transform.position);
 }
Ejemplo n.º 3
0
 public static void requestBattlEyeLogs()
 {
     TerminalUtility.printCommandPass("Sent BattlEye logs request");
     if (Player.player == null)
     {
         return;
     }
     Player.player.channel.send("askRequestBattlEyeLogs", ESteamCall.SERVER, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[0]);
 }
Ejemplo n.º 4
0
 private void Start()
 {
     TerminalUtility.MakeTerminal()
     .WithSize(32, 3)
     .WithPosition(transform.position)
     .WithAlignment(AlignmentX, AlignmentY)
     .WithRenderMeshRenderer()
     .WithBorder()
     .WithText("Left click to build terminals", 1, 1);
 }
Ejemplo n.º 5
0
        // Token: 0x0600131F RID: 4895 RVA: 0x00079DFC File Offset: 0x000781FC
        private void execute()
        {
            string text = this.commandField.text;

            if (string.IsNullOrEmpty(text))
            {
                return;
            }
            TerminalUtility.execute(text, this.arguments, this.commands);
            this.commandField.text = string.Empty;
            this.commandField.Select();
            this.commandField.ActivateInputField();
        }
Ejemplo n.º 6
0
 private void Update()
 {
     if (Input.GetMouseButtonDown(0))
     {
         var pos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
         pos.z = 0;
         TerminalUtility.MakeTerminal()
         .WithSize(Size)
         .WithPosition(pos)
         .WithAlignment(AlignmentX, AlignmentY)
         .WithNoiseOnce()
         .WithRenderMeshRenderer()
         .WithBorder();
     }
 }
Ejemplo n.º 7
0
 // Token: 0x0600131E RID: 4894 RVA: 0x00079A10 File Offset: 0x00077E10
 private void onCommandFieldChanged(string value)
 {
     this.arguments = TerminalUtility.splitArguments(value);
     if (this.arguments.Count == 0)
     {
         this.commands.Clear();
     }
     else if (this.arguments.Count == 1)
     {
         this.commands = TerminalUtility.filterCommands(this.arguments[0]);
     }
     for (int i = 0; i < this.hints.Count; i++)
     {
         TerminalHint terminalHint = this.hints[i];
         terminalHint.isVisible = (i < this.commands.Count);
         if (terminalHint.isVisible)
         {
             if (this.commands.Count == 1 && this.arguments.Count > 1 && this.arguments.Count <= this.commands[i].parameters.Length + 1)
             {
                 StringBuilder instance = StringBuilderUtility.instance;
                 instance.Append(this.commands[i].parameters[this.arguments.Count - 2].name);
                 instance.Append(" - ");
                 instance.Append(this.commands[i].parameters[this.arguments.Count - 2].type.Name.ToLower());
                 instance.Append("\n");
                 instance.Append("<color=#afafaf>");
                 instance.Append(this.commands[i].parameters[this.arguments.Count - 2].description);
                 if (this.commands[i].parameters[this.arguments.Count - 2].defaultValue != null)
                 {
                     string value2 = this.commands[i].parameters[this.arguments.Count - 2].defaultValue.ToString().ToLower();
                     if (!string.IsNullOrEmpty(value2))
                     {
                         instance.Append(" [default: ");
                         instance.Append(value2);
                         instance.Append("]");
                     }
                 }
                 if (this.commands[i].currentValue != null)
                 {
                     string value3 = this.commands[i].currentValue.Invoke(null, null).ToString().ToLower();
                     if (!string.IsNullOrEmpty(value3))
                     {
                         instance.Append(" [current: ");
                         instance.Append(value3);
                         instance.Append("]");
                     }
                 }
                 instance.Append("</color>");
                 terminalHint.text = instance.ToString();
             }
             else
             {
                 StringBuilder instance2 = StringBuilderUtility.instance;
                 instance2.Append(this.commands[i].method.command);
                 instance2.Insert(Mathf.Clamp(this.arguments[0].Length, 0, this.commands[i].method.command.Length), "</color>");
                 instance2.Insert(0, ">");
                 instance2.Insert(0, Terminal.highlightColor);
                 instance2.Insert(0, "<color=");
                 for (int j = 0; j < this.commands[i].parameters.Length; j++)
                 {
                     instance2.Append(" - ");
                     instance2.Append(this.commands[i].parameters[j].type.Name.ToLower());
                 }
                 instance2.Append("\n");
                 instance2.Append("<color=#afafaf>");
                 instance2.Append(this.commands[i].method.description);
                 instance2.Append("</color>");
                 terminalHint.text = instance2.ToString();
             }
         }
     }
 }