Fixed Game News and Added some testing things

This commit is contained in:
ZKWolf 2024-02-04 19:17:23 +01:00
parent da05c5bb97
commit b2a50ed097
2 changed files with 73 additions and 6 deletions

View File

@ -12,6 +12,9 @@ def gamenews():
userid = session_manager.get_user_id(session_cookie)
# /gamenews/messages?sortDesc=true&gameVersion=0&platform=PC&language=EN&messageType=InGameNews&faction=Runner&playerLevel=1
# The game saves watched game news here: C:\Users\User\AppData\Local\TheExit\Saved\Config\WindowsNoEditor\GameUserSettings.ini
# In this Format: GameNewsViews=(("1", 4),("2", 1),("3", 1),("4", 1))
# The first number is the ID of the news, the second number is the amount of times the news window was opened
try:
sort_desc = sanitize_input(request.args.get('sortDesc'))
gameVersion = sanitize_input(request.args.get('gameVersion'))
@ -263,6 +266,8 @@ def consent_eula():
return jsonify({"message": "Not Authenticated"}), 401
is_given = mongo.get_data_with_list(login=userid, login_steam=False,
items={"eula"})
if is_given is None:
return jsonify({"isGiven": False})
if is_given["eula"]:
return jsonify({
"ConsentId": "eula2",

View File

@ -1,17 +1,17 @@
{
"data":[
"Messages":[
{
"Id":"1",
"MessageType":"Daily",
"IsOneTimeGameNews":false,
"MessageType":"InGameNews",
"IsOneTimeGameNews":true,
"ShouldQuitTheGame":false,
"OnlyForPlayersThatCompletedAtLeastOneMatch":false,
"RedirectMode":"None",
"EmbeddedBackgroundImage":"game/UI/ImageAssets/NewsAssets/GeneralAnnouncement_Large",
"EmbeddedInGameNewsBackgroundImage":"game/UI/ImageAssets/NewsAssets/ClosedAlphaWelcomeBanner",
"EmbeddedInGameNewsThumbnailImage":"game/UI/ImageAssets/NewsAssets/CrossPromo",
"FromDate":1655511433,
"ToDate":1718669833,
"FromDate": "2023.12.25-12.12.12",
"ToDate": "2025.12.25-12.12.12",
"Translations":[
{
"Language":"EN",
@ -30,6 +30,68 @@
"Body":"Test Es"
}
]
}
},
{
"Id":"3",
"MessageType":"PopUpNews",
"IsOneTimeGameNews":true,
"ShouldQuitTheGame":false,
"OnlyForPlayersThatCompletedAtLeastOneMatch":false,
"RedirectMode":"None",
"EmbeddedBackgroundImage":"RunnersReadyBanner",
"EmbeddedInGameNewsBackgroundImage":"CrossPromo_Large",
"EmbeddedInGameNewsThumbnailImage":"CrossPromo_Small",
"FromDate": "2023.12.25-12.12.12",
"ToDate": "2025.12.25-12.12.12",
"Translations":[
{
"Language":"EN",
"Body":"Test3 EN"
},
{
"Language":"FR",
"Body":"Test3 Fr"
},
{
"Language":"IT",
"Body":"Test3 IT"
},
{
"Language":"ES",
"Body":"Test3 Es"
}
]
},
{
"Id":"4",
"MessageType":"PopUpNews",
"IsOneTimeGameNews":false,
"ShouldQuitTheGame":false,
"OnlyForPlayersThatCompletedAtLeastOneMatch":false,
"RedirectMode":"None",
"EmbeddedBackgroundImage":"TydeTyme_Large",
"EmbeddedInGameNewsBackgroundImage":"TydeTyme_Large",
"EmbeddedInGameNewsThumbnailImage":"TydeTyme_Large",
"FromDate": "2023.12.25-12.12.12",
"ToDate": "2025.12.25-12.12.12",
"Translations":[
{
"Language":"EN",
"Body":"Test4 EN"
},
{
"Language":"FR",
"Body":"Test4 Fr"
},
{
"Language":"IT",
"Body":"Test4 IT"
},
{
"Language":"ES",
"Body":"Test4 Es"
}
]
}
]
}