aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-05-21 19:06:34 +0300
committerRblSb <msrblsb@gmail.com>2020-05-21 19:08:53 +0300
commit5d958025e72956e77d3dfc0aa659e9b04f394201 (patch)
treebef65ab8d9f291b832372e3f56d632e6ee6398e3 /src
parentf64eab6a6170edeee6f3251bf89c8422e91df3b7 (diff)
Disable client debug messages
now in server --verbose run
Diffstat (limited to 'src')
-rw-r--r--src/Types.hx1
-rw-r--r--src/client/Main.hx8
-rw-r--r--src/server/Main.hx1
3 files changed, 7 insertions, 3 deletions
diff --git a/src/Types.hx b/src/Types.hx
index c791733..d16e58e 100644
--- a/src/Types.hx
+++ b/src/Types.hx
@@ -28,6 +28,7 @@ typedef Config = {
},
emotes:Array<Emote>,
filters:Array<Filter>,
+ ?isVerbose:Bool,
?salt:String
};
diff --git a/src/client/Main.hx b/src/client/Main.hx
index 76e1009..846acf6 100644
--- a/src/client/Main.hx
+++ b/src/client/Main.hx
@@ -319,9 +319,11 @@ class Main {
function onMessage(e):Void {
final data:WsEvent = Json.parse(e.data);
- final t:String = cast data.type;
- final t = t.charAt(0).toLowerCase() + t.substr(1);
- trace('Event: ${data.type}', untyped data[t]);
+ if (config != null && config.isVerbose) {
+ final t:String = cast data.type;
+ final t = t.charAt(0).toLowerCase() + t.substr(1);
+ trace('Event: ${data.type}', Reflect.field(data, t));
+ }
switch (data.type) {
case Connected:
onConnected(data);
diff --git a/src/server/Main.hx b/src/server/Main.hx
index d5e8be6..3c85c3e 100644
--- a/src/server/Main.hx
+++ b/src/server/Main.hx
@@ -73,6 +73,7 @@ class Main {
loadState();
config = loadUserConfig();
userList = loadUsers();
+ config.isVerbose = verbose;
config.salt = generateConfigSalt();
localIp = Utils.getLocalIp();
globalIp = localIp;
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage