mirror of
https://github.com/fishyboteso/fishyboteso.git
synced 2024-08-30 18:32:13 +00:00
Merge branch 'master' into feature/mp-hotkey
This commit is contained in:
commit
e5e45bb006
@ -12,6 +12,8 @@ from fishy import gui, helper, web
|
|||||||
from fishy.constants import chalutier, lam2
|
from fishy.constants import chalutier, lam2
|
||||||
from fishy.engine.common.event_handler import EngineEventHandler
|
from fishy.engine.common.event_handler import EngineEventHandler
|
||||||
from fishy.gui import GUI, splash, update_dialog
|
from fishy.gui import GUI, splash, update_dialog
|
||||||
|
from fishy.helper import hotkey
|
||||||
|
from fishy.helper.active_poll import active
|
||||||
from fishy.helper.config import config
|
from fishy.helper.config import config
|
||||||
from fishy.helper.hotkey.hotkey_process import hotkey
|
from fishy.helper.hotkey.hotkey_process import hotkey
|
||||||
|
|
||||||
@ -67,6 +69,7 @@ def initialize(window_to_hide):
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
active.init()
|
||||||
config.init()
|
config.init()
|
||||||
splash.start()
|
splash.start()
|
||||||
hotkey.init()
|
hotkey.init()
|
||||||
@ -90,10 +93,12 @@ def main():
|
|||||||
initialize(window_to_hide)
|
initialize(window_to_hide)
|
||||||
|
|
||||||
gui_window.start()
|
gui_window.start()
|
||||||
|
active.start()
|
||||||
|
|
||||||
bot.start_event_handler()
|
bot.start_event_handler()
|
||||||
config.stop()
|
config.stop()
|
||||||
hotkey.stop()
|
hotkey.stop()
|
||||||
|
active.stop()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
23
fishy/helper/active_poll.py
Normal file
23
fishy/helper/active_poll.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
from event_scheduler import EventScheduler
|
||||||
|
from fishy.web import web
|
||||||
|
|
||||||
|
|
||||||
|
# noinspection PyPep8Naming
|
||||||
|
class active:
|
||||||
|
_scheduler: EventScheduler = None
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def init():
|
||||||
|
if active._scheduler:
|
||||||
|
return
|
||||||
|
|
||||||
|
active._scheduler = EventScheduler()
|
||||||
|
active._scheduler.start()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def start():
|
||||||
|
active._scheduler.enter_recurring(60, 1, web.ping)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def stop():
|
||||||
|
active._scheduler.stop(hard_stop=True)
|
@ -15,6 +15,7 @@ session = domain + "/api/session"
|
|||||||
terms = domain + "/terms.html"
|
terms = domain + "/terms.html"
|
||||||
discord = domain + "/api/discord"
|
discord = domain + "/api/discord"
|
||||||
beta = domain + "/api/beta"
|
beta = domain + "/api/beta"
|
||||||
|
ping = domain + "/api/ping"
|
||||||
|
|
||||||
|
|
||||||
def get_notification_page(uid):
|
def get_notification_page(uid):
|
||||||
|
@ -141,3 +141,9 @@ def has_beta():
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
return response.json()["beta"]
|
return response.json()["beta"]
|
||||||
|
|
||||||
|
|
||||||
|
@fallback(None)
|
||||||
|
def ping():
|
||||||
|
body = {"uid": config.get("uid"), "apiversion": apiversion}
|
||||||
|
requests.post(urls.ping, params=body)
|
||||||
|
Loading…
Reference in New Issue
Block a user