aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-07-29 18:09:20 +0300
committerRblSb <msrblsb@gmail.com>2020-07-30 19:04:21 +0300
commit7df8a33c7b1c6cc7d18bde2586a3224b02686a95 (patch)
treea5b22abda535d9a4ae799f1a76f4f3d3103eb4e3 /src
parent328c05713f968ccce7a63c934dce873dc7967d6a (diff)
Exit messages
Diffstat (limited to 'src')
-rw-r--r--src/client/Main.hx2
-rw-r--r--src/server/Main.hx11
2 files changed, 9 insertions, 4 deletions
diff --git a/src/client/Main.hx b/src/client/Main.hx
index 31bd580..73f733c 100644
--- a/src/client/Main.hx
+++ b/src/client/Main.hx
@@ -224,7 +224,7 @@ class Main {
var first:Null<T> = null;
if (player.isListEmpty()) first = items.shift();
items.reverse();
- if (player.isListEmpty()) items.unshift(first);
+ if (first != null) items.unshift(first);
}
function addVideoArray(links:Array<String>, atEnd:Bool, isTemp:Bool):Void {
diff --git a/src/server/Main.hx b/src/server/Main.hx
index 85006c7..8a5f381 100644
--- a/src/server/Main.hx
+++ b/src/server/Main.hx
@@ -110,9 +110,6 @@ class Main {
continue;
}
client.ws.terminate();
- onMessage(client, {
- type: Disconnected
- }, true);
}
};
}
@@ -364,6 +361,14 @@ class Main {
if (waitVideoStart != null) waitVideoStart.stop();
videoTimer.pause();
}
+ Timer.delay(() -> {
+ if (clients.exists(i -> i.name == client.name)) return;
+ broadcast({
+ type: ServerMessage, serverMessage: {
+ textId: '${client.name} has left'
+ }
+ });
+ }, 5000);
case UpdateClients:
sendClientList();
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage