aboutsummaryrefslogtreecommitdiffstats
path: root/src/server/Main.hx
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/Main.hx')
-rw-r--r--src/server/Main.hx8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/server/Main.hx b/src/server/Main.hx
index 8164922..3cde049 100644
--- a/src/server/Main.hx
+++ b/src/server/Main.hx
@@ -58,7 +58,9 @@ class Main {
public final clients:Array<Client> = [];
final freeIds:Array<Int> = [];
+ #if !display
final wsEventParser = new JsonParser<WsEvent>();
+ #end
final consoleInput:ConsoleInput;
final cache:Cache;
final cacheDir:String;
@@ -960,6 +962,7 @@ class Main {
serverMessage(client, "Free space: "
+ (cache.getFreeSpace() / 1024).toFixed()
+ "KiB");
+ serverMessage(client, "Memory usage: " + js.Node.process.memoryUsage());
send(client, {
type: Dump,
dump: {
@@ -1006,6 +1009,11 @@ class Main {
client.ws.send(jsonStringify(data), null);
}
+ public function sendByName(clientName:String, data:WsEvent):Void {
+ final client = clients.getByName(clientName) ?? return;
+ client.ws.send(jsonStringify(data), null);
+ }
+
public function broadcast(data:WsEvent):Void {
final json = jsonStringify(data);
for (client in clients)
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage