File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 24
24
# List of banned IP addresses.
25
25
BANLIST = []
26
26
27
+ # Creates server entries if a server sends an 'update' and there is no entry yet
28
+ # This should only be used to populate the server list after list.json was deleted.
29
+ ALLOW_UPDATE_WITHOUT_OLD = False
Original file line number Diff line number Diff line change @@ -83,7 +83,14 @@ def announce():
83
83
return "Invalid JSON data." , 400
84
84
85
85
if server ["action" ] != "start" and not old :
86
- return "Server to update not found." , 500
86
+ if app .config ["ALLOW_UPDATE_WITHOUT_OLD" ]:
87
+ old = server
88
+ old ["start" ] = time .time ()
89
+ old ["clients_top" ] = 0
90
+ old ["updates" ] = 0
91
+ old ["total_clients" ] = 0
92
+ else :
93
+ return "Server to update not found." , 500
87
94
88
95
server ["update_time" ] = time .time ()
89
96
@@ -247,6 +254,7 @@ def saveList():
247
254
"rollback" : (False , "bool" ),
248
255
"can_see_far_names" : (False , "bool" ),
249
256
}
257
+
250
258
def checkRequest (server ):
251
259
for name , data in fields .items ():
252
260
if not name in server :
You can’t perform that action at this time.
0 commit comments