aboutsummaryrefslogtreecommitdiffstats
path: root/src/Client.hx
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2021-08-10 03:22:27 +0300
committerRblSb <msrblsb@gmail.com>2021-08-10 07:56:57 +0300
commitf972d4b7b1c6a69ab20cd2aee5a43df702796075 (patch)
tree608f8031ef7e0885143eaf8670275171112c4e9a /src/Client.hx
parent96e10fe71d6428eed4bb2f120bc4b3a2801ff4be (diff)
Ban/unban commands
/ban Name 3d10h20m59s /ban Name 2h30m /unban Name /removeBan Name see #26
Diffstat (limited to 'src/Client.hx')
-rw-r--r--src/Client.hx12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Client.hx b/src/Client.hx
index 254e294..ae35ef4 100644
--- a/src/Client.hx
+++ b/src/Client.hx
@@ -7,6 +7,7 @@ import js.npm.ws.WebSocket;
import haxe.EnumFlags;
enum ClientGroup {
+ Banned;
User;
Leader;
Admin;
@@ -20,12 +21,13 @@ typedef ClientData = {
class Client {
#if nodejs
public final ws:WebSocket;
- public final id:Int;
public final req:IncomingMessage;
+ public final id:Int;
public var isAlive = true;
#end
public var name:String;
public var group:EnumFlags<ClientGroup>;
+ public var isBanned(get, set):Bool;
public var isUser(get, set):Bool;
public var isLeader(get, set):Bool;
public var isAdmin(get, set):Bool;
@@ -45,6 +47,14 @@ class Client {
}
#end
+ inline function get_isBanned():Bool {
+ return group.has(Banned);
+ }
+
+ inline function set_isBanned(flag:Bool):Bool {
+ return setGroupFlag(Banned, flag);
+ }
+
inline function get_isUser():Bool {
return group.has(User);
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage