mirror of
https://github.com/imayushsaini/Bombsquad-Ballistica-Modded-Server.git
synced 2025-10-20 00:00:39 +00:00
Update notification_manager.py
This commit is contained in:
parent
bc4849333d
commit
152a80811f
1 changed files with 3 additions and 2 deletions
|
|
@ -9,6 +9,7 @@ import ecdsa
|
|||
import os
|
||||
import _ba
|
||||
from datetime import datetime
|
||||
date_format = '%Y-%m-%d %H:%M:%S'
|
||||
vapidkeys = {}
|
||||
subscriptions = {}
|
||||
subscribed_players = {}
|
||||
|
|
@ -91,10 +92,10 @@ def subscribe(sub, account_id, name):
|
|||
def player_joined(pb_id):
|
||||
now = datetime.now()
|
||||
if pb_id in subscribed_players:
|
||||
if "last_notification" in subscribed_players[pb_id] and (now - subscribed_players[pb_id]["last_notification"]).seconds < 15 * 60:
|
||||
if "last_notification" in subscribed_players[pb_id] and (now - datetime.strptime(subscribed_players[pb_id]["last_notification"], date_format)).seconds < 15 * 60:
|
||||
pass
|
||||
else:
|
||||
subscribed_players[pb_id]["last_notification"] = now
|
||||
subscribed_players[pb_id]["last_notification"] = now.strftime(date_format)
|
||||
subscribes = subscribed_players[pb_id]["subscribers"]
|
||||
for subscriber_id in subscribes:
|
||||
sub = subscriptions[subscriber_id]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue