From 0ab6ed38681933a19e392a683566f812a650ce99 Mon Sep 17 00:00:00 2001 From: downthecrop Date: Fri, 18 Oct 2024 19:41:45 -0700 Subject: [PATCH] track login state withint logintimer plugin --- plugin-playground/src/main/kotlin/LoginTimer/plugin.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugin-playground/src/main/kotlin/LoginTimer/plugin.kt b/plugin-playground/src/main/kotlin/LoginTimer/plugin.kt index 5cd6467..1b8f60b 100644 --- a/plugin-playground/src/main/kotlin/LoginTimer/plugin.kt +++ b/plugin-playground/src/main/kotlin/LoginTimer/plugin.kt @@ -25,6 +25,7 @@ class plugin : Plugin() { private var timeMode = TIME_MODE_INITIALIZATION private var initTime: Long = 0 + private var logoutFlag = true private var displayMessageCounter = 0 private var component: Component? = null @@ -40,7 +41,13 @@ class plugin : Plugin() { } override fun OnLogin() { - initTime = System.currentTimeMillis() + if(logoutFlag) + initTime = System.currentTimeMillis() + logoutFlag = false + } + + override fun OnLogout() { + logoutFlag = true } override fun Draw(timeDelta: Long) {