mirror of
https://github.com/FAUSheppy/tmnf-replay-server.git
synced 2025-12-06 07:01:37 +01:00
wip:
This commit is contained in:
@@ -6,6 +6,9 @@ def send_notification(app, target_user, mapname, old_replay, new_replay):
|
|||||||
|
|
||||||
url = app.config["DISPATCH_SERVER"]
|
url = app.config["DISPATCH_SERVER"]
|
||||||
|
|
||||||
|
if not url:
|
||||||
|
return
|
||||||
|
|
||||||
# send to event dispatcher #
|
# send to event dispatcher #
|
||||||
message = "Trackmania: Record broken on {}".format(mapname)
|
message = "Trackmania: Record broken on {}".format(mapname)
|
||||||
message += "Old time: {}".format(old_replay.get_human_readable_time())
|
message += "Old time: {}".format(old_replay.get_human_readable_time())
|
||||||
|
|||||||
@@ -438,8 +438,13 @@ def check_replay_trigger(replay):
|
|||||||
notifications.send_notification(app, settings.user, map_obj.map_uid, second, replay)
|
notifications.send_notification(app, settings.user, map_obj.map_uid, second, replay)
|
||||||
|
|
||||||
def create_app():
|
def create_app():
|
||||||
|
|
||||||
db.create_all()
|
db.create_all()
|
||||||
|
|
||||||
|
app.config["DISPATCH_SERVER"] = os.environ.get("DISPATCH_SERVER")
|
||||||
|
if app.config["DISPATCH_SERVER"]:
|
||||||
|
app.config["DISPATCH_AUTH"] = (os.environ["DISPATCH_AUTH_USER"], os.environ["DISPATCH_AUTH_PASSWORD"])
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='TM Replay Server',
|
parser = argparse.ArgumentParser(description='TM Replay Server',
|
||||||
|
|||||||
Reference in New Issue
Block a user