1
0

refactor: modernize code, improve performance, and clean up various components.

This commit is contained in:
2026-03-01 21:05:35 +01:00
parent 15f9647f8a
commit a6c7df0a71
37 changed files with 240 additions and 627 deletions

View File

@@ -1,6 +1,4 @@
using System;
using System.Net.Sockets;
using System.Threading.Tasks;
using Spectre.Console;
using Toak.Core;
@@ -24,7 +22,7 @@ public static class StatusCommand
await socket.SendAsync(msg, SocketFlags.None);
var responseBuffer = new byte[4096];
int received = await socket.ReceiveAsync(responseBuffer, SocketFlags.None);
var received = await socket.ReceiveAsync(responseBuffer, SocketFlags.None);
if (received > 0)
{
var text = System.Text.Encoding.UTF8.GetString(responseBuffer, 0, received);
@@ -33,10 +31,7 @@ public static class StatusCommand
}
catch (SocketException)
{
if (json)
Console.WriteLine("{\"state\": \"Offline\"}");
else
Console.WriteLine("Offline");
Console.WriteLine(json ? "{\"state\": \"Offline\"}" : "Offline");
}
catch (Exception ex)
{