mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-03-18 21:38:13 -07:00
Compare commits
3 Commits
0.5.0
...
webhost_st
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d4ffeca0a | ||
|
|
c61649cef3 | ||
|
|
7ae102741a |
@@ -38,6 +38,7 @@ app.config["JOB_THRESHOLD"] = 1
|
|||||||
# after what time in seconds should generation be aborted, freeing the queue slot. Can be set to None to disable.
|
# after what time in seconds should generation be aborted, freeing the queue slot. Can be set to None to disable.
|
||||||
app.config["JOB_TIME"] = 600
|
app.config["JOB_TIME"] = 600
|
||||||
app.config['SESSION_PERMANENT'] = True
|
app.config['SESSION_PERMANENT'] = True
|
||||||
|
app.config["CHECK_DATA_PACKAGE_CHECKSUM_ON_STARTUP"] = False
|
||||||
|
|
||||||
# waitress uses one thread for I/O, these are for processing of views that then get sent
|
# waitress uses one thread for I/O, these are for processing of views that then get sent
|
||||||
# archipelago.gg uses gunicorn + nginx; ignoring this option
|
# archipelago.gg uses gunicorn + nginx; ignoring this option
|
||||||
|
|||||||
@@ -73,7 +73,22 @@ def autohost(config: dict):
|
|||||||
# Command gets deleted by ponyorm Cascade Delete, as Room is Required
|
# Command gets deleted by ponyorm Cascade Delete, as Room is Required
|
||||||
if rooms or seeds or slots:
|
if rooms or seeds or slots:
|
||||||
logging.info(f"{rooms} Rooms, {seeds} Seeds and {slots} Slots have been deleted.")
|
logging.info(f"{rooms} Rooms, {seeds} Seeds and {slots} Slots have been deleted.")
|
||||||
|
if config["CHECK_DATA_PACKAGE_CHECKSUM_ON_STARTUP"]:
|
||||||
|
logging.info("Checking for Data Package Checksum integrity")
|
||||||
|
from worlds.AutoWorld import data_package_checksum
|
||||||
|
with db_session:
|
||||||
|
for data_package in GameDataPackage.select():
|
||||||
|
data = restricted_loads(data_package.data)
|
||||||
|
if data["checksum"] != data_package.checksum:
|
||||||
|
logging.warning(f"Deleting mismatching checksum datapackage {data_package.checksum}.")
|
||||||
|
data_package.delete()
|
||||||
|
continue
|
||||||
|
del data["checksum"]
|
||||||
|
if data_package.checksum != data_package_checksum(data):
|
||||||
|
logging.warning(f"Deleting mismatching checksum datapackage {data_package.checksum}.")
|
||||||
|
data_package.delete()
|
||||||
run_guardian()
|
run_guardian()
|
||||||
|
logging.info("Starting Autohost.")
|
||||||
while 1:
|
while 1:
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
with db_session:
|
with db_session:
|
||||||
@@ -202,6 +217,6 @@ def run_guardian():
|
|||||||
guardian = threading.Thread(name="Guardian", target=guard)
|
guardian = threading.Thread(name="Guardian", target=guard)
|
||||||
|
|
||||||
|
|
||||||
from .models import Room, Generation, STATE_QUEUED, STATE_STARTED, STATE_ERROR, db, Seed, Slot
|
from .models import Room, Generation, STATE_QUEUED, STATE_STARTED, STATE_ERROR, db, Seed, Slot, GameDataPackage
|
||||||
from .customserver import run_server_process, get_static_server_data
|
from .customserver import run_server_process, get_static_server_data
|
||||||
from .generate import gen_game
|
from .generate import gen_game
|
||||||
|
|||||||
@@ -48,6 +48,10 @@
|
|||||||
# TODO
|
# TODO
|
||||||
#JSON_AS_ASCII: false
|
#JSON_AS_ASCII: false
|
||||||
|
|
||||||
|
# Performs a check on the database during startup for any data packages with mismatched checksums and clears
|
||||||
|
# them from the database automatically.
|
||||||
|
#CHECK_DATA_PACKAGE_CHECKSUM_ON_STARTUP: false
|
||||||
|
|
||||||
# Host Address. This is the address encoded into the patch that will be used for client auto-connect.
|
# Host Address. This is the address encoded into the patch that will be used for client auto-connect.
|
||||||
#HOST_ADDRESS: archipelago.gg
|
#HOST_ADDRESS: archipelago.gg
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user