-
Notifications
You must be signed in to change notification settings - Fork 708
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into silly_settings
- Loading branch information
Showing
52 changed files
with
398 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from flask import abort | ||
|
||
from Utils import restricted_loads | ||
from WebHostLib import cache | ||
from WebHostLib.models import GameDataPackage | ||
from . import api_endpoints | ||
|
||
|
||
@api_endpoints.route('/datapackage') | ||
@cache.cached() | ||
def get_datapackage(): | ||
from worlds import network_data_package | ||
return network_data_package | ||
|
||
|
||
@api_endpoints.route('/datapackage/<string:checksum>') | ||
@cache.memoize(timeout=3600) | ||
def get_datapackage_by_checksum(checksum: str): | ||
package = GameDataPackage.get(checksum=checksum) | ||
if package: | ||
return restricted_loads(package.data) | ||
return abort(404) | ||
|
||
|
||
@api_endpoints.route('/datapackage_checksum') | ||
@cache.cached() | ||
def get_datapackage_checksums(): | ||
from worlds import network_data_package | ||
version_package = { | ||
game: game_data["checksum"] for game, game_data in network_data_package["games"].items() | ||
} | ||
return version_package |
Oops, something went wrong.