mirror of
https://github.com/FAUSheppy/tmnf-replay-server.git
synced 2025-12-05 22:51: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"]
|
||||
|
||||
if not url:
|
||||
return
|
||||
|
||||
# send to event dispatcher #
|
||||
message = "Trackmania: Record broken on {}".format(mapname)
|
||||
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)
|
||||
|
||||
def create_app():
|
||||
|
||||
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__":
|
||||
|
||||
parser = argparse.ArgumentParser(description='TM Replay Server',
|
||||
|
||||
Reference in New Issue
Block a user