From 4adf3d80a186b509dff648688f983b8dd765a9ec Mon Sep 17 00:00:00 2001 From: flashwave Date: Thu, 29 Feb 2024 21:55:29 +0000 Subject: [PATCH] Adjusted signal strength drops. --- src/mami.js/main.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mami.js/main.js b/src/mami.js/main.js index 5ec1ef5..5d66d60 100644 --- a/src/mami.js/main.js +++ b/src/mami.js/main.js @@ -416,7 +416,9 @@ window.Umi = { UI: {}, Protocol: { SockChat: { Protocol: {} } } }; }, 'Clear Logs'); const pingIndicator = new MamiPingIndicator; - const pingToggle = Umi.UI.Toggles.Add('ping', undefined, 'Ready!'); + const pingToggle = Umi.UI.Toggles.Add('ping', { + click: () => alert(pingToggle.title), + }, 'Ready!'); pingToggle.appendChild(pingIndicator.getElement()); console.log(pingIndicator); @@ -614,16 +616,15 @@ window.Umi = { UI: {}, Protocol: { SockChat: { Protocol: {} } } }; Umi.Server.watch('ping:long', long => { if(dumpEvents) console.log('ping:long', long); - pingToggle.title = 'Taking longer than 2 seconds'; + pingToggle.title = '+2000ms'; pingIndicator.setStrength(0); }); Umi.Server.watch('ping:recv', recv => { if(dumpEvents) console.log('ping:recv', recv); let strength = 3; - if(recv.diff > 45) --strength; - if(recv.diff > 30) --strength; - if(recv.diff > 15) --strength; + if(recv.diff > 1000) --strength; + if(recv.diff > 250) --strength; pingToggle.title = `${recv.diff.toLocaleString()}ms`; pingIndicator.setStrength(strength);