Starts creating SQL, starts parsing client JSONs

This commit is contained in:
Guillaume Tâche
2025-04-30 18:18:21 +02:00
parent a8e7a62b0c
commit 38ada274e3
278 changed files with 811699 additions and 399 deletions
File diff suppressed because it is too large Load Diff
+411
View File
@@ -0,0 +1,411 @@
{
"AudioBgMusicTriggerList": [
{
"Trigger": "InitializationState",
"Data": {
"PrefabPath": "AppBase/Audio/Music/Prefabs/MainMenuMusic",
"Playlist": "MainMenuMusic",
"StartingClip": "ESL_Oblivion_Main_Menu_Music",
"Ambient": "IoM_Backdrop_Amb_Lp",
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"Trigger": "MainMenuState",
"Data": {
"PrefabPath": "AppBase/Audio/Music/Prefabs/MainMenuMusic",
"Playlist": "MainMenuMusic",
"StartingClip": "ESL_Oblivion_Main_Menu_Music",
"Ambient": "Obliv_MM_BGA_Lp",
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"Trigger": "PlayState",
"Data": {
"PrefabPath": "",
"Playlist": "",
"StartingClip": "",
"Ambient": null,
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"Trigger": "StoryState",
"Data": {
"PrefabPath": "AppBase/Audio/Music/Prefabs/StoryModeMusic",
"Playlist": "StoryModeMusic",
"StartingClip": "Cardinal_Campaign_1_Gameplay_Ambience",
"Ambient": "constellation_ambience_1",
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"Trigger": "StoreState",
"Data": {
"PrefabPath": "",
"Playlist": "",
"StartingClip": "",
"Ambient": "constellation_ambience_1",
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"Trigger": "SoloArenaState",
"Data": {
"PrefabPath": "AppBase/Audio/Music/Prefabs/bgm_pregame",
"Playlist": "bgm_pregame",
"StartingClip": "Cardinal_General_Pregame_Fanfare",
"Ambient": "arena_crowd_ambience_1",
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"Trigger": "VersusArenaState",
"Data": {
"PrefabPath": "",
"Playlist": "",
"StartingClip": "",
"Ambient": "constellation_ambience_1",
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"Trigger": "DeckEditorState",
"Data": {
"PrefabPath": "AppBase/Audio/Music/Prefabs/DeckBuilderMusic",
"Playlist": "DeckBuilderMusic",
"StartingClip": "Cardinal_General_Deckbuilder_Ambience",
"Ambient": "constellation_ambience_1",
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"Trigger": "PackOpenState",
"Data": {
"PrefabPath": "",
"Playlist": "",
"StartingClip": "",
"Ambient": "constellation_ambience_1",
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"Trigger": "PlayerProfileState",
"Data": {
"PrefabPath": "",
"Playlist": "",
"StartingClip": "",
"Ambient": "constellation_ambience_1",
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"Trigger": "AvatarPickerState",
"Data": {
"PrefabPath": "",
"Playlist": "",
"StartingClip": "",
"Ambient": "constellation_ambience_1",
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"Trigger": "RewardsState",
"Data": {
"PrefabPath": "",
"Playlist": "",
"StartingClip": "",
"Ambient": null,
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"Trigger": "EndGameWin",
"Data": {
"PrefabPath": "AppBase/Audio/Music/Prefabs/bgm_match_end_Win",
"Playlist": "bgm_match_end_Win",
"StartingClip": "Cardinal_General_Gameplay_Fanfare_Win",
"Ambient": null,
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": false,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"Trigger": "EndGameLose",
"Data": {
"PrefabPath": "AppBase/Audio/Music/Prefabs/bgm_match_end_Lose",
"Playlist": "bgm_match_end_Lose",
"StartingClip": "Cardinal_General_Gameplay_Fanfare_Lose",
"Ambient": null,
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": false,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"Trigger": "LevelUp",
"Data": {
"PrefabPath": "AppBase/Audio/Music/Prefabs/bgm_match_end_Level_Up",
"Playlist": "bgm_match_end_Level_Up",
"StartingClip": "level_up_theme",
"Ambient": null,
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": false,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"Trigger": "SeasonsRolloverState",
"Data": {
"PrefabPath": "",
"Playlist": "",
"StartingClip": "",
"Ambient": null,
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"Trigger": "ExitState",
"Data": {
"PrefabPath": "",
"Playlist": "",
"StartingClip": "",
"Ambient": null,
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"Trigger": "MatchStartIntro",
"Data": {
"PrefabPath": "AppBase/Audio/Music/Prefabs/MatchStartMusic",
"Playlist": "MatchStartMusic",
"StartingClip": "TESL_MoE_Fanfare_final",
"Ambient": null,
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": false,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": false
}
},
{
"Trigger": "MatchOngoing",
"Data": {
"PrefabPath": "AppBase/Audio/Music/Prefabs/MatchAmbientMusic",
"Playlist": "MatchAmbientMusic",
"StartingClip": "TESL_MoE_Ambient_final",
"Ambient": null,
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"Trigger": "MatchHalfHealth",
"Data": {
"PrefabPath": "AppBase/Audio/Music/Prefabs/MatchBattleMusic",
"Playlist": "MatchBattleMusic",
"StartingClip": "The_Elder_Scrolls_Legends_Battle_01_v1",
"Ambient": null,
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"Trigger": "MatchStartBoss",
"Data": {
"PrefabPath": "AppBase/Audio/Music/Prefabs/BossBattleMusic",
"Playlist": "BossBattleMusic",
"StartingClip": "Cardinal_Boss_Gameplay_Fanfare_1",
"Ambient": null,
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"Trigger": "IntroOnboardingState",
"Data": {
"PrefabPath": "AppBase/Audio/Music/Prefabs/MatchAmbientMusic",
"Playlist": "MatchAmbientMusic",
"StartingClip": "MOR_Music_Ambient",
"Ambient": null,
"PlaylistVolume": 0.25,
"FadeInTime": 0.5,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
}
],
"AudioBgMusicPlaymatList": [
{
"PlaymatType": "Elsweyr",
"Data": {
"PrefabPath": "AppBase/Audio/Music/Prefabs/bgm_plymt_MoE",
"Playlist": "bgm_plymt_MoE",
"StartingClip": "TESL_MoE_Ambient_final",
"Ambient": "Plymt_Amb_Elsweyr_Lp",
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"PlaymatType": "AllianceWar",
"Data": {
"PrefabPath": "AppBase/Audio/Music/Prefabs/bgm_plymt_AW",
"Playlist": "bgm_plymt_AW",
"StartingClip": "The_Elder_Scrolls_Legends_Battle_01_v1",
"Ambient": "Plymt_Amb_AllianceWar_Lp",
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"PlaymatType": "IsleOfMadness",
"Data": {
"PrefabPath": "AppBase/Audio/Music/Prefabs/bgm_plymt_IoM",
"Playlist": "bgm_plymt_IoM",
"StartingClip": "MOR_Music_Maintheme",
"Ambient": "Plymt_Amb_IoM_LP_V2",
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"PlaymatType": "RealmsOfOblivion",
"Data": {
"PrefabPath": "AppBase/Audio/Music/Prefabs/bgm_plymt_JoB",
"Playlist": "bgm_plymt_JoB",
"StartingClip": "ESL_Oblivion_Ambient_Music_01",
"Ambient": "Oblivion_Playmat_Amb_Lp",
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
},
{
"PlaymatType": "Original",
"Data": {
"PrefabPath": "AppBase/Audio/Music/Prefabs/bgm_plymt_Original",
"Playlist": "bgm_plymt_Original",
"StartingClip": "SKY_Music_Maintheme",
"Ambient": "2D-Ambience-Main",
"PlaylistVolume": 0.25,
"FadeInTime": 0.25,
"FadeOutTime": 0.25,
"EnablePlaylistLooping": true,
"ChooseRandomStartClip": false,
"AutoAdvancePlaylist": true
}
}
]
}
File diff suppressed because it is too large Load Diff
+472
View File
@@ -0,0 +1,472 @@
{
"LaneTypeVisuals": [
{
"LaneType": "Default",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Field_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": "",
"PersistentFxAssetRight": "",
"GameHistorySmallImage": "",
"GameHistoryLargeImage": ""
},
{
"LaneType": "Stealth",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Stealth_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": "",
"PersistentFxAssetRight": "",
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Liquid_Courage",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_LiquidCourage_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": "",
"PersistentFxAssetRight": "",
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Armor",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Armor_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Masquerade_Ball",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_MasqueradeBall_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Docks",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Docks_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Water",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Water_Icon",
"PlayCardFxAsset": "Common000/FX/Board/LaneIconTriggerFx/FX_Board_Water_Lane_Play_Card",
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Sewer",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Sewer_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Jail",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Jail_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Mine_Depths",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_MineDepths_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Venom",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Venom_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Reanimation",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_reanimation_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Altar_Of_Silence",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_AltarOfSilence_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Torment",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Torment_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Eclipse",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Eclipse_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Heist",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Heist_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Conveyor",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Conveyor_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Incinerator",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Incinerator_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Smelting",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Smelting_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Mage_Tower",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_MageTower_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Surplus",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Surplus_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Plunder",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Plunder_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Renewal",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Renewal_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Armory",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Armory_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Siege",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Siege_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Killing_Field",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_KillingField_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Fountain",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Fountain_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Library",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Library_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Windy",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Windy_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Campfire",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Campfire_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Barracks",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Barracks_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "King_Of_The_Hill",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_KingOfTheHill_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Blitz",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Blitz_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Ballista_Tower",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_BallistaTower_Icon",
"PlayCardFxAsset": "Common000/FX/Board/LaneIconTriggerFx/FX_Board_Water_Lane_Play_Card",
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Hall_Of_Mirrors",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_HallOfMirrors_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Champions_Arena",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_ChampionsArena_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Temple",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Temple_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Lucky",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Lucky_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Fortifications",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Fortifications_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Warzone",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Warzone_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Graveyard",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Graveyard_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Inner_Fire",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_InnerFire_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Zoo",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Zoo_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Wispmothers_Blessing",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_WispmothersBlessing_Icon",
"PlayCardFxAsset": null,
"PersistentFxAssetLeft": null,
"PersistentFxAssetRight": null,
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Flanking",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Flanking_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": "",
"PersistentFxAssetRight": "",
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "City_Gates",
"AssetReference": "",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": "",
"PersistentFxAssetRight": "",
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "City_Gates_Stealth",
"AssetReference": "Common000/Materials/FX/Board/LaneIcons/FX_Board_Lane_Stealth_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": "",
"PersistentFxAssetRight": "",
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Dementia",
"AssetReference": "ContentPack001/Materials/FX/Board/LaneIcons/FX_Board_Lane_Dementia_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": "ContentPack001/Animations/MatchBoard/Lanes/DementiaLane/FX_Dementia_Lane_Persistent",
"PersistentFxAssetRight": "ContentPack001/Animations/MatchBoard/Lanes/DementiaLane/FX_Dementia_Lane_Persistent",
"GameHistorySmallImage": "ContentPack001/Textures/UI/Sprites/Dementia_Small",
"GameHistoryLargeImage": ""
},
{
"LaneType": "Madness",
"AssetReference": "ContentPack001/Materials/FX/Board/LaneIcons/FX_Board_Lane_Madness_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": "",
"PersistentFxAssetRight": "",
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Mania",
"AssetReference": "ContentPack001/Materials/FX/Board/LaneIcons/FX_Board_Lane_Mania_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": "ContentPack001/Animations/MatchBoard/Lanes/ManiaLane/FX_Mania_Lane_Persistent",
"PersistentFxAssetRight": "ContentPack001/Animations/MatchBoard/Lanes/ManiaLane/FX_Mania_Lane_Persistent",
"GameHistorySmallImage": "ContentPack001/Textures/UI/Sprites/Mania_Small",
"GameHistoryLargeImage": ""
},
{
"LaneType": "Monastery",
"AssetReference": "ContentPack001/Materials/FX/Board/LaneIcons/FX_Board_Lane_Monastery_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": "",
"PersistentFxAssetRight": "",
"GameHistorySmallImage": null,
"GameHistoryLargeImage": null
},
{
"LaneType": "Order",
"AssetReference": "ContentPack001/Materials/FX/Board/LaneIcons/FX_Board_Lane_Order_Icon",
"PlayCardFxAsset": "",
"PersistentFxAssetLeft": "",
"PersistentFxAssetRight": "",
"GameHistorySmallImage": "",
"GameHistoryLargeImage": ""
}
]
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+362
View File
@@ -0,0 +1,362 @@
[
{
"AssetHash": 1646985500,
"FXAction": "Damage",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "card_damage"
},
{
"AssetHash": -1035543756,
"FXAction": "Heal",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Avatar Heal"
},
{
"AssetHash": -521991121,
"FXAction": "Death",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "card_death"
},
{
"AssetHash": 934312447,
"FXAction": "Freeze",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "card_shackle_01"
},
{
"AssetHash": -2088350512,
"FXAction": "Buff",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "card_generic_buff"
},
{
"AssetHash": -714842059,
"FXAction": "Debuff",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "card_generic_debuff"
},
{
"AssetHash": 1759171817,
"FXAction": "Silence",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "card_silence_01"
},
{
"AssetHash": -2081715783,
"FXAction": "PlayCard",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "card_place_default"
},
{
"AssetHash": 137020608,
"FXAction": "TriggeredEffect",
"EffectTriggerType": "Pilfer",
"CardFxDefinition": "Card_Pilfer_01"
},
{
"AssetHash": 1439561965,
"FXAction": "Drain",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Drain_01"
},
{
"AssetHash": 1605311247,
"FXAction": "Attack",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "card_attack"
},
{
"AssetHash": 242306597,
"FXAction": "CreateToken",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Summon_01"
},
{
"AssetHash": 1093783917,
"FXAction": "PackOpenCardReveal",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_PackOpen_Reveal"
},
{
"AssetHash": 699018280,
"FXAction": "Reveal",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_DeckToReveal"
},
{
"AssetHash": -346237302,
"FXAction": "Invalid",
"EffectTriggerType": "Invalid",
"CardFxDefinition": ""
},
{
"AssetHash": 467971983,
"FXAction": "Breakthrough",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "card_breakthrough"
},
{
"AssetHash": -2114238160,
"FXAction": "Equip",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "card_equip"
},
{
"AssetHash": -1734354337,
"FXAction": "ConditionTopOfDeckFailure",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Buff_Fail"
},
{
"AssetHash": -67268023,
"FXAction": "ConditionTopOfDeckSuccess",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Buff_Succeed"
},
{
"AssetHash": -67268023,
"FXAction": "HasCreaturesSuccess",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Buff_Succeed"
},
{
"AssetHash": -1734354337,
"FXAction": "HasCreaturesFailure",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Buff_Fail"
},
{
"AssetHash": -67268023,
"FXAction": "CountOfSubtypeInZonetypeSuccess",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Buff_Succeed"
},
{
"AssetHash": -1734354337,
"FXAction": "CountOfSubtypeInZonetypeFailure",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Buff_Fail"
},
{
"AssetHash": -2114238160,
"FXAction": "PlayCardItem",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "card_equip"
},
{
"AssetHash": -693379766,
"FXAction": "PlayCardAction",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Play_Action"
},
{
"AssetHash": -2081715783,
"FXAction": "PlayCardSupport",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "card_place_default"
},
{
"AssetHash": 1869908047,
"FXAction": "ActionMoveCard",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "card_move_default"
},
{
"AssetHash": 1446161090,
"FXAction": "Deathrattle",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_LastGasp_Default"
},
{
"AssetHash": 242306597,
"FXAction": "CompleteFabricate",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Summon_01"
},
{
"AssetHash": 1901042080,
"FXAction": "Rally",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Rally"
},
{
"AssetHash": -2146182213,
"FXAction": "TriggeredEffect",
"EffectTriggerType": "Summon",
"CardFxDefinition": "Card_Summon_Validate"
},
{
"AssetHash": -545095491,
"FXAction": "ConditionMoreHealthThanOpponentSuccess",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "card_buff_succeed_health"
},
{
"AssetHash": -1734354337,
"FXAction": "ConditionMoreHealthThanOpponentFailure",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Buff_Fail"
},
{
"AssetHash": -854097495,
"FXAction": "GainKeyword",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "card_gain_keyword"
},
{
"AssetHash": -35564254,
"FXAction": "ActivateAbility",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Support_Activate"
},
{
"AssetHash": 1500024461,
"FXAction": "TriggeredEffect",
"EffectTriggerType": "Slay",
"CardFxDefinition": "Card_Slay_Activate"
},
{
"AssetHash": -1199891277,
"FXAction": "Battle",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "card_battle"
},
{
"AssetHash": 82826256,
"FXAction": "MatchEndTeleport",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Story_TFH_Chap3_Reive_Defeat"
},
{
"AssetHash": -872002965,
"FXAction": "TreasureHunterFindCard",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_TreasureHunt_Find"
},
{
"AssetHash": 2111300598,
"FXAction": "TreasureHunterComplete",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_TreasureHunt_Complete"
},
{
"AssetHash": -525924047,
"FXAction": "IncrementShoutLevel",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "card_shout_upgrade"
},
{
"AssetHash": 1471229772,
"FXAction": "ChangePlayerInfo",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Story_DBH_Chap6_ChangeAvatar"
},
{
"AssetHash": 271323885,
"FXAction": "PrepMecinar",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Mecinar"
},
{
"AssetHash": -58283565,
"FXAction": "HandFullDiscard",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "card_hand_full_Destroy"
},
{
"AssetHash": -409814607,
"FXAction": "SplitDoubleCard",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "card_double_split_start"
},
{
"AssetHash": -463420153,
"FXAction": "SplitDoubleCardMove",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "card_double_split_move"
},
{
"AssetHash": -453174161,
"FXAction": "IOM_Act3_Ep6_Death",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Story_IOM_Act3_Ep6_FakeDeath"
},
{
"AssetHash": 1495854987,
"FXAction": "IOM_Act3_Ep5_Notes",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Story_IOM_CircusOfCheerfulSlaughter"
},
{
"AssetHash": 316990289,
"FXAction": "Mobilize",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Mobilize"
},
{
"AssetHash": -1739508410,
"FXAction": "GainItem",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Gain_Item_Repeatable_01"
},
{
"AssetHash": 1446161090,
"FXAction": "TriggeredEffect",
"EffectTriggerType": "LastGaspTrigger",
"CardFxDefinition": "Card_LastGasp_Default"
},
{
"AssetHash": -574905692,
"FXAction": "TriggeredEffect",
"EffectTriggerType": "Wax",
"CardFxDefinition": "Card_Buff_Waxing"
},
{
"AssetHash": -1561587354,
"FXAction": "TriggeredEffect",
"EffectTriggerType": "Wane",
"CardFxDefinition": "Card_Buff_Waning"
},
{
"AssetHash": -1591130592,
"FXAction": "Consume",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Consume"
},
{
"AssetHash": -1350162316,
"FXAction": "Banish",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Banish_OnBoard"
},
{
"AssetHash": -412933780,
"FXAction": "DrawHandFull",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Draw_To_Destroy"
},
{
"AssetHash": -1367187091,
"FXAction": "Invade",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Buff_Invade_Gate"
},
{
"AssetHash": -141588467,
"FXAction": "RewardCardReveal",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Reward_Reveal"
},
{
"AssetHash": -1986235951,
"FXAction": "ChangePremium",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_ChangePremium"
},
{
"AssetHash": -768783253,
"FXAction": "ActionRevealHidden",
"EffectTriggerType": "Invalid",
"CardFxDefinition": "Card_Reveal_InHand_Opponent"
}
]
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1
View File
@@ -0,0 +1 @@
null
+80
View File
@@ -0,0 +1,80 @@
[
{
"name": "Original Release",
"directory": "ContentPack000",
"state": "Production",
"packIndex": 0
},
{
"name": "Isle of Madness",
"directory": "ContentPack001",
"state": "Production",
"packIndex": 1
},
{
"name": "Festival of Madness",
"directory": "ContentPack002",
"state": "Production",
"packIndex": 2
},
{
"name": "Monthly Jan 2019",
"directory": "ContentPack004",
"state": "Production",
"packIndex": 4
},
{
"name": "Patch 2.7",
"directory": "ContentPack005",
"state": "Production",
"packIndex": 5
},
{
"name": "Patch 2.8",
"directory": "ContentPack006",
"state": "Production",
"packIndex": 6
},
{
"name": "Alliance War",
"directory": "ContentPack003",
"state": "Production",
"packIndex": 7
},
{
"name": "Elsweyr",
"directory": "ContentPack007",
"state": "Production",
"packIndex": 8
},
{
"name": "Patch 2.10",
"directory": "ContentPack008",
"state": "Production",
"packIndex": 9
},
{
"name": "Patch 2.12",
"directory": "ContentPack009",
"state": "Production",
"packIndex": 10
},
{
"name": "Patch 2.13",
"directory": "ContentPack011",
"state": "Production",
"packIndex": 11
},
{
"name": "Oblivion",
"directory": "ContentPack010",
"state": "Production",
"packIndex": 12
},
{
"name": "Patch 2.15",
"directory": "ContentPack013",
"state": "Production",
"packIndex": 13
}
]
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+704
View File
@@ -0,0 +1,704 @@
[
{
"LaneType": "Default",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.FieldLane.FieldLane.text"
},
"TitleKey": {
"RawKey": "107b9d88-3207-45c2-b42f-f3c4aeadd983-title"
},
"DescriptionKey": {
"RawKey": "107b9d88-3207-45c2-b42f-f3c4aeadd983-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/default_lanerules"
},
{
"LaneType": "Default_LowPri",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.FieldLane.FieldLane.text"
},
"TitleKey": {
"RawKey": "107b9d88-3207-45c2-b42f-f3c4aeadd983-title"
},
"DescriptionKey": {
"RawKey": "107b9d88-3207-45c2-b42f-f3c4aeadd983-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/default_lanerules"
},
{
"LaneType": "Altar_Of_Silence",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.AltarofSilence.text"
},
"TitleKey": {
"RawKey": "4d9bb580-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9bb580-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/altarOfSilence_lanerules"
},
{
"LaneType": "Armor",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Armor.text"
},
"TitleKey": {
"RawKey": "4d9bb581-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9bb581-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/armor_lanerules"
},
{
"LaneType": "Armory",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Armory.text"
},
"TitleKey": {
"RawKey": "4d9bb582-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9bb582-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/armory_lanerules"
},
{
"LaneType": "Ballista_Tower",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.BallistaTower.text"
},
"TitleKey": {
"RawKey": "4d9bb583-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9bb583-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/ballistaTower_lanerules"
},
{
"LaneType": "Barracks",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Barracks.text"
},
"TitleKey": {
"RawKey": "4d9bb584-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9bb584-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/barracks_lanerules"
},
{
"LaneType": "Blitz",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Blitz.text"
},
"TitleKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Blitz.text"
},
"DescriptionKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Blitz.text"
},
"Image": "ContentPack000/Images/LaneIcons/blitz_lanerules"
},
{
"LaneType": "Campfire",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Campfire.text"
},
"TitleKey": {
"RawKey": "4d9bdc90-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9bdc90-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/campfire_lanerules"
},
{
"LaneType": "Champions_Arena",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.ChampionsArena.text"
},
"TitleKey": {
"RawKey": "ChampionsArena.title"
},
"DescriptionKey": {
"RawKey": "ChampionsArena.description"
},
"Image": "ContentPack000/Images/LaneIcons/championsArena_lanerules"
},
{
"LaneType": "City_Gates",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.FieldLane.FieldLane.text"
},
"TitleKey": {
"RawKey": "107b9d88-3207-45c2-b42f-f3c4aeadd983-title"
},
"DescriptionKey": {
"RawKey": "107b9d88-3207-45c2-b42f-f3c4aeadd983-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/default_lanerules"
},
{
"LaneType": "City_Gates_Stealth",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.rules.entities.LaneEntity.ShadowLane.text"
},
"TitleKey": {
"RawKey": "c268323c-a6bf-4c18-8008-cba8ba7bbcdc-title"
},
"DescriptionKey": {
"RawKey": "c268323c-a6bf-4c18-8008-cba8ba7bbcdc-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/cover_lanerules"
},
{
"LaneType": "Conveyor",
"TextKey": {
"RawKey": "c1e4cb77-5fca-4ee3-9012-7a7a4b79e98b-game_text"
},
"TitleKey": {
"RawKey": "c1e4cb77-5fca-4ee3-9012-7a7a4b79e98b-title"
},
"DescriptionKey": {
"RawKey": "c1e4cb77-5fca-4ee3-9012-7a7a4b79e98b-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/conveyor_lanerules"
},
{
"LaneType": "Docks",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Docks.text"
},
"TitleKey": {
"RawKey": "4d9bdc93-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9bdc93-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/docks_lanerules"
},
{
"LaneType": "Eclipse",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Eclipse.text"
},
"TitleKey": {
"RawKey": "4d9bdc94-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9bdc94-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/eclipse_lanerules"
},
{
"LaneType": "Flanking",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.FlankingLane.text"
},
"TitleKey": {
"RawKey": "4d9bdc95-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9bdc95-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/FlankingLane_lanerules"
},
{
"LaneType": "Fortifications",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Fortifications.text"
},
"TitleKey": {
"RawKey": "4d9bdc96-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9bdc96-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/fortifications_lanerules"
},
{
"LaneType": "Fountain",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Fountain.text"
},
"TitleKey": {
"RawKey": "4d9bdc97-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9bdc97-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/fountain_lanerules"
},
{
"LaneType": "Graveyard",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Graveyard.text"
},
"TitleKey": {
"RawKey": "4d9bdc99-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9bdc99-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/graveyard_lanerules"
},
{
"LaneType": "Hall_Of_Mirrors",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.HallOfMirrors.text"
},
"TitleKey": {
"RawKey": "HallOfMirrors.title"
},
"DescriptionKey": {
"RawKey": "HallOfMirrors.description"
},
"Image": "ContentPack000/Images/LaneIcons/hallOfMirrors_lanerules"
},
{
"LaneType": "Heist",
"TextKey": {
"RawKey": "a29a7845-5f25-4727-9244-a1dc9eb8ba1b-mechanics.normal.1"
},
"TitleKey": {
"RawKey": "09c077fc-ac44-473a-806c-d6927a98d788-title"
},
"DescriptionKey": {
"RawKey": "09c077fc-ac44-473a-806c-d6927a98d788-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/heist_lanerules"
},
{
"LaneType": "Incinerator",
"TextKey": {
"RawKey": "90c4cf41-d4ee-4767-878b-d553a163fbc4-game_text"
},
"TitleKey": {
"RawKey": "a88aac8e-f5b5-46e5-959b-e64791a26957-title"
},
"DescriptionKey": {
"RawKey": "a88aac8e-f5b5-46e5-959b-e64791a26957-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/incinerate_lanerules"
},
{
"LaneType": "Inner_Fire",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.InnerFire.text"
},
"TitleKey": {
"RawKey": "4d9bdc9b-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9bdc9b-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/InnerFire_lanerules"
},
{
"LaneType": "Jail",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Jail.text"
},
"TitleKey": {
"RawKey": "4d9bdc9c-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9bdc9c-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/jail_lanerules"
},
{
"LaneType": "Killing_Field",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.KillingField.text"
},
"TitleKey": {
"RawKey": "4d9c03a0-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9c03a0-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/killingField_lanerules"
},
{
"LaneType": "King_Of_The_Hill",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.KingOfTheHill.text"
},
"TitleKey": {
"RawKey": "4d9c03a1-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9c03a1-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/kingOfTheHill_lanerules"
},
{
"LaneType": "Library",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Library.text"
},
"TitleKey": {
"RawKey": "4d9c03a2-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9c03a2-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/library_lanerules"
},
{
"LaneType": "Liquid_Courage",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.LiquidCourage.text"
},
"TitleKey": {
"RawKey": "4d9c03a3-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9c03a3-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/liquidCourage_lanerules"
},
{
"LaneType": "Lucky",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Lucky.text"
},
"TitleKey": {
"RawKey": "4d9c03a4-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9c03a4-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/lucky_lanerules"
},
{
"LaneType": "Mage_Tower",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.MageTower.text"
},
"TitleKey": {
"RawKey": "4d9c03a5-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9c03a5-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/mageTower_lanerules"
},
{
"LaneType": "Masquerade_Ball",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.MasqueradeBall.text"
},
"TitleKey": {
"RawKey": "4d9c03a6-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9c03a6-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/masqueradeball_lanerules"
},
{
"LaneType": "Mine_Depths",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.MineDepths.text"
},
"TitleKey": {
"RawKey": "4d9c03a7-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9c03a7-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/mineDepths_lanerules"
},
{
"LaneType": "Plunder",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Plunder.text"
},
"TitleKey": {
"RawKey": "4d9bb586-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9bb586-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/plunder_lanerules"
},
{
"LaneType": "Reanimation",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Reanimation.text"
},
"TitleKey": {
"RawKey": "4d9c03aa-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9c03aa-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/reanimation_lanerules"
},
{
"LaneType": "Renewal",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Renewal.text"
},
"TitleKey": {
"RawKey": "4d9c03ab-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9c03ab-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/renewal_lanerules"
},
{
"LaneType": "Sewer",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Sewer.text"
},
"TitleKey": {
"RawKey": "4d9c03ac-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9c03ac-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/sewer_lanerules"
},
{
"LaneType": "Siege",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Siege.text"
},
"TitleKey": {
"RawKey": "4d9c2ab1-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9c2ab1-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/siege_lanerules"
},
{
"LaneType": "Smelting",
"TextKey": {
"RawKey": "eb7b544f-02ba-4ee4-9b3e-3b16a4ba3423-mechanics.normal.1"
},
"TitleKey": {
"RawKey": "a03ff684-abf7-4b0a-a332-93034676432e-title"
},
"DescriptionKey": {
"RawKey": "a03ff684-abf7-4b0a-a332-93034676432e-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/smelting_lanerules"
},
{
"LaneType": "Stealth",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.rules.entities.LaneEntity.ShadowLane.text"
},
"TitleKey": {
"RawKey": "c268323c-a6bf-4c18-8008-cba8ba7bbcdc-title"
},
"DescriptionKey": {
"RawKey": "c268323c-a6bf-4c18-8008-cba8ba7bbcdc-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/cover_lanerules"
},
{
"LaneType": "Surplus",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Surplus.text"
},
"TitleKey": {
"RawKey": "4d9c2ab2-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9c2ab2-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/surplus_lanerules"
},
{
"LaneType": "Temple",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Temple.text"
},
"TitleKey": {
"RawKey": "4d9c2ab3-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9c2ab3-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/temple_lanerules"
},
{
"LaneType": "Torment",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Torment.text"
},
"TitleKey": {
"RawKey": "4d9c2ab4-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9c2ab4-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/torment_lanerules"
},
{
"LaneType": "Venom",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Venom.text"
},
"TitleKey": {
"RawKey": "4d9c2ab7-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9c2ab7-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/venom_lanerules"
},
{
"LaneType": "Warzone",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Warzone.text"
},
"TitleKey": {
"RawKey": "4d9c2ab8-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9c2ab8-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/warZone_lanerules"
},
{
"LaneType": "Water",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Water.text"
},
"TitleKey": {
"RawKey": "4d9c2ab9-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9c2ab9-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/water_lanerules"
},
{
"LaneType": "Windy",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Windy.text"
},
"TitleKey": {
"RawKey": "4d9c2aba-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9c2aba-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/windy_lanerules"
},
{
"LaneType": "Wispmothers_Blessing",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.WispmothersBlessing.text"
},
"TitleKey": {
"RawKey": "3a751800-e810-11e3-ac10-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "3a751800-e810-11e3-ac10-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/WispmothersBlessing_lanerules"
},
{
"LaneType": "Zoo",
"TextKey": {
"RawKey": "com.direwolfdigital.hydra.data.draft.scenariomodifiers.Zoo.text"
},
"TitleKey": {
"RawKey": "4d9c2abc-6b2d-11e7-9598-0800200c9a66-title"
},
"DescriptionKey": {
"RawKey": "4d9c2abc-6b2d-11e7-9598-0800200c9a66-game_text"
},
"Image": "ContentPack000/Images/LaneIcons/Zoo_lanerules"
},
{
"LaneType": "Monastery",
"TextKey": {
"RawKey": "bfde7182-ff65-4225-b4d2-0f216c7956d4-full_text"
},
"TitleKey": {
"RawKey": "bfde7182-ff65-4225-b4d2-0f216c7956d4-title"
},
"DescriptionKey": {
"RawKey": "bfde7182-ff65-4225-b4d2-0f216c7956d4-game_text"
},
"Image": "ContentPack001/Images/LaneIcons/monastery_lanerules"
},
{
"LaneType": "Order",
"TextKey": {
"RawKey": "isles.Lanes.Order.FullDescription"
},
"TitleKey": {
"RawKey": "isles.Lanes.Order.Name"
},
"DescriptionKey": {
"RawKey": "isles.Lanes.Order.Description"
},
"Image": "ContentPack001/Images/LaneIcons/order_lanerules"
},
{
"LaneType": "Madness",
"TextKey": {
"RawKey": "isles.Lanes.Madness.FullDescription"
},
"TitleKey": {
"RawKey": "isles.Lanes.Madness.Name"
},
"DescriptionKey": {
"RawKey": "isles.Lanes.Madness.Description"
},
"Image": "ContentPack001/Images/LaneIcons/madness_lanerules"
},
{
"LaneType": "Mania",
"TextKey": {
"RawKey": null
},
"TitleKey": {
"RawKey": "isles.Lanes.Mania.Name"
},
"DescriptionKey": {
"RawKey": "isles.Lanes.Mania.Description"
},
"Image": "ContentPack001/Images/LaneIcons/mania_lanerules"
},
{
"LaneType": "Dementia",
"TextKey": {
"RawKey": null
},
"TitleKey": {
"RawKey": "isles.Lanes.Dementia.Name"
},
"DescriptionKey": {
"RawKey": "isles.Lanes.Dementia.Description"
},
"Image": "ContentPack001/Images/LaneIcons/dementia_lanerules"
},
{
"LaneType": "Jode",
"TextKey": {
"RawKey": null
},
"TitleKey": {
"RawKey": "Lanes.Jode.Title"
},
"DescriptionKey": {
"RawKey": null
},
"Image": "ContentPack000/Images/LaneIcons/InnerFire_lanerules"
}
]
+1
View File
@@ -0,0 +1 @@
null
File diff suppressed because it is too large Load Diff
+79
View File
@@ -0,0 +1,79 @@
[
{
"ResourceId": {
"Id": -1333635960,
"UniqueName": "MenuBg_default",
"CompletionType": "Placeholder"
},
"ImagePath": "AppBase/UI/Sprites/menu-background",
"DisplayNameKey": {
"RawKey": null
}
},
{
"ResourceId": {
"Id": -36488923,
"UniqueName": "MenuBg_Almalexia",
"CompletionType": "Placeholder"
},
"ImagePath": "ContentPack000/Images/MenuBackgrounds/almalexia-bg",
"DisplayNameKey": {
"RawKey": null
}
},
{
"ResourceId": {
"Id": 1771798733,
"UniqueName": "MenuBg_Caius",
"CompletionType": "Placeholder"
},
"ImagePath": "ContentPack000/Images/MenuBackgrounds/caius-bg",
"DisplayNameKey": {
"RawKey": null
}
},
{
"ResourceId": {
"Id": 1742067070,
"UniqueName": "MenuBg_Dagoth",
"CompletionType": "Placeholder"
},
"ImagePath": "ContentPack000/Images/MenuBackgrounds/dagoth-bg",
"DisplayNameKey": {
"RawKey": null
}
},
{
"ResourceId": {
"Id": -762666734,
"UniqueName": "MenuBg_Vedam-Dren",
"CompletionType": "Placeholder"
},
"ImagePath": "ContentPack000/Images/MenuBackgrounds/vedam-dren-bg",
"DisplayNameKey": {
"RawKey": null
}
},
{
"ResourceId": {
"Id": -426697918,
"UniqueName": "MenuBg_Virian",
"CompletionType": "Placeholder"
},
"ImagePath": "ContentPack000/Images/MenuBackgrounds/virian-bg",
"DisplayNameKey": {
"RawKey": null
}
},
{
"ResourceId": {
"Id": -342559612,
"UniqueName": "MenuBg_Vivec",
"CompletionType": "Placeholder"
},
"ImagePath": "ContentPack000/Images/MenuBackgrounds/vivec-bg",
"DisplayNameKey": {
"RawKey": null
}
}
]
+86
View File
@@ -0,0 +1,86 @@
[
{
"EntityAttributes": [
{
"Value": 0,
"Name": "TurnCount",
"$type": "SPTESL.IntAttribute"
},
{
"Value": 0,
"Name": "HandSize",
"$type": "SPTESL.IntAttribute"
},
{
"Value": 0,
"Name": "Armor",
"$type": "SPTESL.IntAttribute"
},
{
"Value": false,
"Name": "EquippedHands",
"$type": "SPTESL.BoolAttribute"
},
{
"Value": 0,
"Name": "Mana",
"$type": "SPTESL.IntAttribute"
},
{
"Value": 5,
"Name": "RuneHealth",
"$type": "SPTESL.IntAttribute"
},
{
"Value": 5,
"Name": "NumRunes",
"$type": "SPTESL.IntAttribute"
},
{
"Value": 5,
"Name": "NumStartingRunes",
"$type": "SPTESL.IntAttribute"
},
{
"Value": 0,
"Name": "RingUsesLeft",
"$type": "SPTESL.IntAttribute"
},
{
"Value": false,
"Name": "CanUseRing",
"$type": "SPTESL.BoolAttribute"
},
{
"Value": 0,
"Name": "CreaturesDead",
"$type": "SPTESL.IntAttribute"
},
{
"Value": 0,
"Name": "CreaturesDeadThisTurn",
"$type": "SPTESL.IntAttribute"
},
{
"Value": 0,
"Name": "NumRunesLost",
"$type": "SPTESL.IntAttribute"
},
{
"Value": false,
"Name": "SingletonDeck",
"$type": "SPTESL.BoolAttribute"
},
{
"Value": 0,
"Name": "PropheciesFromRuneBreak",
"$type": "SPTESL.IntAttribute"
},
{
"Value": false,
"Name": "WaxWaneOverride",
"$type": "SPTESL.BoolAttribute"
}
]
}
]
+157
View File
@@ -0,0 +1,157 @@
{
"NumPlayers": 2,
"TurnDuration": 240,
"MinDeckSize": 1,
"MaxDeckSize": 40,
"MulliganDisabled": false,
"MulliganTimeInSeconds": 53,
"MainPhaseTimeInSeconds": 90,
"InterruptTimeInSeconds": 25,
"UnderPenaltyTimeInSeconds": 10,
"DiscardToHandSizeAtTurnEnd": false,
"SkipGameStartSummonTrigger": false,
"NoSleepOnFirstPlayerTurn": false,
"AiDelayBetweenActions": 1.0,
"BoardPostProcessEffect": "None",
"GameStartActions": [
{
"HashId": 0,
"NameForHashing": null,
"CardFxDefinition": null,
"Selectors": [],
"Action": {
"AttributeName": "HandSize",
"Value": 10,
"$type": "SPTESL.PlayerActions+SetAttribute"
}
},
{
"HashId": 0,
"NameForHashing": null,
"CardFxDefinition": null,
"Selectors": [],
"Action": {
"NumCards": {
"ValueMethod": "Constant",
"ConstantValue": 1,
"ConstantMultiplier": 0,
"MinRandom": 0,
"MaxRandom": 0,
"MinValue": 0,
"MaxValue": 0,
"AttributeName": "None",
"RareAttributeName": "None",
"CardRole": "Self",
"PlayerRole": "Self",
"Selectors": [],
"AllPlayers": false,
"JournalType": "Drawn",
"TimeWindow": "ThisTurn"
},
"FromZoneName": "AvatarDeck",
"FromPosition": "Top",
"ToZoneType": "Board",
"ToPosition": "Bottom",
"$type": "SPTESL.PlayerActions+MoveCards"
}
},
{
"HashId": 0,
"NameForHashing": null,
"CardFxDefinition": null,
"Selectors": [],
"Action": {
"ZoneName": "Deck",
"$type": "SPTESL.PlayerActions+ShuffleCardsInZone"
}
},
{
"HashId": 0,
"NameForHashing": "Initial Card Draw",
"CardFxDefinition": null,
"Selectors": [],
"Action": {
"NumCards": {
"ValueMethod": "Constant",
"ConstantValue": 3,
"ConstantMultiplier": 0,
"MinRandom": 0,
"MaxRandom": 0,
"MinValue": 0,
"MaxValue": 0,
"AttributeName": "None",
"RareAttributeName": "None",
"CardRole": "Self",
"PlayerRole": "Self",
"Selectors": [],
"AllPlayers": false,
"JournalType": "Drawn",
"TimeWindow": "ThisTurn"
},
"StopAtHandLimit": false,
"IgnoreDeckingRule": false,
"DrawFrom": "Self",
"OperationType": "DefaultDraw",
"$type": "SPTESL.PlayerActions+DrawCards"
}
}
],
"TurnStartActions": [
{
"HashId": 0,
"NameForHashing": null,
"CardFxDefinition": null,
"Selectors": [
{
"Check": "Is",
"Role": "Self",
"$type": "SPTESL.PlayerConditionals+PlayerRoleType"
}
],
"Action": {
"NumCards": {
"ValueMethod": "Constant",
"ConstantValue": 1,
"ConstantMultiplier": 0,
"MinRandom": 0,
"MaxRandom": 0,
"MinValue": 0,
"MaxValue": 0,
"AttributeName": "None",
"RareAttributeName": "None",
"CardRole": "Self",
"PlayerRole": "Self",
"Selectors": [],
"AllPlayers": false,
"JournalType": "Drawn",
"TimeWindow": "ThisTurn"
},
"StopAtHandLimit": false,
"IgnoreDeckingRule": false,
"DrawFrom": "Self",
"OperationType": "DefaultDraw",
"$type": "SPTESL.PlayerActions+DrawCards"
}
}
],
"TurnEndActions": [],
"LossConditions": [
{
"LhsPlayer": "Self",
"Conditional": {
"All_Players": false,
"Subtype": "Avatar",
"ExcludeSubtype": "None",
"Count_Is": "GreaterThan",
"Value": 0,
"ZoneTypeMask": {
"List": [
"Cemetery"
]
},
"SuppressClientMessage": false
},
"$type": "SPTESL.PlayerRequirements+PlayerCountOfSubtypeInZonetypeRequirement"
}
]
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+268
View File
@@ -0,0 +1,268 @@
[
{
"Name": "CreatureBoard",
"Visibility": "Public",
"ZoneType": "Board",
"ZoneLimitType": "Discard",
"LaneList": [
{
"LaneType": "Default",
"ExtraLaneType": "None",
"Capacity": 4,
"$type": "SPTESL.SizedCardLane"
},
{
"LaneType": "Stealth",
"ExtraLaneType": "None",
"Capacity": 4,
"$type": "SPTESL.SizedCardLane"
}
],
"$type": "SPTESL.DynamicGameZone"
},
{
"Name": "AvatarBoard",
"Visibility": "Public",
"ZoneType": "Board",
"ZoneLimitType": "Discard",
"LaneList": [
{
"LaneType": "Default",
"ExtraLaneType": "None",
"Capacity": 1,
"$type": "SPTESL.SizedCardLane"
}
],
"$type": "SPTESL.DynamicGameZone"
},
{
"Name": "Deck",
"Visibility": "Hidden",
"ZoneType": "Deck",
"ZoneLimitType": "Discard",
"LaneList": [
{
"LaneType": "Default",
"ExtraLaneType": "None",
"$type": "SPTESL.InfiniteCardLane"
}
],
"$type": "SPTESL.DynamicGameZone"
},
{
"Name": "Hand",
"Visibility": "Private",
"ZoneType": "Hand",
"ZoneLimitType": "Discard",
"LaneList": [
{
"LaneType": "Default",
"ExtraLaneType": "None",
"$type": "SPTESL.InfiniteCardLane"
}
],
"$type": "SPTESL.DynamicGameZone"
},
{
"Name": "Board",
"Visibility": "Public",
"ZoneType": "Board",
"ZoneLimitType": "Replace",
"LaneList": [
{
"LaneType": "Default",
"ExtraLaneType": "None",
"$type": "SPTESL.InfiniteCardLane"
}
],
"$type": "SPTESL.DynamicGameZone"
},
{
"Name": "Cemetery",
"Visibility": "Public",
"ZoneType": "Cemetery",
"ZoneLimitType": "Discard",
"LaneList": [
{
"LaneType": "Default",
"ExtraLaneType": "None",
"$type": "SPTESL.InfiniteCardLane"
}
],
"$type": "SPTESL.DynamicGameZone"
},
{
"Name": "RemoveFromGame",
"Visibility": "Hidden",
"ZoneType": "Purgatory",
"ZoneLimitType": "Discard",
"LaneList": [
{
"LaneType": "Default",
"ExtraLaneType": "None",
"$type": "SPTESL.InfiniteCardLane"
}
],
"$type": "SPTESL.DynamicGameZone"
},
{
"Name": "EquipBodyBoard",
"Visibility": "Public",
"ZoneType": "Board",
"ZoneLimitType": "Replace",
"LaneList": [
{
"LaneType": "Default",
"ExtraLaneType": "None",
"Capacity": 1,
"$type": "SPTESL.SizedCardLane"
}
],
"$type": "SPTESL.DynamicGameZone"
},
{
"Name": "EquipHandBoard",
"Visibility": "Public",
"ZoneType": "Board",
"ZoneLimitType": "Replace",
"LaneList": [
{
"LaneType": "Default",
"ExtraLaneType": "None",
"Capacity": 1,
"$type": "SPTESL.SizedCardLane"
}
],
"$type": "SPTESL.DynamicGameZone"
},
{
"Name": "AvatarDeck",
"Visibility": "Hidden",
"ZoneType": "Deck",
"ZoneLimitType": "Reject",
"LaneList": [
{
"LaneType": "Default",
"ExtraLaneType": "None",
"$type": "SPTESL.InfiniteCardLane"
}
],
"$type": "SPTESL.DynamicGameZone"
},
{
"Name": "AvatarCemetery",
"Visibility": "Public",
"ZoneType": "Cemetery",
"ZoneLimitType": "Discard",
"LaneList": [
{
"LaneType": "Default",
"ExtraLaneType": "None",
"$type": "SPTESL.InfiniteCardLane"
}
],
"$type": "SPTESL.DynamicGameZone"
},
{
"Name": "HeroPowerBoard",
"Visibility": "Public",
"ZoneType": "Board",
"ZoneLimitType": "Replace",
"LaneList": [
{
"LaneType": "Default",
"ExtraLaneType": "None",
"Capacity": 1,
"$type": "SPTESL.SizedCardLane"
}
],
"$type": "SPTESL.DynamicGameZone"
},
{
"Name": "SupportBoard",
"Visibility": "Public",
"ZoneType": "Board",
"ZoneLimitType": "Replace",
"LaneList": [
{
"LaneType": "Default",
"ExtraLaneType": "None",
"Length": 4,
"$type": "SPTESL.SlottedCardLane"
}
],
"$type": "SPTESL.DynamicGameZone"
},
{
"Name": "ItemBoard",
"Visibility": "Public",
"ZoneType": "Board",
"ZoneLimitType": "Discard",
"LaneList": [
{
"LaneType": "Default",
"ExtraLaneType": "None",
"$type": "SPTESL.InfiniteCardLane"
}
],
"$type": "SPTESL.DynamicGameZone"
},
{
"Name": "View",
"Visibility": "Private",
"ZoneType": "View",
"ZoneLimitType": "Discard",
"LaneList": [
{
"LaneType": "Default",
"ExtraLaneType": "None",
"$type": "SPTESL.InfiniteCardLane"
}
],
"$type": "SPTESL.DynamicGameZone"
},
{
"Name": "Prophecy",
"Visibility": "Private",
"ZoneType": "Prophecy",
"ZoneLimitType": "Discard",
"LaneList": [
{
"LaneType": "Default",
"ExtraLaneType": "None",
"Capacity": 1,
"$type": "SPTESL.SizedCardLane"
}
],
"$type": "SPTESL.DynamicGameZone"
},
{
"Name": "Deathrattle",
"Visibility": "Public",
"ZoneType": "Deathrattle",
"ZoneLimitType": "Discard",
"LaneList": [
{
"LaneType": "Default",
"ExtraLaneType": "None",
"$type": "SPTESL.InfiniteCardLane"
}
],
"$type": "SPTESL.DynamicGameZone"
},
{
"Name": "Betray",
"Visibility": "Public",
"ZoneType": "Betray",
"ZoneLimitType": "Discard",
"LaneList": [
{
"LaneType": "None",
"ExtraLaneType": "None",
"Capacity": 1,
"$type": "SPTESL.SizedCardLane"
}
],
"$type": "SPTESL.DynamicGameZone"
}
]
+1 -1
View File
@@ -13,7 +13,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id> <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id> <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>3.21.2</quarkus.platform.version> <quarkus.platform.version>3.21.4</quarkus.platform.version>
<skipITs>true</skipITs> <skipITs>true</skipITs>
<jwt.version>4.5.0</jwt.version> <jwt.version>4.5.0</jwt.version>
<steamworks.version>1.9.0</steamworks.version> <steamworks.version>1.9.0</steamworks.version>
@@ -0,0 +1,8 @@
package ch.gtache.elderscrollslegends.service;
public enum AIDifficulty {
None,
Novice,
Adept,
Expert,
}
@@ -22,6 +22,10 @@ public class BaseEndpoints {
throw new NotAuthorizedException("Invalid token", "Bearer"); throw new NotAuthorizedException("Invalid token", "Bearer");
} }
final var token = bearerToken.replace("Bearer ", ""); final var token = bearerToken.replace("Bearer ", "");
return authenticateTokenOrThrow(token);
}
protected String authenticateTokenOrThrow(final String token) {
final var steamID = accountService.getSteamIDFromToken(token); final var steamID = accountService.getSteamIDFromToken(token);
if (steamID == null) { if (steamID == null) {
throw new NotAuthorizedException("Invalid token", "Bearer"); throw new NotAuthorizedException("Invalid token", "Bearer");
@@ -0,0 +1,8 @@
package ch.gtache.elderscrollslegends.service;
public record BaseResult(ResultCode resultCode, String endpoint) {
public BaseResult(final ResultCode resultCode) {
this(resultCode, "");
}
}
@@ -11,6 +11,13 @@ public class BaseService {
this.dataSource = Objects.requireNonNull(dataSource); this.dataSource = Objects.requireNonNull(dataSource);
} }
/**
* Constructor for CDI
*/
protected BaseService() {
this.dataSource = null;
}
protected DataSource dataSource() { protected DataSource dataSource() {
return dataSource; return dataSource;
} }
@@ -1,4 +1,7 @@
package ch.gtache.elderscrollslegends.service; package ch.gtache.elderscrollslegends.service;
public record Card(int hash) { import ch.gtache.elderscrollslegends.service.profile.CollectionName;
import ch.gtache.elderscrollslegends.service.profile.Rarity;
public record Card(int id, String name, CollectionName collectionName, Rarity rarity) {
} }
@@ -1,20 +1,50 @@
package ch.gtache.elderscrollslegends.service; package ch.gtache.elderscrollslegends.service;
import ch.gtache.elderscrollslegends.service.profile.CollectionName;
import ch.gtache.elderscrollslegends.service.profile.Rarity;
import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject; import jakarta.inject.Inject;
import org.jboss.logging.Logger;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.sql.SQLException;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@ApplicationScoped @ApplicationScoped
public class CardService extends BaseService { public class CardService extends BaseService {
private static final Logger logger = Logger.getLogger(CardService.class);
private static final String GET_CARD_QUERY = "SELECT c.name, coll.name, r.name FROM card c JOIN collection coll ON c.collection_id = coll.id JOIN rarity r ON c.rarity_id = r.id WHERE c.id = ?";
private final Map<Integer, Card> cache;
@Inject @Inject
CardService(final DataSource dataSource) { CardService(final DataSource dataSource) {
super(dataSource); super(dataSource);
this.cache = new ConcurrentHashMap<>();
} }
public Card getCard(final int hash) { public Card getCard(final int hash) {
// TODO return cache.computeIfAbsent(hash, this::retrieveCard);
return new Card(hash); }
private Card retrieveCard(final int hash) {
try (final var connection = dataSource().getConnection();
final var statement = connection.prepareStatement(GET_CARD_QUERY)) {
statement.setInt(1, hash);
try (final var rs = statement.executeQuery()) {
if (rs.next()) {
final var name = rs.getString(1);
final var collection = rs.getString(2);
final var rarity = rs.getString(3);
return new Card(hash, name, CollectionName.getCollection(collection), Rarity.valueOf(rarity));
}
}
} catch (final SQLException e) {
logger.error("Error checking for card " + hash, e);
}
return null;
} }
} }
@@ -0,0 +1,8 @@
package ch.gtache.elderscrollslegends.service;
import ch.gtache.elderscrollslegends.service.profile.CollectionName;
import java.util.List;
public record Collection(CollectionName name, List<Card> cards) {
}
@@ -0,0 +1,58 @@
package ch.gtache.elderscrollslegends.service;
import ch.gtache.elderscrollslegends.service.profile.CollectionName;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import org.jboss.logging.Logger;
import javax.sql.DataSource;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
@ApplicationScoped
public class CollectionService extends BaseService {
private static final Logger logger = Logger.getLogger(CollectionService.class);
private static final String GET_CARDS_QUERY = "SELECT id FROM card WHERE collection_id=(SELECT id FROM collection WHERE name=?)";
private final Map<CollectionName, Collection> cache;
private final CardService cardService;
@Inject
CollectionService(final DataSource dataSource, final CardService cardService) {
super(dataSource);
this.cardService = Objects.requireNonNull(cardService);
this.cache = new ConcurrentHashMap<>();
}
public Collection getCollection(final String name) {
return getCollection(CollectionName.getCollection(name));
}
public Collection getCollection(final CollectionName name) {
return cache.computeIfAbsent(name, this::retrieveCollection);
}
private Collection retrieveCollection(final CollectionName name) {
try (final var connection = dataSource().getConnection();
final var statement = connection.prepareStatement(GET_CARDS_QUERY)) {
statement.setString(1, name.databaseName());
try (final var rs = statement.executeQuery()) {
final var cards = new ArrayList<Card>();
while (rs.next()) {
cards.add(cardService.getCard(rs.getInt(1)));
}
return new Collection(name, cards);
}
} catch (final SQLException e) {
logger.error("Error checking for collection " + name, e);
}
return null;
}
}
@@ -1,20 +1,158 @@
package ch.gtache.elderscrollslegends.service; package ch.gtache.elderscrollslegends.service;
import ch.gtache.elderscrollslegends.service.inventory.Deck; import ch.gtache.elderscrollslegends.service.inventory.Deck;
import ch.gtache.elderscrollslegends.service.inventory.DeckCard;
import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject; import jakarta.inject.Inject;
import org.jboss.logging.Logger;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
@ApplicationScoped @ApplicationScoped
public class DeckService extends BaseService { public class DeckService extends BaseService {
private static final Logger logger = Logger.getLogger(DeckService.class);
private static final String GET_QUERY = "SELECT name, has_been_seen, is_valid, is_locked, rename_from_user, art_type_id, deck_type_id, event_id " +
"FROM deck WHERE id=? AND player_id=(SELECT id FROM player WHERE steam_id=?)";
@Inject @Inject
DeckService(final DataSource dataSource) { DeckService(final DataSource dataSource) {
super(dataSource); super(dataSource);
} }
public Deck getDeck(final String steamID, final long deckID) { public Deck getDeck(final String steamID, final long deckID) {
final var steamIDHandle = Long.parseLong(steamID);
try (final var connection = dataSource().getConnection();
final var statement = connection.prepareStatement(GET_QUERY)) {
statement.setLong(1, deckID);
statement.setLong(2, steamIDHandle);
try (final var rs = statement.executeQuery()) {
if (rs.next()) {
var i = 0;
final var displayName = rs.getString(++i);
final var hasBeenSeen = rs.getBoolean(++i);
final var isValid = rs.getBoolean(++i);
final var isLocked = rs.getBoolean(++i);
final var renameFromUser = rs.getBoolean(++i);
final var artTypeHash = rs.getInt(++i);
final var deckTypeHash = rs.getInt(++i);
final var eventId = rs.getLong(++i);
final var deckCards = getDeckCards(deckID);
return new Deck(deckID, displayName, hasBeenSeen, isValid, isLocked, renameFromUser, artTypeHash, deckTypeHash, deckCards, eventId);
}
}
} catch (final SQLException e) {
logger.error("Error getting deck " + deckID + " for player " + steamID, e);
}
return null; return null;
} }
private List<DeckCard> getDeckCards(final long deckID) {
final var list = new ArrayList<DeckCard>();
try (final var connection = dataSource().getConnection();
final var statement = connection.prepareStatement("SELECT type_id, num_regular, num_premium FROM deck_card WHERE deck_id=?")) {
statement.setLong(1, deckID);
try (final var rs = statement.executeQuery()) {
while (rs.next()) {
var i = 0;
final var cardHash = rs.getInt(++i);
final var numRegular = rs.getInt(++i);
final var numPremium = rs.getInt(++i);
list.add(new DeckCard(cardHash, numRegular, numPremium));
}
}
} catch (final SQLException e) {
logger.error("Error getting deck cards for deck " + deckID, e);
}
return list;
}
public long createDeck(final String steamID, final String name) {
final var steamIDHandle = Long.parseLong(steamID);
try (final var connection = dataSource().getConnection();
final var statement = connection.prepareStatement("INSERT INTO deck (player_id, name) VALUES ((SELECT id FROM player WHERE steam_id=?), ?) RETURNING id")) {
statement.setLong(1, steamIDHandle);
statement.setString(2, name);
try (final var rs = statement.executeQuery()) {
if (rs.next()) {
return rs.getLong(1);
}
}
} catch (final SQLException e) {
logger.error("Error inserting deck " + name + " for player " + steamID, e);
}
return 0;
}
public void deleteDeck(final String steamID, final long deckID) {
final var steamIDHandle = Long.parseLong(steamID);
try (final var connection = dataSource().getConnection();
final var statement = connection.prepareStatement("DELETE FROM deck WHERE id=? AND player_id=(SELECT id FROM player WHERE steam_id=?)")) {
statement.setLong(1, deckID);
statement.setLong(2, steamIDHandle);
statement.executeUpdate();
} catch (final SQLException e) {
logger.error("Error deleting deck " + deckID + " for player " + steamID, e);
}
}
public boolean saveDeck(final String steamID, final Deck deck) {
final var steamIDHandle = Long.parseLong(steamID);
try (final var connection = dataSource().getConnection()) {
return updateDeck(connection, steamIDHandle, deck);
} catch (final SQLException e) {
logger.error("Error saving deck " + deck.id() + " for player " + steamID, e);
}
return false;
}
private boolean updateDeck(final Connection connection, final long steamIDHandle, final Deck deck) throws SQLException {
try (final var statement = connection.prepareStatement("UPDATE deck SET name=?, has_been_seen=?, is_valid=?, is_locked=?, rename_from_user=?," +
"art_type_id=?, deck_type_id=?, event_id=? WHERE id=? AND player_id=(SELECT id FROM player WHERE steam_id=?)")) {
connection.setAutoCommit(false);
updateDeckCards(connection, deck.id(), deck.cards());
var i = 0;
statement.setString(++i, deck.displayName());
statement.setBoolean(++i, deck.hasBeenSeen());
statement.setBoolean(++i, deck.isValid());
statement.setBoolean(++i, deck.isLocked());
statement.setBoolean(++i, deck.renameFromUser());
statement.setInt(++i, deck.artTypeHash());
statement.setInt(++i, deck.deckTypeHash());
statement.setLong(++i, deck.eventId());
statement.setLong(++i, deck.id());
statement.setLong(++i, steamIDHandle);
final var ret = statement.executeUpdate() > 0;
connection.commit();
return ret;
} catch (final SQLException e) {
logger.error("Error saving deck " + deck.id() + " for player " + steamIDHandle, e);
connection.rollback();
return false;
} finally {
connection.setAutoCommit(true);
}
}
private void updateDeckCards(final Connection connection, final long deckID, final List<DeckCard> cards) throws SQLException {
try (final var deleteCardStatement = connection.prepareStatement("DELETE FROM deck_card WHERE deck_id=?");
final var insertCardStatement = connection.prepareStatement("INSERT INTO deck_card (deck_id, type_id, num_regular, num_premium) VALUES (?,?,?,?)")) {
deleteCardStatement.setLong(1, deckID);
deleteCardStatement.executeUpdate();
for (final var card : cards) {
insertCardStatement.setLong(1, deckID);
insertCardStatement.setInt(2, card.typeHash());
insertCardStatement.setInt(3, card.numRegular());
insertCardStatement.setInt(4, card.numPremium());
insertCardStatement.addBatch();
}
insertCardStatement.executeBatch();
}
}
} }
@@ -0,0 +1,60 @@
package ch.gtache.elderscrollslegends.service;
public enum LaneType {
None,
Default,
Stealth,
Liquid_Courage,
Armor,
Masquerade_Ball,
Docks,
Water,
Sewer,
Jail,
Mine_Depths,
Venom,
Reanimation,
Altar_Of_Silence,
Torment,
Eclipse,
Heist,
Conveyor,
Incinerator,
Smelting,
Mage_Tower,
Surplus,
Plunder,
Renewal,
Armory,
Siege,
Killing_Field,
Fountain,
Library,
Windy,
Campfire,
Barracks,
King_Of_The_Hill,
Blitz,
Ballista_Tower,
Hall_Of_Mirrors,
Champions_Arena,
Temple,
Lucky,
Fortifications,
Warzone,
Graveyard,
Inner_Fire,
Zoo,
Wispmothers_Blessing,
Flanking,
City_Gates,
City_Gates_Stealth,
Default_LowPri,
Monastery,
Madness,
Order,
Mania,
Dementia,
Jode,
Count,
}
@@ -0,0 +1,11 @@
package ch.gtache.elderscrollslegends.service;
public enum MatchMode {
None,
Campaign,
SoloArena,
VersusArena,
PracticeBattle,
VersusBattle,
EventBattle,
}
@@ -0,0 +1,7 @@
package ch.gtache.elderscrollslegends.service;
public enum MatchType {
Solo,
Challenge,
Multi,
}
@@ -1,21 +0,0 @@
package ch.gtache.elderscrollslegends.service;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.ws.rs.Produces;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import java.time.Duration;
@ApplicationScoped
class Providers {
Providers() {
}
@Produces
@ApplicationScoped
static Duration providesTimeToLive(@ConfigProperty(name = "jwt.token.ttl.seconds") final int ttl) {
return Duration.ofSeconds(ttl);
}
}
@@ -0,0 +1,413 @@
package ch.gtache.elderscrollslegends.service;
public enum ResultCode {
Ok(0),
HTTPInternalError(1),
HTTPError(2),
InternalError(3),
Unauthorized(4),
NotYetSupported(5),
BadParameters(6),
FailedConfigFetch(7),
MissingConfigData(8),
QueryFailure(9),
DeviceIdNotFound(10),
SteamNotAvailable(11),
DevAuthFailed(12),
SteamAuthFailed(13),
BNETAuthFailed(14),
BNETAuthInvalidLoginCredentials(15),
BNETAuthErrorVerifyingAuthentication(16),
BNETAuthUnknownAccount(17),
SparkleLoginFailed(18),
InvalidBuildComponent(19),
NoValidBuildForChannel(20),
BannedAccount(21),
UpgradeAccountUnknownFailure(22),
UpgradeAccountUsernameTaken(23),
UpgradeAccountEmailTaken(24),
UpgradeAccountInvalidUsername(25),
UpgradeAccountInvalidPassword(26),
UpgradeAccountInvalidEmail(27),
UpgradeAccountInvalidSecretAnswer(28),
UpgradeAccountInvalidAccountType(29),
LinkAccountUnknownFailure(30),
LinkAccountObjectAlreadyExists(31),
InventoryErrorDeliveringPackage(32),
InventoryErrorFetching(33),
InventorySaveDeckFailed(34),
InventoryDeleteDeckFailed(35),
InventoryCopyDeckFailed(36),
PackagesFailedList(37),
PackagesFailedDelivery(38),
MatchReserveFailed(39),
MatchFailedReservationFetch(40),
MatchDeckNotFound(41),
MatchDeckInvalid(42),
MatchFailedCancel(43),
MatchRefreshFailed(44),
ShopMissingRequiredSteamId(45),
ShopFailedSteamPurchaseContact(46),
ShopFailedToFinalizeIAPPurchase(47),
ShopFailedPurchase(48),
QuestFailedCheckForNew(49),
QuestFailedSelection(50),
QuestFailedSkip(51),
AnonymousBNETAuthFailed(52),
BNETGetLegalDocumentsFailure(53),
BNETAcceptLegalDocumentsUnknownFailure(54),
BNETAcceptLegalDocumentsUnauthorizedAccess(55),
BNETAnonymousAccountCreationFailed(56),
SparkleLoginUnexpectedUserId(57),
LoginTokenNotFound(58),
UpgradeAccountBuidMissingFromResponse(59),
UpgradeAccountInvalidDeviceId(60),
ChallengeFriendInMatch(61),
LoggedInElsewhere(62),
SeasonRolloverRequired(63),
DownForMaintenance(64),
LinkAccountConflict(65),
ResolveAccountUnknownFailure(66),
Placeholder_15(67),
Placeholder_16(68),
Placeholder_17(69),
Placeholder_18(70),
Placeholder_19(71),
Placeholder_20(72),
Placeholder_21(73),
Placeholder_22(74),
Placeholder_23(75),
Placeholder_24(76),
Placeholder_25(77),
Placeholder_26(78),
Placeholder_27(79),
Placeholder_28(80),
Placeholder_29(81),
Placeholder_30(82),
Placeholder_31(83),
Placeholder_32(84),
Placeholder_33(85),
Placeholder_34(86),
Placeholder_35(87),
Placeholder_36(88),
Placeholder_37(89),
Placeholder_38(90),
Placeholder_39(91),
Placeholder_40(92),
Placeholder_41(93),
Placeholder_42(94),
Placeholder_43(95),
Placeholder_44(96),
Placeholder_45(97),
Placeholder_46(98),
Placeholder_47(99),
Placeholder_48(100),
Placeholder_49(101),
Placeholder_50(102),
Placeholder_51(103),
Placeholder_52(104),
Placeholder_53(105),
Placeholder_54(106),
Placeholder_55(107),
Placeholder_56(108),
Placeholder_57(109),
Placeholder_58(110),
Placeholder_59(111),
Placeholder_60(112),
Placeholder_61(113),
Placeholder_62(114),
Placeholder_63(115),
Placeholder_64(116),
Placeholder_65(117),
Placeholder_66(118),
Placeholder_67(119),
Placeholder_68(120),
Placeholder_69(121),
Placeholder_70(122),
Placeholder_71(123),
Placeholder_72(124),
Placeholder_73(125),
Placeholder_74(126),
Placeholder_75(127),
Placeholder_76(128),
Placeholder_77(129),
Placeholder_78(130),
Placeholder_79(131),
Placeholder_80(132),
Placeholder_81(133),
Placeholder_82(134),
Placeholder_83(135),
Placeholder_84(136),
Placeholder_85(137),
Placeholder_86(138),
Placeholder_87(139),
Placeholder_88(140),
Placeholder_89(141),
Placeholder_90(142),
Placeholder_91(143),
Placeholder_92(144),
Placeholder_93(145),
Placeholder_94(146),
Placeholder_95(147),
Placeholder_96(148),
Placeholder_97(149),
Placeholder_98(150),
Placeholder_99(151),
Placeholder_100(152),
Placeholder_101(153),
Placeholder_102(154),
Placeholder_103(155),
Placeholder_104(156),
Placeholder_105(157),
Placeholder_106(158),
Placeholder_107(159),
Placeholder_108(160),
Placeholder_109(161),
Placeholder_110(162),
Placeholder_111(163),
Placeholder_112(164),
Placeholder_113(165),
Placeholder_114(166),
Placeholder_115(167),
Placeholder_116(168),
Placeholder_117(169),
Placeholder_118(170),
Placeholder_119(171),
Placeholder_120(172),
Placeholder_121(173),
Placeholder_122(174),
Placeholder_123(175),
Placeholder_124(176),
Placeholder_125(177),
Placeholder_126(178),
Placeholder_127(179),
Placeholder_128(180),
Placeholder_129(181),
Placeholder_130(182),
Placeholder_131(183),
Placeholder_132(184),
Placeholder_133(185),
Placeholder_134(186),
Placeholder_135(187),
Placeholder_136(188),
Placeholder_137(189),
Placeholder_138(190),
Placeholder_139(191),
Placeholder_140(192),
Placeholder_141(193),
Placeholder_142(194),
Placeholder_143(195),
Placeholder_144(196),
Placeholder_145(197),
Placeholder_146(198),
Placeholder_147(199),
Placeholder_148(200),
Placeholder_149(201),
Placeholder_150(202),
Placeholder_151(203),
Placeholder_152(204),
Placeholder_153(205),
Placeholder_154(206),
Placeholder_155(207),
Placeholder_156(208),
Placeholder_157(209),
Placeholder_158(210),
Placeholder_159(211),
Placeholder_160(212),
Placeholder_161(213),
Placeholder_162(214),
Placeholder_163(215),
Placeholder_164(216),
Placeholder_165(217),
Placeholder_166(218),
Placeholder_167(219),
Placeholder_168(220),
Placeholder_169(221),
Placeholder_170(222),
Placeholder_171(223),
Placeholder_172(224),
Placeholder_173(225),
Placeholder_174(226),
Placeholder_175(227),
Placeholder_176(228),
Placeholder_177(229),
Placeholder_178(230),
Placeholder_179(231),
Placeholder_180(232),
Placeholder_181(233),
Placeholder_182(234),
Placeholder_183(235),
Placeholder_184(236),
Placeholder_185(237),
Placeholder_186(238),
Placeholder_187(239),
Placeholder_188(240),
Placeholder_189(241),
Placeholder_190(242),
Placeholder_191(243),
Placeholder_192(244),
Placeholder_193(245),
Placeholder_194(246),
Placeholder_195(247),
Placeholder_196(248),
Placeholder_197(249),
Placeholder_198(250),
Placeholder_199(251),
Placeholder_200(252),
Placeholder_201(253),
Placeholder_202(254),
Placeholder_203(255),
Placeholder_204(256),
Placeholder_205(257),
Placeholder_206(258),
Placeholder_207(259),
Placeholder_208(260),
Placeholder_209(261),
Placeholder_210(262),
Placeholder_211(263),
Placeholder_212(264),
Placeholder_213(265),
Placeholder_214(266),
Placeholder_215(267),
Placeholder_216(268),
Placeholder_217(269),
Placeholder_218(270),
Placeholder_219(271),
Placeholder_220(272),
Placeholder_221(273),
Placeholder_222(274),
Placeholder_223(275),
Placeholder_224(276),
Placeholder_225(277),
Placeholder_226(278),
Placeholder_227(279),
Placeholder_228(280),
Placeholder_229(281),
Placeholder_230(282),
Placeholder_231(283),
Placeholder_232(284),
Placeholder_233(285),
Placeholder_234(286),
Placeholder_235(287),
Placeholder_236(288),
Placeholder_237(289),
Placeholder_238(290),
Placeholder_239(291),
Placeholder_240(292),
Placeholder_241(293),
Placeholder_242(294),
Placeholder_243(295),
Placeholder_244(296),
Placeholder_245(297),
Placeholder_246(298),
Placeholder_247(299),
Placeholder_248(300),
Placeholder_249(301),
Placeholder_250(302),
Placeholder_251(303),
Placeholder_252(304),
Placeholder_253(305),
Placeholder_254(306),
Placeholder_255(307),
Placeholder_256(308),
Placeholder_257(309),
Placeholder_258(310),
Placeholder_259(311),
Placeholder_260(312),
Placeholder_261(313),
Placeholder_262(314),
Placeholder_263(315),
Placeholder_264(316),
Placeholder_265(317),
Placeholder_266(318),
Placeholder_267(319),
Placeholder_268(320),
Placeholder_269(321),
Placeholder_270(322),
Placeholder_271(323),
Placeholder_272(324),
Placeholder_273(325),
Placeholder_274(326),
Placeholder_275(327),
Placeholder_276(328),
Placeholder_277(329),
Placeholder_278(330),
Placeholder_279(331),
Placeholder_280(332),
Placeholder_281(333),
Placeholder_282(334),
Placeholder_283(335),
Placeholder_284(336),
Placeholder_285(337),
Placeholder_286(338),
Placeholder_287(339),
Placeholder_288(340),
Placeholder_289(341),
Placeholder_290(342),
Placeholder_291(343),
Placeholder_292(344),
Placeholder_293(345),
Placeholder_294(346),
Placeholder_295(347),
Placeholder_296(348),
Placeholder_297(349),
Placeholder_298(350),
Placeholder_299(351),
ClientError(5000),
ClientGooglePlayRequestServerAuthCodeFailure(5001),
ClientiOSGameCenterLoginCancelled(5002),
ClientiOSGameCenterUnknownError(5003),
ClientiOSGameCenterAuthFailure(5004),
ClientiOSGameCenterIdentityFailure(5005),
ClientiOSGameCenterPluginInternalError(5006),
ClientiOSGameCenterInvalidIdentityData(5007),
ClientHttpErrorUnknown(5008),
ClientHttpErrorBadRequest(5009),
ClientHttpErrorUnauthorized(5010),
ClientHttpErrorPaymentRequired(5011),
ClientHttpErrorForbidden(5012),
ClientHttpErrorNotFound(5013),
ClientHttpErrorMethodNotAllowed(5014),
ClientHttpErrorNotAcceptable(5015),
ClientHttpErrorProxyAuthenticationRequired(5016),
ClientHttpErrorRequestTimeout(5017),
ClientHttpErrorConflict(5018),
ClientHttpErrorGone(5019),
ClientHttpErrorLengthRequired(5020),
ClientHttpErrorPreconditionFailed(5021),
ClientHttpErrorPayloadTooLarge(5022),
ClientHttpErrorUriTooLong(5023),
ClientHttpErrorUnsupportedMediaType(5024),
ClientHttpErrorRangeNotSatisfiable(5025),
ClientHttpErrorExpectationFailed(5026),
ClientHttpErrorIMATeapot(5027),
ClientHttpErrorMisdirectedRequest(5028),
ClientHttpErrorUnprocessableEntity(5029),
ClientHttpErrorLocked(5030),
ClientHttpErrorFailedDependency(5031),
ClientHttpErrorUpgradeRequired(5032),
ClientHttpErrorPreconditionRequired(5033),
ClientHttpErrorTooManyRequests(5034),
ClientHttpErrorRequestHeaderFieldsTooLarge(5035),
ClientHttpErrorUnavailableForLegalReasons(5036),
ClientHttpErrorExceptionDecodingResponse(5037),
ClientSteamLinkedToAnotherAccount(5038),
ClientiOSLinkedToAnotherAccount(5039),
ClientAndroidLinkedToAnotherAccount(5040),
ClientLoginCancelled(5041),
ClientBadAuthToken(5042),
ClientNotSupportedInBNETLauncher(5043),
ClientGetEulaUnknownError(5044),
ClientUserRejectedDocError(5045),
ClientDigitalRiverRedirectException(5046);
private final int code;
ResultCode(final int code) {
this.code = code;
}
public int code() {
return code;
}
}
@@ -1,6 +1,8 @@
package ch.gtache.elderscrollslegends.service.account; package ch.gtache.elderscrollslegends.service.account;
import ch.gtache.elderscrollslegends.service.BaseEndpoints; import ch.gtache.elderscrollslegends.service.BaseEndpoints;
import ch.gtache.elderscrollslegends.service.BaseResult;
import ch.gtache.elderscrollslegends.service.ResultCode;
import ch.gtache.elderscrollslegends.service.SteamService; import ch.gtache.elderscrollslegends.service.SteamService;
import ch.gtache.elderscrollslegends.service.account.auth.AuthBNETGamecodeRequest; import ch.gtache.elderscrollslegends.service.account.auth.AuthBNETGamecodeRequest;
import ch.gtache.elderscrollslegends.service.account.auth.AuthBNETSteamRequest; import ch.gtache.elderscrollslegends.service.account.auth.AuthBNETSteamRequest;
@@ -49,24 +51,26 @@ public class AccountEndpoints extends BaseEndpoints {
if (steamService.authenticate(request.sessionTicket(), request.steamId())) { if (steamService.authenticate(request.sessionTicket(), request.steamId())) {
logger.info("SteamLogin succeeded for " + request); logger.info("SteamLogin succeeded for " + request);
final var data = accountService().authenticate(request.steamId()); final var data = accountService().authenticate(request.steamId());
return new AuthResult(data, 0, null, List.of()); return new AuthResult(ResultCode.Ok, "", data, 0, null, List.of());
} else { } else {
return new AuthResult(null, 2, "SteamLogin failed", List.of()); return new AuthResult(ResultCode.SteamAuthFailed, "", null, 2, "SteamLogin failed", List.of());
} }
} catch (final SteamException e) { } catch (final SteamException e) {
logger.error("SteamLogin failed for " + request, e); logger.error("SteamLogin failed for " + request, e);
return new AuthResult(null, 1, "SteamLogin failed", List.of()); return new AuthResult(ResultCode.SteamAuthFailed, "", null, 1, "SteamLogin failed", List.of());
} }
} }
@POST @POST
@Path("bnetSteamLogout") @Path("bnetSteamLogout")
@Consumes("application/json") @Consumes("application/json")
public void steamLogout(@HeaderParam("Authorization") final String authentication) { @Produces("application/json")
public BaseResult steamLogout(@HeaderParam("Authorization") final String authentication) {
logger.info("SteamLogout called"); logger.info("SteamLogout called");
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("SteamLogout called by " + steamID); logger.info("SteamLogout called by " + steamID);
steamService.endAuthSession(steamID); steamService.endAuthSession(steamID);
return new BaseResult(ResultCode.Ok);
} }
@POST @POST
@@ -75,7 +79,7 @@ public class AccountEndpoints extends BaseEndpoints {
@Produces("application/json") @Produces("application/json")
public AuthResult gamecodeLogin(final AuthBNETGamecodeRequest request) { public AuthResult gamecodeLogin(final AuthBNETGamecodeRequest request) {
logger.info("GamecodeLogin called : " + request); logger.info("GamecodeLogin called : " + request);
return new AuthResult(null, 1, "GamecodeLogin not implemented", List.of()); return new AuthResult(ResultCode.BNETAuthFailed, "", null, 1, "GamecodeLogin not implemented", List.of());
} }
@POST @POST
@@ -85,9 +89,9 @@ public class AccountEndpoints extends BaseEndpoints {
public CheckUsernameResponse checkUsername(final CheckUsernameRequest request) { public CheckUsernameResponse checkUsername(final CheckUsernameRequest request) {
logger.info("CheckUsername called : " + request); logger.info("CheckUsername called : " + request);
if (accountService().exists(request.username())) { if (accountService().exists(request.username())) {
return new CheckUsernameResponse(new CheckUsernameResponseBody(true, true, 0)); return new CheckUsernameResponse(ResultCode.Ok, "", new CheckUsernameResponseBody(true, true, 0));
} else { } else {
return new CheckUsernameResponse(new CheckUsernameResponseBody(false, false, 1)); return new CheckUsernameResponse(ResultCode.BNETAuthFailed, "", new CheckUsernameResponseBody(false, false, 1));
} }
} }
@@ -98,9 +102,9 @@ public class AccountEndpoints extends BaseEndpoints {
public CheckEmailResponse checkEmail(final CheckEmailRequest request) { public CheckEmailResponse checkEmail(final CheckEmailRequest request) {
logger.info("CheckEmail called : " + request); logger.info("CheckEmail called : " + request);
if (accountService().exists(request.email())) { if (accountService().exists(request.email())) {
return new CheckEmailResponse(new CheckEmailResponseBody(true, 0)); return new CheckEmailResponse(ResultCode.Ok, "", new CheckEmailResponseBody(true, 0));
} else { } else {
return new CheckEmailResponse(new CheckEmailResponseBody(false, 1)); return new CheckEmailResponse(ResultCode.BNETAuthFailed, "", new CheckEmailResponseBody(false, 1));
} }
} }
@@ -110,12 +114,12 @@ public class AccountEndpoints extends BaseEndpoints {
@Produces("application/json") @Produces("application/json")
public RefreshSessionResponse refreshSession(@HeaderParam("Authorization") final String authentication, public RefreshSessionResponse refreshSession(@HeaderParam("Authorization") final String authentication,
final RefreshSessionRequest request) { final RefreshSessionRequest request) {
logger.info("RefreshSession called : " + request);
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("RefreshSession called by " + steamID + " : " + request);
final var token = accountService().refreshToken(steamID); final var token = accountService().refreshToken(steamID);
final var timeToRefresh = Duration.between(java.time.Instant.now(), token.expirationTimestamp()) final var timeToRefresh = Duration.between(java.time.Instant.now(), token.expirationTimestamp())
.minus(Duration.ofMinutes(5)).getSeconds(); .minus(Duration.ofMinutes(5)).getSeconds();
return new RefreshSessionResponse((int) timeToRefresh, token.token()); return new RefreshSessionResponse(ResultCode.Ok, "", (int) timeToRefresh, token.token());
} }
@POST @POST
@@ -124,18 +128,20 @@ public class AccountEndpoints extends BaseEndpoints {
@Produces("application/json") @Produces("application/json")
public LegalDocumentsResponse getLegalDocumentsForUser(@HeaderParam("Authorization") final String authentication, public LegalDocumentsResponse getLegalDocumentsForUser(@HeaderParam("Authorization") final String authentication,
final GetLegalDocumentsForUserRequest request) { final GetLegalDocumentsForUserRequest request) {
logger.info("GetLegalDocumentsForUser called : " + request);
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
return new LegalDocumentsResponse(List.of()); logger.info("GetLegalDocumentsForUser called by " + steamID + " : " + request);
return new LegalDocumentsResponse(ResultCode.Ok, "", List.of());
} }
@POST @POST
@Path("bnetAcceptLegalDocument") @Path("bnetAcceptLegalDocument")
@Consumes("application/json") @Consumes("application/json")
public void acceptLegalDocument(@HeaderParam("Authorization") final String authentication, @Produces("application/json")
public BaseResult acceptLegalDocument(@HeaderParam("Authorization") final String authentication,
final AcceptLegalDocumentRequest request) { final AcceptLegalDocumentRequest request) {
logger.info("acceptLegalDocument called : " + request); final var steamID = authenticateOrThrow(authentication);
authenticateOrThrow(authentication); logger.info("acceptLegalDocument called by " + steamID + " : " + request);
return new BaseResult(ResultCode.Ok);
} }
@POST @POST
@@ -144,6 +150,6 @@ public class AccountEndpoints extends BaseEndpoints {
@Produces("application/json") @Produces("application/json")
public LegalDocumentsResponse getAllLegalDocuments(final GetAllLegalDocumentsRequest request) { public LegalDocumentsResponse getAllLegalDocuments(final GetAllLegalDocumentsRequest request) {
logger.info("GetAllLegalDocuments called : " + request); logger.info("GetAllLegalDocuments called : " + request);
return new LegalDocumentsResponse(List.of()); return new LegalDocumentsResponse(ResultCode.Ok, "", List.of());
} }
} }
@@ -35,10 +35,23 @@ public class AccountService extends BaseService {
final var longId = Long.parseLong(steamID); final var longId = Long.parseLong(steamID);
final var name = steamService.getName(steamID); final var name = steamService.getName(steamID);
try (final var connection = dataSource().getConnection(); try (final var connection = dataSource().getConnection();
final var statement = connection.prepareStatement("INSERT INTO player (steam_id, name) VALUES (?, ?)")) { final var statement = connection.prepareStatement("INSERT INTO player (steam_id, name) VALUES (?, ?) RETURNING id")) {
statement.setLong(1, longId); statement.setLong(1, longId);
statement.setString(2, name); statement.setString(2, name);
statement.executeUpdate(); try (final var rs = statement.executeQuery()) {
if (rs.next()) {
final var playerId = rs.getLong(1);
try (final var profileStatement = connection.prepareStatement("INSERT INTO profile (player_id, name) VALUES (?, ?)")) {
profileStatement.setLong(1, playerId);
profileStatement.setString(2, name);
profileStatement.executeUpdate();
}
try (final var onboardingStatement = connection.prepareStatement("INSERT INTO onboarding (player_id) VALUES (?)")) {
onboardingStatement.setLong(1, playerId);
onboardingStatement.executeUpdate();
}
}
}
} catch (final SQLException e) { } catch (final SQLException e) {
logger.error("Error inserting player " + steamID, e); logger.error("Error inserting player " + steamID, e);
return null; return null;
@@ -53,7 +66,7 @@ public class AccountService extends BaseService {
final var longId = Long.parseLong(steamID); final var longId = Long.parseLong(steamID);
final var name = steamService.getName(steamID); final var name = steamService.getName(steamID);
try (final var connection = dataSource().getConnection(); try (final var connection = dataSource().getConnection();
final var statement = connection.prepareStatement("UPDATE player SET name=? WHERE steam_id=?")) { final var statement = connection.prepareStatement("UPDATE profile SET name=? WHERE player_id=(SELECT id FROM player WHERE steam_id=?)")) {
statement.setString(1, name); statement.setString(1, name);
statement.setLong(2, longId); statement.setLong(2, longId);
statement.executeUpdate(); statement.executeUpdate();
@@ -66,7 +79,7 @@ public class AccountService extends BaseService {
if (token != null) { if (token != null) {
final var longId = Long.parseLong(steamID); final var longId = Long.parseLong(steamID);
try (final var connection = dataSource().getConnection(); try (final var connection = dataSource().getConnection();
final var statement = connection.prepareStatement("SELECT name FROM player WHERE steam_id=?")) { final var statement = connection.prepareStatement("SELECT name FROM profile WHERE player_id=(SELECT id FROM player WHERE steam_id=?)")) {
statement.setLong(1, longId); statement.setLong(1, longId);
try (final var rs = statement.executeQuery()) { try (final var rs = statement.executeQuery()) {
if (rs.next()) { if (rs.next()) {
@@ -12,7 +12,6 @@ import org.jboss.logging.Logger;
import java.time.Duration; import java.time.Duration;
import java.time.Instant; import java.time.Instant;
import java.util.Objects;
@ApplicationScoped @ApplicationScoped
class JWTService { class JWTService {
@@ -20,14 +19,15 @@ class JWTService {
private static final String ISSUER = "TESL"; private static final String ISSUER = "TESL";
private final Duration timeToLive;
private final Algorithm algorithm; private final Algorithm algorithm;
private final Duration timeToLive;
private final JWTVerifier verifier; private final JWTVerifier verifier;
@Inject @Inject
JWTService(@ConfigProperty(name = "jwt.hs256.key.secret") final String key, final Duration timeToLive) { JWTService(@ConfigProperty(name = "jwt.hs256.key.secret") final String key,
this.timeToLive = Objects.requireNonNull(timeToLive); @ConfigProperty(name = "jwt.token.ttl.seconds") final int ttlSeconds) {
this.algorithm = Algorithm.HMAC256(key); this.algorithm = Algorithm.HMAC256(key);
this.timeToLive = Duration.ofSeconds(ttlSeconds);
this.verifier = JWT.require(algorithm).withIssuer(ISSUER).build(); this.verifier = JWT.require(algorithm).withIssuer(ISSUER).build();
} }
@@ -1,4 +1,7 @@
package ch.gtache.elderscrollslegends.service.account; package ch.gtache.elderscrollslegends.service.account;
public record RefreshSessionResponse(int timeToRefresh, String sessionToken) { import ch.gtache.elderscrollslegends.service.ResultCode;
public record RefreshSessionResponse(ResultCode resultCode, String endpoint,
int timeToRefresh, String sessionToken) {
} }
@@ -1,6 +1,9 @@
package ch.gtache.elderscrollslegends.service.account.auth; package ch.gtache.elderscrollslegends.service.account.auth;
import ch.gtache.elderscrollslegends.service.ResultCode;
import java.util.List; import java.util.List;
public record AuthResult(AuthData data, int errorCode, String errorMessage, List<String> validChangelists) { public record AuthResult(ResultCode resultCode, String endpoint,
AuthData data, int errorCode, String errorMessage, List<String> validChangelists) {
} }
@@ -1,4 +1,7 @@
package ch.gtache.elderscrollslegends.service.account.check; package ch.gtache.elderscrollslegends.service.account.check;
public record CheckEmailResponse(CheckEmailResponseBody body) { import ch.gtache.elderscrollslegends.service.ResultCode;
public record CheckEmailResponse(ResultCode resultCode, String endpoint,
CheckEmailResponseBody body) {
} }
@@ -1,4 +1,7 @@
package ch.gtache.elderscrollslegends.service.account.check; package ch.gtache.elderscrollslegends.service.account.check;
public record CheckUsernameResponse(CheckUsernameResponseBody body) { import ch.gtache.elderscrollslegends.service.ResultCode;
public record CheckUsernameResponse(ResultCode resultCode, String endpoint,
CheckUsernameResponseBody body) {
} }
@@ -1,6 +1,9 @@
package ch.gtache.elderscrollslegends.service.account.transfer; package ch.gtache.elderscrollslegends.service.account.transfer;
import ch.gtache.elderscrollslegends.service.ResultCode;
import java.util.List; import java.util.List;
public record LegalDocumentsResponse(List<LegalDocEntry> items) { public record LegalDocumentsResponse(ResultCode resultCode, String endpoint,
List<LegalDocEntry> items) {
} }
@@ -1,10 +1,12 @@
package ch.gtache.elderscrollslegends.service.account.transfer; package ch.gtache.elderscrollslegends.service.account.transfer;
import ch.gtache.elderscrollslegends.service.ResultCode;
import ch.gtache.elderscrollslegends.service.inventory.InventorySelectedItem; import ch.gtache.elderscrollslegends.service.inventory.InventorySelectedItem;
import ch.gtache.elderscrollslegends.service.profile.ProfileStruct; import ch.gtache.elderscrollslegends.service.profile.ProfileStruct;
import java.util.List; import java.util.List;
record TransferResponse_Phase0(List<LegalDocEntry> items, String buid, String sessionToken, boolean hasTeslUserData, record TransferResponse_Phase0(ResultCode resultCode, String endpoint,
List<LegalDocEntry> items, String buid, String sessionToken, boolean hasTeslUserData,
ProfileStruct profile, List<InventorySelectedItem> categories) { ProfileStruct profile, List<InventorySelectedItem> categories) {
} }
@@ -1,8 +1,10 @@
package ch.gtache.elderscrollslegends.service.account.transfer; package ch.gtache.elderscrollslegends.service.account.transfer;
import ch.gtache.elderscrollslegends.service.ResultCode;
import ch.gtache.elderscrollslegends.service.account.auth.AuthData; import ch.gtache.elderscrollslegends.service.account.auth.AuthData;
import java.util.List; import java.util.List;
record TransferResponse_Phase1(AuthData data, int errorCode, String errorMessage, List<String> validChangelists) { record TransferResponse_Phase1(ResultCode resultCode, String endpoint,
AuthData data, int errorCode, String errorMessage, List<String> validChangelists) {
} }
@@ -1,8 +1,10 @@
package ch.gtache.elderscrollslegends.service.analytics; package ch.gtache.elderscrollslegends.service.analytics;
import ch.gtache.elderscrollslegends.service.BaseEndpoints; import ch.gtache.elderscrollslegends.service.BaseEndpoints;
import ch.gtache.elderscrollslegends.service.ResultCode;
import ch.gtache.elderscrollslegends.service.account.AccountService; import ch.gtache.elderscrollslegends.service.account.AccountService;
import jakarta.inject.Inject; import jakarta.inject.Inject;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;
import jakarta.ws.rs.HeaderParam; import jakarta.ws.rs.HeaderParam;
import jakarta.ws.rs.POST; import jakarta.ws.rs.POST;
@@ -26,18 +28,24 @@ public class AnalyticsEndpoints extends BaseEndpoints {
@POST @POST
@Path("/clientEvent") @Path("/clientEvent")
public void newAnalytics(@HeaderParam("Authorization") final String authentication, @Consumes("application/json")
@Produces("application/json")
public AnalyticsEventResult newAnalytics(@HeaderParam("Authorization") final String authentication,
final AnalyticsEvent analyticsEvent) { final AnalyticsEvent analyticsEvent) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("Report analytics called by " + steamID + " : " + analyticsEvent); logger.info("Report analytics called by " + steamID + " : " + analyticsEvent);
analyticsService.newAnalytics(steamID, analyticsEvent); analyticsService.newAnalytics(steamID, analyticsEvent);
return new AnalyticsEventResult(ResultCode.Ok, "", false);
} }
@POST @POST
@Path("/clientEventPA") @Path("/clientEventPA")
public void newAnalyticsPA(final AnalyticsEvent analyticsEvent) { @Consumes("application/json")
@Produces("application/json")
public AnalyticsEventResult newAnalyticsPA(final AnalyticsEvent analyticsEvent) {
logger.info("Report analyticsPA called : " + analyticsEvent); logger.info("Report analyticsPA called : " + analyticsEvent);
analyticsService.newAnalytics(analyticsEvent); analyticsService.newAnalytics(analyticsEvent);
return new AnalyticsEventResult(ResultCode.Ok, "", false);
} }
@GET @GET
@@ -46,6 +54,6 @@ public class AnalyticsEndpoints extends BaseEndpoints {
public AnalyticsFetchResponse getReportingConfig(@HeaderParam("Authorization") final String authentication) { public AnalyticsFetchResponse getReportingConfig(@HeaderParam("Authorization") final String authentication) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("ReportingConfig called by " + steamID); logger.info("ReportingConfig called by " + steamID);
return new AnalyticsFetchResponse(true); return new AnalyticsFetchResponse(ResultCode.Ok, "", true);
} }
} }
@@ -0,0 +1,7 @@
package ch.gtache.elderscrollslegends.service.analytics;
import ch.gtache.elderscrollslegends.service.ResultCode;
public record AnalyticsEventResult(ResultCode resultCode, String endpoint,
boolean disable) {
}
@@ -1,4 +1,7 @@
package ch.gtache.elderscrollslegends.service.analytics; package ch.gtache.elderscrollslegends.service.analytics;
public record AnalyticsFetchResponse(boolean enableReporting) { import ch.gtache.elderscrollslegends.service.ResultCode;
public record AnalyticsFetchResponse(ResultCode resultCode, String endpoint,
boolean enableReporting) {
} }
@@ -1,8 +1,10 @@
package ch.gtache.elderscrollslegends.service.arena; package ch.gtache.elderscrollslegends.service.arena;
import ch.gtache.elderscrollslegends.service.BaseEndpoints; import ch.gtache.elderscrollslegends.service.BaseEndpoints;
import ch.gtache.elderscrollslegends.service.BaseResult;
import ch.gtache.elderscrollslegends.service.CardService; import ch.gtache.elderscrollslegends.service.CardService;
import ch.gtache.elderscrollslegends.service.ClassService; import ch.gtache.elderscrollslegends.service.ClassService;
import ch.gtache.elderscrollslegends.service.ResultCode;
import ch.gtache.elderscrollslegends.service.account.AccountService; import ch.gtache.elderscrollslegends.service.account.AccountService;
import jakarta.inject.Inject; import jakarta.inject.Inject;
import jakarta.ws.rs.Consumes; import jakarta.ws.rs.Consumes;
@@ -42,19 +44,19 @@ public class ArenaEndpoints extends BaseEndpoints {
logger.info("purchaseArena called by " + steamID + " : " + request); logger.info("purchaseArena called by " + steamID + " : " + request);
arenaService.purchaseArena(steamID, request.arenaType(), request.currencyType()); arenaService.purchaseArena(steamID, request.arenaType(), request.currencyType());
final var data = arenaService.getArenaClientData(steamID); final var data = arenaService.getArenaClientData(steamID);
return new FetchArenaInstancesResult(data); return new FetchArenaInstancesResult(ResultCode.Ok, "", data);
} }
@POST @POST
@Path("resignArena") @Path("resignArena")
@Consumes("application/json") @Consumes("application/json")
@Produces("application/json") @Produces("application/json")
public ResignArenaResult resignArena(@HeaderParam("Authorization") final String authentication, public BaseResult resignArena(@HeaderParam("Authorization") final String authentication,
final ResignArenaRequest request) { final ResignArenaRequest request) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("resignArena called by " + steamID + " : " + request); logger.info("resignArena called by " + steamID + " : " + request);
arenaService.resignArena(steamID, request.arenaType()); arenaService.resignArena(steamID, request.arenaType());
return new ResignArenaResult(); return new BaseResult(ResultCode.Ok);
} }
@POST @POST
@@ -67,7 +69,7 @@ public class ArenaEndpoints extends BaseEndpoints {
logger.info("selectCard called by " + steamID + " : " + request); logger.info("selectCard called by " + steamID + " : " + request);
final var card = cardService.getCard(request.cardTypeHash()); final var card = cardService.getCard(request.cardTypeHash());
arenaService.selectCard(steamID, request.arenaType(), card); arenaService.selectCard(steamID, request.arenaType(), card);
return new SelectCardResult(arenaService.getArenaClientData(steamID)); return new SelectCardResult(ResultCode.Ok, "", arenaService.getArenaClientData(steamID));
} }
@POST @POST
@@ -80,7 +82,7 @@ public class ArenaEndpoints extends BaseEndpoints {
logger.info("selectClassType called by " + steamID + " : " + request); logger.info("selectClassType called by " + steamID + " : " + request);
final var clazz = classService.getClass(request.classTypeHash()); final var clazz = classService.getClass(request.classTypeHash());
arenaService.selectClass(steamID, request.arenaType(), clazz); arenaService.selectClass(steamID, request.arenaType(), clazz);
return new SelectClassResult(arenaService.getArenaClientData(steamID)); return new SelectClassResult(ResultCode.Ok, "", arenaService.getArenaClientData(steamID));
} }
@GET @GET
@@ -90,6 +92,6 @@ public class ArenaEndpoints extends BaseEndpoints {
public FetchArenaInstancesResult fetchActiveArenaInstances(@HeaderParam("Authorization") final String authentication) { public FetchArenaInstancesResult fetchActiveArenaInstances(@HeaderParam("Authorization") final String authentication) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("fetchActiveArenaInstances called by " + steamID); logger.info("fetchActiveArenaInstances called by " + steamID);
return new FetchArenaInstancesResult(arenaService.getArenaClientData(steamID)); return new FetchArenaInstancesResult(ResultCode.Ok, "", arenaService.getArenaClientData(steamID));
} }
} }
@@ -17,14 +17,14 @@ class ArenaService extends BaseService {
super(dataSource); super(dataSource);
} }
public void purchaseArena(final String steamID, final ArenaType arenaType, void purchaseArena(final String steamID, final ArenaType arenaType,
final ArenaPurchaseCurrencyType currencyType) { final ArenaPurchaseCurrencyType currencyType) {
} }
public void resignArena(final String steamID, final ArenaType arenaType) { void resignArena(final String steamID, final ArenaType arenaType) {
} }
public ArenaClientDataStruct getArenaClientData(final String steamID) { ArenaClientDataStruct getArenaClientData(final String steamID) {
return new ArenaClientDataStruct(0, 0, List.of()); return new ArenaClientDataStruct(0, 0, List.of());
} }
@@ -1,4 +1,7 @@
package ch.gtache.elderscrollslegends.service.arena; package ch.gtache.elderscrollslegends.service.arena;
public record FetchArenaInstancesResult(ArenaClientDataStruct clientData) { import ch.gtache.elderscrollslegends.service.ResultCode;
public record FetchArenaInstancesResult(ResultCode resultCode, String endpoint,
ArenaClientDataStruct clientData) {
} }
@@ -1,4 +1,7 @@
package ch.gtache.elderscrollslegends.service.arena; package ch.gtache.elderscrollslegends.service.arena;
public record PurchaseArenaRequest(ArenaType arenaType, ArenaPurchaseCurrencyType currencyType) { import ch.gtache.elderscrollslegends.service.ResultCode;
public record PurchaseArenaRequest(ResultCode resultCode, String endpoint,
ArenaType arenaType, ArenaPurchaseCurrencyType currencyType) {
} }
@@ -1,4 +0,0 @@
package ch.gtache.elderscrollslegends.service.arena;
public record ResignArenaResult() {
}
@@ -1,4 +1,7 @@
package ch.gtache.elderscrollslegends.service.arena; package ch.gtache.elderscrollslegends.service.arena;
public record SelectCardResult(ArenaClientDataStruct clientData) { import ch.gtache.elderscrollslegends.service.ResultCode;
public record SelectCardResult(ResultCode resultCode, String endpoint,
ArenaClientDataStruct clientData) {
} }
@@ -1,4 +1,7 @@
package ch.gtache.elderscrollslegends.service.arena; package ch.gtache.elderscrollslegends.service.arena;
public record SelectClassResult(ArenaClientDataStruct clientData) { import ch.gtache.elderscrollslegends.service.ResultCode;
public record SelectClassResult(ResultCode resultCode, String endpoint,
ArenaClientDataStruct clientData) {
} }
@@ -1,6 +1,8 @@
package ch.gtache.elderscrollslegends.service.campaign; package ch.gtache.elderscrollslegends.service.campaign;
import ch.gtache.elderscrollslegends.service.BaseEndpoints; import ch.gtache.elderscrollslegends.service.BaseEndpoints;
import ch.gtache.elderscrollslegends.service.BaseResult;
import ch.gtache.elderscrollslegends.service.ResultCode;
import ch.gtache.elderscrollslegends.service.account.AccountService; import ch.gtache.elderscrollslegends.service.account.AccountService;
import jakarta.inject.Inject; import jakarta.inject.Inject;
import jakarta.ws.rs.Consumes; import jakarta.ws.rs.Consumes;
@@ -13,7 +15,7 @@ import org.jboss.logging.Logger;
import java.util.Objects; import java.util.Objects;
@Path("/campaign") @Path("/campaigns")
public class CampaignEndpoints extends BaseEndpoints { public class CampaignEndpoints extends BaseEndpoints {
private static final Logger logger = Logger.getLogger(CampaignEndpoints.class); private static final Logger logger = Logger.getLogger(CampaignEndpoints.class);
@@ -28,31 +30,35 @@ public class CampaignEndpoints extends BaseEndpoints {
@POST @POST
@Path("checkCampaignProgress") @Path("checkCampaignProgress")
@Consumes("application/json") @Consumes("application/json")
public void checkCampaignProgress(@HeaderParam("Authorization") final String authentication, @Produces("application/json")
public BaseResult checkCampaignProgress(@HeaderParam("Authorization") final String authentication,
final CheckCampaignRequest request) { final CheckCampaignRequest request) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("CheckCampaignProgress called by " + steamID + " : " + request); logger.info("CheckCampaignProgress called by " + steamID + " : " + request);
campaignService.getCampaign(steamID, request.campaignId(), request.isMastery()); campaignService.getCampaign(steamID, request.campaignId(), request.isMastery());
return new BaseResult(ResultCode.Ok);
} }
@POST @POST
@Path("debugAddNextChapter") @Path("debugAddNextChapter")
@Consumes("application/json") @Consumes("application/json")
@Produces("application/json") @Produces("application/json")
public void debugAddNextChapter(@HeaderParam("Authorization") final String authentication, public BaseResult debugAddNextChapter(@HeaderParam("Authorization") final String authentication,
final DebugAddNextChapterRequest request) { final DebugAddNextChapterRequest request) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("DebugAddNextChapter called by " + steamID + " : " + request); logger.info("DebugAddNextChapter called by " + steamID + " : " + request);
return new BaseResult(ResultCode.Ok);
} }
@POST @POST
@Path("debugAddNextEvent") @Path("debugAddNextEvent")
@Consumes("application/json") @Consumes("application/json")
@Produces("application/json") @Produces("application/json")
public void debugAddNextEvent(@HeaderParam("Authorization") final String authentication, public BaseResult debugAddNextEvent(@HeaderParam("Authorization") final String authentication,
final DebugAddNextEventRequest request) { final DebugAddNextEventRequest request) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("DebugAddNextEvent called by " + steamID + " : " + request); logger.info("DebugAddNextEvent called by " + steamID + " : " + request);
return new BaseResult(ResultCode.Ok);
} }
@POST @POST
@@ -63,7 +69,7 @@ public class CampaignEndpoints extends BaseEndpoints {
final SetChapterDialogStatusRequest request) { final SetChapterDialogStatusRequest request) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("SetChapterDialogStatus called by " + steamID + " : " + request); logger.info("SetChapterDialogStatus called by " + steamID + " : " + request);
return new SetChapterDialogResult(campaignService.getRewards(steamID, request)); return new SetChapterDialogResult(ResultCode.Ok, "", campaignService.getRewards(steamID, request));
} }
@POST @POST
@@ -74,15 +80,15 @@ public class CampaignEndpoints extends BaseEndpoints {
final SetChapterEventChoiceRequest request) { final SetChapterEventChoiceRequest request) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("SetChapterEventChoice called by " + steamID + " : " + request); logger.info("SetChapterEventChoice called by " + steamID + " : " + request);
return new SetChapterEventResult(campaignService.getRewards(steamID, request)); return new SetChapterEventResult(ResultCode.Ok, "", campaignService.getRewards(steamID, request));
} }
@GET @GET
@Path("list") @Path("list")
@Produces("application/json") @Produces("application/json")
public ListCampaignsResponse getList(@HeaderParam("Authorization") final String authentication) { public ListCampaignsResponse list(@HeaderParam("Authorization") final String authentication) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("List called by " + steamID); logger.info("List called by " + steamID);
return new ListCampaignsResponse(campaignService.getCampaigns(steamID)); return new ListCampaignsResponse(ResultCode.Ok, "", campaignService.getCampaigns(steamID));
} }
} }
@@ -1,6 +1,9 @@
package ch.gtache.elderscrollslegends.service.campaign; package ch.gtache.elderscrollslegends.service.campaign;
import ch.gtache.elderscrollslegends.service.ResultCode;
import java.util.List; import java.util.List;
public record ListCampaignsResponse(List<UserCampaignData> campaignDatas) { public record ListCampaignsResponse(ResultCode resultCode, String endpoint,
List<UserCampaignData> campaignDatas) {
} }
@@ -1,8 +1,10 @@
package ch.gtache.elderscrollslegends.service.campaign; package ch.gtache.elderscrollslegends.service.campaign;
import ch.gtache.elderscrollslegends.service.ResultCode;
import ch.gtache.elderscrollslegends.service.reward.RewardDescription; import ch.gtache.elderscrollslegends.service.reward.RewardDescription;
import java.util.List; import java.util.List;
public record SetChapterDialogResult(List<RewardDescription> rewards) { public record SetChapterDialogResult(ResultCode resultCode, String endpoint,
List<RewardDescription> rewards) {
} }
@@ -1,8 +1,10 @@
package ch.gtache.elderscrollslegends.service.campaign; package ch.gtache.elderscrollslegends.service.campaign;
import ch.gtache.elderscrollslegends.service.ResultCode;
import ch.gtache.elderscrollslegends.service.reward.RewardDescription; import ch.gtache.elderscrollslegends.service.reward.RewardDescription;
import java.util.List; import java.util.List;
public record SetChapterEventResult(List<RewardDescription> rewards) { public record SetChapterEventResult(ResultCode resultCode, String endpoint,
List<RewardDescription> rewards) {
} }
@@ -1,12 +1,15 @@
package ch.gtache.elderscrollslegends.service.chat; package ch.gtache.elderscrollslegends.service.chat;
import ch.gtache.elderscrollslegends.service.BaseEndpoints; import ch.gtache.elderscrollslegends.service.BaseEndpoints;
import ch.gtache.elderscrollslegends.service.BaseResult;
import ch.gtache.elderscrollslegends.service.ResultCode;
import ch.gtache.elderscrollslegends.service.account.AccountService; import ch.gtache.elderscrollslegends.service.account.AccountService;
import jakarta.inject.Inject; import jakarta.inject.Inject;
import jakarta.ws.rs.Consumes; import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.HeaderParam; import jakarta.ws.rs.HeaderParam;
import jakarta.ws.rs.POST; import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path; import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import org.jboss.logging.Logger; import org.jboss.logging.Logger;
import java.util.Objects; import java.util.Objects;
@@ -26,10 +29,12 @@ public class ChatEndpoints extends BaseEndpoints {
@POST @POST
@Path("sendChatMessage") @Path("sendChatMessage")
@Consumes("application/json") @Consumes("application/json")
public void sendChatMessage(@HeaderParam("Authorization") final String authentication, @Produces("application/json")
public BaseResult sendChatMessage(@HeaderParam("Authorization") final String authentication,
final OutgoingMessage message) { final OutgoingMessage message) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("SendChatMessage called by " + steamID + " : " + message); logger.info("SendChatMessage called by " + steamID + " : " + message);
chatService.sendMessage(steamID, message.toBuid(), message.message()); chatService.sendMessage(steamID, message.toBuid(), message.message());
return new BaseResult(ResultCode.Ok);
} }
} }
@@ -2,6 +2,7 @@ package ch.gtache.elderscrollslegends.service.crafting;
import ch.gtache.elderscrollslegends.service.BaseEndpoints; import ch.gtache.elderscrollslegends.service.BaseEndpoints;
import ch.gtache.elderscrollslegends.service.CardService; import ch.gtache.elderscrollslegends.service.CardService;
import ch.gtache.elderscrollslegends.service.ResultCode;
import ch.gtache.elderscrollslegends.service.account.AccountService; import ch.gtache.elderscrollslegends.service.account.AccountService;
import jakarta.inject.Inject; import jakarta.inject.Inject;
import jakarta.ws.rs.Consumes; import jakarta.ws.rs.Consumes;
@@ -38,7 +39,7 @@ public class CraftingEndpoints extends BaseEndpoints {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("SoulTrapExtras called by " + steamID + " : " + request); logger.info("SoulTrapExtras called by " + steamID + " : " + request);
final var soulTrapped = craftingService.soulTrap(steamID, request.priority()); final var soulTrapped = craftingService.soulTrap(steamID, request.priority());
return new SoulTrapExtrasResponse(soulTrapped); return new SoulTrapExtrasResponse(ResultCode.Ok, "", soulTrapped);
} }
@POST @POST
@@ -51,7 +52,7 @@ public class CraftingEndpoints extends BaseEndpoints {
logger.info("Sell called by " + steamID + " : " + request); logger.info("Sell called by " + steamID + " : " + request);
final var card = cardService.getCard(request.typeHash()); final var card = cardService.getCard(request.typeHash());
final var result = craftingService.sell(steamID, card, request.amount(), request.isPremium()); final var result = craftingService.sell(steamID, card, request.amount(), request.isPremium());
return new CraftingResponse(card.hash(), result.totalGems(), result.regularRemaining(), return new CraftingResponse(ResultCode.Ok, "", card.id(), result.totalGems(), result.regularRemaining(),
result.premiumRemaining(), false); result.premiumRemaining(), false);
} }
@@ -65,7 +66,7 @@ public class CraftingEndpoints extends BaseEndpoints {
logger.info("Purchase called by " + steamID + " : " + request); logger.info("Purchase called by " + steamID + " : " + request);
final var card = cardService.getCard(request.typeHash()); final var card = cardService.getCard(request.typeHash());
final var result = craftingService.purchase(steamID, card, request.amount(), request.isPremium()); final var result = craftingService.purchase(steamID, card, request.amount(), request.isPremium());
return new CraftingResponse(card.hash(), result.totalGems(), result.regularRemaining(), return new CraftingResponse(ResultCode.Ok, "", card.id(), result.totalGems(), result.regularRemaining(),
result.premiumRemaining(), false); result.premiumRemaining(), false);
} }
} }
@@ -1,4 +1,7 @@
package ch.gtache.elderscrollslegends.service.crafting; package ch.gtache.elderscrollslegends.service.crafting;
public record CraftingResponse(int cardTypeHash, int gems, int numRegular, int numPremium, boolean ghostedChange) { import ch.gtache.elderscrollslegends.service.ResultCode;
public record CraftingResponse(ResultCode resultCode, String endpoint,
int cardTypeHash, int gems, int numRegular, int numPremium, boolean ghostedChange) {
} }
@@ -1,4 +1,7 @@
package ch.gtache.elderscrollslegends.service.crafting; package ch.gtache.elderscrollslegends.service.crafting;
public record SoulTrapExtrasResponse(int numGems) { import ch.gtache.elderscrollslegends.service.ResultCode;
public record SoulTrapExtrasResponse(ResultCode resultCode, String endpoint,
int numGems) {
} }
@@ -1,4 +1,7 @@
package ch.gtache.elderscrollslegends.service.dailyreward; package ch.gtache.elderscrollslegends.service.dailyreward;
public record AcceptDailyRewardResponse(AcceptDailyRewardResult result) { import ch.gtache.elderscrollslegends.service.ResultCode;
public record AcceptDailyRewardResponse(ResultCode resultCode, String endpoint,
AcceptDailyRewardResult result) {
} }
@@ -1,6 +1,7 @@
package ch.gtache.elderscrollslegends.service.dailyreward; package ch.gtache.elderscrollslegends.service.dailyreward;
import ch.gtache.elderscrollslegends.service.BaseEndpoints; import ch.gtache.elderscrollslegends.service.BaseEndpoints;
import ch.gtache.elderscrollslegends.service.ResultCode;
import ch.gtache.elderscrollslegends.service.account.AccountService; import ch.gtache.elderscrollslegends.service.account.AccountService;
import jakarta.inject.Inject; import jakarta.inject.Inject;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;
@@ -32,7 +33,7 @@ public class DailyRewardsEndpoints extends BaseEndpoints {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("List called by " + steamID); logger.info("List called by " + steamID);
final var rewards = dailyRewardsService.listRewards(steamID); final var rewards = dailyRewardsService.listRewards(steamID);
return new ListDailyRewardsResponse(rewards); return new ListDailyRewardsResponse(ResultCode.Ok, "", rewards);
} }
@POST @POST
@@ -42,6 +43,6 @@ public class DailyRewardsEndpoints extends BaseEndpoints {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("AcceptReward called by " + steamID); logger.info("AcceptReward called by " + steamID);
final var result = dailyRewardsService.acceptReward(steamID); final var result = dailyRewardsService.acceptReward(steamID);
return new AcceptDailyRewardResponse(result); return new AcceptDailyRewardResponse(ResultCode.Ok, "", result);
} }
} }
@@ -1,6 +1,9 @@
package ch.gtache.elderscrollslegends.service.dailyreward; package ch.gtache.elderscrollslegends.service.dailyreward;
import ch.gtache.elderscrollslegends.service.ResultCode;
import java.util.List; import java.util.List;
public record ListDailyRewardsResponse(List<DailyRewardDescription> rewards) { public record ListDailyRewardsResponse(ResultCode resultCode, String endpoint,
List<DailyRewardDescription> rewards) {
} }
@@ -1,14 +1,20 @@
package ch.gtache.elderscrollslegends.service.error; package ch.gtache.elderscrollslegends.service.error;
import ch.gtache.elderscrollslegends.service.BaseEndpoints; import ch.gtache.elderscrollslegends.service.BaseEndpoints;
import ch.gtache.elderscrollslegends.service.BaseResult;
import ch.gtache.elderscrollslegends.service.ResultCode;
import ch.gtache.elderscrollslegends.service.account.AccountService; import ch.gtache.elderscrollslegends.service.account.AccountService;
import jakarta.inject.Inject; import jakarta.inject.Inject;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;
import jakarta.ws.rs.HeaderParam; import jakarta.ws.rs.HeaderParam;
import jakarta.ws.rs.POST; import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path; import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import org.jboss.logging.Logger; import org.jboss.logging.Logger;
import java.util.Objects;
@Path("/errorreporting") @Path("/errorreporting")
public class ErrorEndpoints extends BaseEndpoints { public class ErrorEndpoints extends BaseEndpoints {
@@ -19,21 +25,27 @@ public class ErrorEndpoints extends BaseEndpoints {
@Inject @Inject
ErrorEndpoints(final AccountService accountService, final ErrorService errorService) { ErrorEndpoints(final AccountService accountService, final ErrorService errorService) {
super(accountService); super(accountService);
this.errorService = errorService; this.errorService = Objects.requireNonNull(errorService);
} }
@POST @POST
@Path("reportError") @Path("reportError")
public void reportError(@HeaderParam("Authorization") final String authentication, @Consumes("application/json")
@Produces("application/json")
public BaseResult reportError(@HeaderParam("Authorization") final String authentication,
final ErrorReport errorReport) { final ErrorReport errorReport) {
logger.info("Report error called by " + authentication + " : " + errorReport); final var steamID = authenticateOrThrow(authentication);
errorService.reportError(errorReport.report()); logger.info("Report error called by " + steamID + " : " + errorReport);
errorService.reportError(steamID, errorReport.report());
return new BaseResult(ResultCode.Ok);
} }
@GET @GET
@Path("reportingConfig") @Path("reportingConfig")
@Produces("application/json")
public FetchResponse getReportingConfig(@HeaderParam("Authorization") final String authentication) { public FetchResponse getReportingConfig(@HeaderParam("Authorization") final String authentication) {
logger.info("ReportingConfig called by " + authentication); final var steamID = authenticateOrThrow(authentication);
return new FetchResponse(true); logger.info("ReportingConfig called by " + steamID);
return new FetchResponse(ResultCode.Ok, "", true);
} }
} }
@@ -14,7 +14,7 @@ class ErrorService extends BaseService {
super(dataSource); super(dataSource);
} }
void reportError(final String report) { void reportError(final String steamID, final String report) {
} }
} }
@@ -1,4 +1,7 @@
package ch.gtache.elderscrollslegends.service.error; package ch.gtache.elderscrollslegends.service.error;
public record FetchResponse(boolean enableReporting) { import ch.gtache.elderscrollslegends.service.ResultCode;
public record FetchResponse(ResultCode resultCode, String endpoint,
boolean enableReporting) {
} }
@@ -1,4 +1,6 @@
package ch.gtache.elderscrollslegends.service.events; package ch.gtache.elderscrollslegends.service.events;
public record ContentEntry() { public record ContentEntry(ContentEntryType ContentType, ContentEntryModifier ContentTypeModifier,
int CardTypeHash, String genericInventoryCategory, String genericInventoryItemKey,
int Count) {
} }
@@ -0,0 +1,7 @@
package ch.gtache.elderscrollslegends.service.events;
public enum ContentEntryModifier {
Regular,
Premium,
Legendary,
}
@@ -0,0 +1,80 @@
package ch.gtache.elderscrollslegends.service.events;
public enum ContentEntryType {
deck_guildsworn_premade(-2130065822),
Story_clockwork_act_1(-2081695333),
cardpack_premium_legendary_skyrim(-2055625898),
Story_iom_act_3(-1930544045),
cardpack_premium_legendary_core(-1725187377),
Deck_paarthurnaxs_roar(-1559585206),
deck_warriorsofhammerfell(-1540481132),
deck_zumog_phooms_ambition(-1512805701),
deck_daggerfall_premade(-1482543116),
Collection_forgotten_hero(-1234927939),
CardPack_Oblivion(-1189332835),
CardPack_Alliance_War(-1134307988),
Deck_alduins_apocalypse(-1099276554),
cardpack_legendary_alliancewar(-1079248420),
CardPack_Dark_Brotherhood(-1060524721),
deck_aldmeri_premade(-1020546251),
event_tickets(-932913302),
deck_convenant_armaments(-895245686),
cardpack_legendary_core(-833271125),
CardPack_Core(-780195762),
Story_iom_act_2(-701526946),
CardPack_Elsweyr(-628554270),
Deck_redoran_onslaught(-459319658),
Deck_brynjolfs_heist(-441621356),
Deck_dagoths_might(-393841299),
Deck_hlaalu_schemes(-350943676),
Deck_telvanni_ambition(-260716247),
Collection_mad_prince(-214913246),
Story_clockwork_act_2(-195829567),
Collection_madhouse(-147102545),
cardpack_legendary_elsweyr(-66009394),
EventTicket_OldMethod(0),
SoulGem_OldMethod(1),
Gold_OldMethod(2),
Card(3),
GenericInventory(4),
Story_clockwork_act_3(9898450),
Deck_ancanos_cunning(78535902),
deck_dominion_dominance(80719945),
cardpack_premium_legendary_oblivion(123972390),
Deck_tribunal_glory(185858797),
deck_pact_assault(289889510),
gold(370048465),
Story_dark_brotherhood_act_1(570533001),
Story_dark_brotherhood_act_3(649298583),
deck_guildsworn_prowess(657290049),
deck_ebonheart_premade(722328902),
CardPack_Morrowind(771479791),
Puzzle_divayth_fyrs_trials(875057351),
deck_dunmeravengers(907250839),
CardPack_Skyrim(976836926),
deck_empire_conquest(1053545101),
cardpack_legendary_skyrim(1237593212),
cardpack_premium_legendary_morrowind(1272634621),
cardpack_premium_legendary_alliancewar(1333340848),
Collection_new_life_festival(1379264003),
deck_empire_premade(1389291549),
cardpack_legendary_oblivion(1414942565),
cardpack_premium_legendary_elsweyr(1428958207),
cardpack_legendary_morrowind(1463484932),
Story_dark_brotherhood_act_2(1591190481),
Deck_aelas_companions(1591262042),
Puzzle_naryus_challengesuzzle(1798920449),
Collection_frostfall_premium(1803478726),
CardPack_Clockwork_City(1942964363),
Collection_frostfall(1961349195),
deck_khamiras_rebellion(2038783878),
Story_iom_act_1(2039697399),
deck_imperialmight(2131899676),
gems(2139828615);
private final int hash;
ContentEntryType(final int hash) {
this.hash = hash;
}
}
@@ -1,7 +1,9 @@
package ch.gtache.elderscrollslegends.service.events; package ch.gtache.elderscrollslegends.service.events;
import ch.gtache.elderscrollslegends.service.BaseEndpoints; import ch.gtache.elderscrollslegends.service.BaseEndpoints;
import ch.gtache.elderscrollslegends.service.BaseResult;
import ch.gtache.elderscrollslegends.service.DeckService; import ch.gtache.elderscrollslegends.service.DeckService;
import ch.gtache.elderscrollslegends.service.ResultCode;
import ch.gtache.elderscrollslegends.service.account.AccountService; import ch.gtache.elderscrollslegends.service.account.AccountService;
import jakarta.inject.Inject; import jakarta.inject.Inject;
import jakarta.ws.rs.Consumes; import jakarta.ws.rs.Consumes;
@@ -33,23 +35,27 @@ public class EventsEndpoints extends BaseEndpoints {
@POST @POST
@Path("finalizeEvent") @Path("finalizeEvent")
@Consumes("application/json") @Consumes("application/json")
public void finalizeEvent(@HeaderParam("Authorization") final String authentication, @Produces("application/json")
public BaseResult finalizeEvent(@HeaderParam("Authorization") final String authentication,
final FinalizeEventRequest request) { final FinalizeEventRequest request) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("finalizeEvent called by " + steamID + " : " + request); logger.info("finalizeEvent called by " + steamID + " : " + request);
final var event = eventsService.getEvent(request.eventId()); final var event = eventsService.getEvent(request.eventId());
eventsService.finalizeEvent(steamID, event); eventsService.finalizeEvent(steamID, event);
return new BaseResult(ResultCode.Ok);
} }
@POST @POST
@Path("finalizeEventRun") @Path("finalizeEventRun")
@Consumes("application/json") @Consumes("application/json")
public void finalizeEventRun(@HeaderParam("Authorization") final String authentication, @Produces("application/json")
public BaseResult finalizeEventRun(@HeaderParam("Authorization") final String authentication,
final FinalizeEventRunRequest request) { final FinalizeEventRunRequest request) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("finalizeEventRun called by " + steamID + " : " + request); logger.info("finalizeEventRun called by " + steamID + " : " + request);
final var event = eventsService.getEvent(request.eventId()); final var event = eventsService.getEvent(request.eventId());
eventsService.finalizeEventRun(steamID, event); eventsService.finalizeEventRun(steamID, event);
return new BaseResult(ResultCode.Ok);
} }
@POST @POST
@@ -62,7 +68,7 @@ public class EventsEndpoints extends BaseEndpoints {
logger.info("getEventLeaderboard called by " + steamID + " : " + request); logger.info("getEventLeaderboard called by " + steamID + " : " + request);
final var event = eventsService.getEvent(request.eventId()); final var event = eventsService.getEvent(request.eventId());
final var leaderboard = eventsService.getEventLeaderboard(steamID, event); final var leaderboard = eventsService.getEventLeaderboard(steamID, event);
return new GetEventLeaderboardResponse(event.id(), leaderboard.totalPages(), return new GetEventLeaderboardResponse(ResultCode.Ok, "", event.id(), leaderboard.totalPages(),
leaderboard.userPage(), leaderboard.entries()); leaderboard.userPage(), leaderboard.entries());
} }
@@ -70,38 +76,40 @@ public class EventsEndpoints extends BaseEndpoints {
@Path("purchaseEvent") @Path("purchaseEvent")
@Consumes("application/json") @Consumes("application/json")
@Produces("application/json") @Produces("application/json")
public PurchaseEventResult purchaseEvent(@HeaderParam("Authorization") final String authentication, public BaseResult purchaseEvent(@HeaderParam("Authorization") final String authentication,
final PurchaseEventRequest request) { final PurchaseEventRequest request) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("purchaseEvent called by " + steamID + " : " + request); logger.info("purchaseEvent called by " + steamID + " : " + request);
final var event = eventsService.getEvent(request.eventId()); final var event = eventsService.getEvent(request.eventId());
eventsService.purchaseEvent(steamID, event, request.purchaseType()); eventsService.purchaseEvent(steamID, event, request.purchaseType());
return new PurchaseEventResult(); return new BaseResult(ResultCode.Ok);
} }
@POST @POST
@Path("purchaseEventRun") @Path("purchaseEventRun")
@Consumes("application/json") @Consumes("application/json")
@Produces("application/json") @Produces("application/json")
public PurchaseEventRunResult purchaseEventRun(@HeaderParam("Authorization") final String authentication, public BaseResult purchaseEventRun(@HeaderParam("Authorization") final String authentication,
final PurchaseEventRunRequest request) { final PurchaseEventRunRequest request) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("purchaseEvent called by " + steamID + " : " + request); logger.info("purchaseEvent called by " + steamID + " : " + request);
final var event = eventsService.getEvent(request.eventId()); final var event = eventsService.getEvent(request.eventId());
eventsService.purchaseEventRun(steamID, event, request.purchaseType()); eventsService.purchaseEventRun(steamID, event, request.purchaseType());
return new PurchaseEventRunResult(); return new BaseResult(ResultCode.Ok);
} }
@POST @POST
@Path("selectExplicitDeck") @Path("selectExplicitDeck")
@Consumes("application/json") @Consumes("application/json")
public void selectExplicitDeck(@HeaderParam("Authorization") final String authentication, @Produces("application/json")
public BaseResult selectExplicitDeck(@HeaderParam("Authorization") final String authentication,
final SelectExplicitDeckRequest request) { final SelectExplicitDeckRequest request) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("selectExplicitDeck called by " + steamID + " : " + request); logger.info("selectExplicitDeck called by " + steamID + " : " + request);
final var event = eventsService.getEvent(request.eventId()); final var event = eventsService.getEvent(request.eventId());
final var deck = deckService.getDeck(steamID, request.deckTypeHash()); final var deck = deckService.getDeck(steamID, request.deckTypeHash());
eventsService.selectExplicitDeck(steamID, event, deck); eventsService.selectExplicitDeck(steamID, event, deck);
return new BaseResult(ResultCode.Ok);
} }
@POST @POST
@@ -114,7 +122,7 @@ public class EventsEndpoints extends BaseEndpoints {
logger.info("getEventLeaderboardRank called by " + steamID + " : " + request); logger.info("getEventLeaderboardRank called by " + steamID + " : " + request);
final var event = eventsService.getEvent(request.eventId()); final var event = eventsService.getEvent(request.eventId());
final var ranking = eventsService.updateEventLeaderboardRank(steamID, event); final var ranking = eventsService.updateEventLeaderboardRank(steamID, event);
return new UpdateEventLeaderboardRankResponse(event.id(), ranking); return new UpdateEventLeaderboardRankResponse(ResultCode.Ok, "", event.id(), ranking);
} }
@GET @GET
@@ -124,6 +132,6 @@ public class EventsEndpoints extends BaseEndpoints {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("fetchEvents called by " + steamID); logger.info("fetchEvents called by " + steamID);
final var events = eventsService.getEvents(steamID); final var events = eventsService.getEvents(steamID);
return new ListEventsResponse(events); return new ListEventsResponse(ResultCode.Ok, "", events);
} }
} }
@@ -1,6 +1,9 @@
package ch.gtache.elderscrollslegends.service.events; package ch.gtache.elderscrollslegends.service.events;
import ch.gtache.elderscrollslegends.service.ResultCode;
import java.util.List; import java.util.List;
public record GetEventLeaderboardResponse(long eventId, long totalPages, long userPage, List<LeaderboardEntry> list) { public record GetEventLeaderboardResponse(ResultCode resultCode, String endpoint,
long eventId, long totalPages, long userPage, List<LeaderboardEntry> list) {
} }
@@ -1,4 +1,7 @@
package ch.gtache.elderscrollslegends.service.events; package ch.gtache.elderscrollslegends.service.events;
public record ListEventsResponse(EventDescriptionStruct eventDescription) { import ch.gtache.elderscrollslegends.service.ResultCode;
public record ListEventsResponse(ResultCode resultCode, String endpoint,
EventDescriptionStruct eventDescription) {
} }
@@ -1,4 +0,0 @@
package ch.gtache.elderscrollslegends.service.events;
public record PurchaseEventResult() {
}
@@ -1,4 +0,0 @@
package ch.gtache.elderscrollslegends.service.events;
public record PurchaseEventRunResult() {
}
@@ -1,4 +1,7 @@
package ch.gtache.elderscrollslegends.service.events; package ch.gtache.elderscrollslegends.service.events;
public record UpdateEventLeaderboardRankResponse(long eventId, long ranking) { import ch.gtache.elderscrollslegends.service.ResultCode;
public record UpdateEventLeaderboardRankResponse(ResultCode resultCode, String endpoint,
long eventId, long ranking) {
} }
@@ -30,13 +30,13 @@ public class FriendsEndpoints extends BaseEndpoints {
@GET @GET
@Consumes("application/json") @Consumes("application/json")
@Produces("application/json") @Produces("application/json")
public FriendsResponse get(@HeaderParam("Authorization") final String authentication, public FriendsResponse get(@HeaderParam("x-session-token") final String authentication,
@QueryParam("product_id") final String productId, @QueryParam("product_id") final String productId,
@QueryParam("start_keys") final int startKeys, @QueryParam("start_keys") final int startKeys,
@QueryParam("size") final int size, @QueryParam("size") final int size,
@QueryParam("language") final String language, @QueryParam("language") final String language,
@QueryParam("detail") final String detail) { @QueryParam("detail") final String detail) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateTokenOrThrow(authentication);
logger.info("get called by " + steamID + " : " + productId + " ; " + startKeys + " ; " + size + " ; " + language + " ; " + detail); logger.info("get called by " + steamID + " : " + productId + " ; " + startKeys + " ; " + size + " ; " + language + " ; " + detail);
return new FriendsResponse(List.of(), 0, 0); return new FriendsResponse(List.of(), 0, 0);
} }
@@ -45,9 +45,9 @@ public class FriendsEndpoints extends BaseEndpoints {
@Path("/unfriend") @Path("/unfriend")
@Consumes("application/json") @Consumes("application/json")
@Produces("application/json") @Produces("application/json")
public ActionResponse unfriend(@HeaderParam("Authorization") final String authentication, public ActionResponse unfriend(@HeaderParam("x-session-token") final String authentication,
final ActionBody request) { final ActionBody request) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateTokenOrThrow(authentication);
logger.info("unfriend called by " + steamID + " : " + request); logger.info("unfriend called by " + steamID + " : " + request);
for (final var buid : request.buids()) { for (final var buid : request.buids()) {
friendsService.unfriend(steamID, buid); friendsService.unfriend(steamID, buid);
@@ -59,13 +59,13 @@ public class FriendsEndpoints extends BaseEndpoints {
@Path("/block") @Path("/block")
@Consumes("application/json") @Consumes("application/json")
@Produces("application/json") @Produces("application/json")
public BlockedResponse getBlocked(@HeaderParam("Authorization") final String authentication, public BlockedResponse getBlocked(@HeaderParam("x-session-token") final String authentication,
@QueryParam("product_id") final String productId, @QueryParam("product_id") final String productId,
@QueryParam("start_keys") final int startKeys, @QueryParam("start_keys") final int startKeys,
@QueryParam("size") final int size, @QueryParam("size") final int size,
@QueryParam("language") final String language, @QueryParam("language") final String language,
@QueryParam("detail") final String detail) { @QueryParam("detail") final String detail) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateTokenOrThrow(authentication);
logger.info("getBlocked called by " + steamID + " : " + productId + " ; " + startKeys + " ; " + size + " ; " + language + " ; " + detail); logger.info("getBlocked called by " + steamID + " : " + productId + " ; " + startKeys + " ; " + size + " ; " + language + " ; " + detail);
return new BlockedResponse(List.of(), 0, 0); return new BlockedResponse(List.of(), 0, 0);
} }
@@ -74,9 +74,9 @@ public class FriendsEndpoints extends BaseEndpoints {
@Path("/block") @Path("/block")
@Consumes("application/json") @Consumes("application/json")
@Produces("application/json") @Produces("application/json")
public ActionResponse block(@HeaderParam("Authorization") final String authentication, public ActionResponse block(@HeaderParam("x-session-token") final String authentication,
final ActionBody request) { final ActionBody request) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateTokenOrThrow(authentication);
logger.info("block called by " + steamID + " : " + request); logger.info("block called by " + steamID + " : " + request);
for (final var buid : request.buids()) { for (final var buid : request.buids()) {
friendsService.block(steamID, buid); friendsService.block(steamID, buid);
@@ -88,9 +88,9 @@ public class FriendsEndpoints extends BaseEndpoints {
@Path("/unblock") @Path("/unblock")
@Consumes("application/json") @Consumes("application/json")
@Produces("application/json") @Produces("application/json")
public ActionResponse unblock(@HeaderParam("Authorization") final String authentication, public ActionResponse unblock(@HeaderParam("x-session-token") final String authentication,
final ActionBody request) { final ActionBody request) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateTokenOrThrow(authentication);
logger.info("unblock called by " + steamID + " : " + request); logger.info("unblock called by " + steamID + " : " + request);
for (final var buid : request.buids()) { for (final var buid : request.buids()) {
friendsService.unblock(steamID, buid); friendsService.unblock(steamID, buid);
@@ -110,10 +110,10 @@ public class FriendsEndpoints extends BaseEndpoints {
@Path("/requests") @Path("/requests")
@Consumes("application/json") @Consumes("application/json")
@Produces("application/json") @Produces("application/json")
public RequestsResponse getRequests(@HeaderParam("Authorization") final String authentication, public RequestsResponse getRequests(@HeaderParam("x-session-token") final String authentication,
@QueryParam("start_keys") final int startKeys, @QueryParam("start_keys") final int startKeys,
@QueryParam("size") final int size) { @QueryParam("size") final int size) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateTokenOrThrow(authentication);
logger.info("getRequests called by " + steamID + " : " + startKeys + " ; " + size); logger.info("getRequests called by " + steamID + " : " + startKeys + " ; " + size);
return new RequestsResponse(List.of(), 0); return new RequestsResponse(List.of(), 0);
} }
@@ -122,9 +122,9 @@ public class FriendsEndpoints extends BaseEndpoints {
@Path("/requests") @Path("/requests")
@Consumes("application/json") @Consumes("application/json")
@Produces("application/json") @Produces("application/json")
public ActionResponse requests(@HeaderParam("Authorization") final String authentication, public ActionResponse requests(@HeaderParam("x-session-token") final String authentication,
final ActionBody requests) { final ActionBody requests) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateTokenOrThrow(authentication);
logger.info("requests called by " + steamID); logger.info("requests called by " + steamID);
for (final var buid : requests.buids()) { for (final var buid : requests.buids()) {
friendsService.sendRequest(steamID, buid); friendsService.sendRequest(steamID, buid);
@@ -136,9 +136,9 @@ public class FriendsEndpoints extends BaseEndpoints {
@Path("/requests/cancel") @Path("/requests/cancel")
@Consumes("application/json") @Consumes("application/json")
@Produces("application/json") @Produces("application/json")
public ActionResponse cancelRequest(@HeaderParam("Authorization") final String authentication, public ActionResponse cancelRequest(@HeaderParam("x-session-token") final String authentication,
final ActionBody request) { final ActionBody request) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateTokenOrThrow(authentication);
logger.info("cancelRequest called by " + steamID + " : " + request); logger.info("cancelRequest called by " + steamID + " : " + request);
for (final var buid : request.buids()) { for (final var buid : request.buids()) {
friendsService.cancelRequest(steamID, buid); friendsService.cancelRequest(steamID, buid);
@@ -150,9 +150,9 @@ public class FriendsEndpoints extends BaseEndpoints {
@Path("/requests/accept") @Path("/requests/accept")
@Consumes("application/json") @Consumes("application/json")
@Produces("application/json") @Produces("application/json")
public ActionResponse acceptRequest(@HeaderParam("Authorization") final String authentication, public ActionResponse acceptRequest(@HeaderParam("x-session-token") final String authentication,
final ActionBody request) { final ActionBody request) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateTokenOrThrow(authentication);
logger.info("acceptRequest called by " + steamID + " : " + request); logger.info("acceptRequest called by " + steamID + " : " + request);
for (final var buid : request.buids()) { for (final var buid : request.buids()) {
friendsService.acceptRequest(steamID, buid); friendsService.acceptRequest(steamID, buid);
@@ -164,9 +164,9 @@ public class FriendsEndpoints extends BaseEndpoints {
@Path("/requests/reject") @Path("/requests/reject")
@Consumes("application/json") @Consumes("application/json")
@Produces("application/json") @Produces("application/json")
public ActionResponse rejectRequest(@HeaderParam("Authorization") final String authentication, public ActionResponse rejectRequest(@HeaderParam("x-session-token") final String authentication,
final ActionBody request) { final ActionBody request) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateTokenOrThrow(authentication);
logger.info("rejectRequest called by " + steamID + " : " + request); logger.info("rejectRequest called by " + steamID + " : " + request);
for (final var buid : request.buids()) { for (final var buid : request.buids()) {
friendsService.rejectRequest(steamID, buid); friendsService.rejectRequest(steamID, buid);
@@ -178,12 +178,11 @@ public class FriendsEndpoints extends BaseEndpoints {
@Path("/requests/sent") @Path("/requests/sent")
@Consumes("application/json") @Consumes("application/json")
@Produces("application/json") @Produces("application/json")
public SentRequestsResponse getSentRequests(@HeaderParam("Authorization") final String authentication, public SentRequestsResponse getSentRequests(@HeaderParam("x-session-token") final String authentication,
@QueryParam("start_keys") final int startKeys, @QueryParam("start_keys") final int startKeys,
@QueryParam("size") final int size, @QueryParam("size") final int size) {
final ActionBody request) { final var steamID = authenticateTokenOrThrow(authentication);
final var steamID = authenticateOrThrow(authentication); logger.info("getSentRequests called by " + steamID + " : " + startKeys + " ; " + size);
logger.info("getSentRequests called by " + steamID + " : " + startKeys + " ; " + size + " ; " + request);
return new SentRequestsResponse(List.of(), 0); return new SentRequestsResponse(List.of(), 0);
} }
@@ -191,12 +190,12 @@ public class FriendsEndpoints extends BaseEndpoints {
@Path("/search") @Path("/search")
@Consumes("application/json") @Consumes("application/json")
@Produces("application/json") @Produces("application/json")
public SearchResponse search(@HeaderParam("Authorization") final String authentication, public SearchResponse search(@HeaderParam("x-session-token") final String authentication,
@QueryParam("search_term") final String searchTerm, @QueryParam("search_term") final String searchTerm,
@QueryParam("start_keys") final int startKeys, @QueryParam("start_keys") final int startKeys,
@QueryParam("size") final int size, @QueryParam("size") final int size,
final ActionBody request) { final ActionBody request) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateTokenOrThrow(authentication);
logger.info("search called by " + steamID + " : " + searchTerm + " ; " + startKeys + " ; " + size + " ; " + request); logger.info("search called by " + steamID + " : " + searchTerm + " ; " + startKeys + " ; " + size + " ; " + request);
return new SearchResponse(List.of(), 0); return new SearchResponse(List.of(), 0);
} }
@@ -0,0 +1,76 @@
package ch.gtache.elderscrollslegends.service.inventory;
public enum Cardback {
Default,
HousesOfMorrowind,
Scale,
CaiusTraining,
NaryusChallenges,
DivaythFyrsTrials,
HouseHlaalu,
HouseRedoran,
TribunalTemple,
HouseTelvanni,
HouseDagoth,
NerevarReborn,
Legend,
ClockworkCity,
DarkBrotherhood,
EldenRoot,
FlameAtronach,
StormAtronach,
Twitch2018,
NewClient,
MadnessSalePremium1,
MadnessSalePremium2,
PrinceOfMadness,
PrinceOfMadnessPremium,
IsleOfMadnessSaint,
LegendPremium,
LegendAltPremium,
ElderScrolls25thAnniversary,
AllianceWarPremium,
LocalContenderPremium,
AllianceWarCollector,
AllianceWarDaggerfall,
AllianceWarEbonheart,
AllianceWarAldmeri,
AllianceWarGuildsworn,
AllianceWarEmpire,
E32019,
ElsweyrPreorder,
SageIntro,
SageCollector,
SageLich,
SageCrossPromo,
OblivionPreorder,
CadwellNormal,
CadwellPremium,
ColdharbourNormal,
ColdharbourPremium,
JawsIntro,
JawsCollector,
JawsSeptim,
EventsShiveringNormal,
EventsShiveringPremium,
EventsSteedNormal,
EventsSteedPremium,
EventsGrayFoxNormal,
EventsGrayFoxPremium,
EventsFightersNormal,
EventsFightersPremium,
EventsMagesNormal,
EventsMagesPremium,
EventsThievesNormal,
EventsThievesPremium,
FutureEvents1Regular,
FutureEvents1Premium,
FutureEvents2Regular,
FutureEvents2Premium,
FutureEvents3Regular,
FutureEvents3Premium,
FutureEvents4Regular,
FutureEvents4Premium,
FutureEvents5Regular,
FutureEvents5Premium,
}
@@ -2,6 +2,6 @@ package ch.gtache.elderscrollslegends.service.inventory;
import java.util.List; import java.util.List;
public record CategoryData(String category, String selected, List<String> available, public record CategoryData(GenericInventoryCategory category, String selected, List<String> available,
List<String> locked, List<String> descriptions) { List<String> locked, List<String> descriptions) {
} }
@@ -3,5 +3,5 @@ package ch.gtache.elderscrollslegends.service.inventory;
import java.util.List; import java.util.List;
public record Deck(long id, String displayName, boolean hasBeenSeen, boolean isValid, boolean isLocked, public record Deck(long id, String displayName, boolean hasBeenSeen, boolean isValid, boolean isLocked,
boolean renameFromuser, int artTypeHash, int deckTypeHash, List<DeckCard> cards, long eventId) { boolean renameFromUser, int artTypeHash, int deckTypeHash, List<DeckCard> cards, long eventId) {
} }
@@ -0,0 +1,7 @@
package ch.gtache.elderscrollslegends.service.inventory;
public enum GenericInventoryCategory {
avatar,
cardback,
title,
}
@@ -1,11 +1,15 @@
package ch.gtache.elderscrollslegends.service.inventory; package ch.gtache.elderscrollslegends.service.inventory;
import ch.gtache.elderscrollslegends.service.BaseEndpoints; import ch.gtache.elderscrollslegends.service.BaseEndpoints;
import ch.gtache.elderscrollslegends.service.BaseResult;
import ch.gtache.elderscrollslegends.service.ResultCode;
import ch.gtache.elderscrollslegends.service.account.AccountService; import ch.gtache.elderscrollslegends.service.account.AccountService;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;
import jakarta.ws.rs.HeaderParam; import jakarta.ws.rs.HeaderParam;
import jakarta.ws.rs.POST; import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path; import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import org.jboss.logging.Logger; import org.jboss.logging.Logger;
import java.util.Objects; import java.util.Objects;
@@ -25,18 +29,26 @@ public class GenericInventoryEndpoints extends BaseEndpoints {
@GET @GET
@Path("fetch") @Path("fetch")
public InventoryFetchResponse fetch(@HeaderParam("Authorization") final String authentication) { @Produces("application/json")
public GenericInventoryFetchResponse fetch(@HeaderParam("Authorization") final String authentication) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("fetch called by " + steamID); logger.info("fetch called by " + steamID);
return new InventoryFetchResponse(genericsInventoryService.getInventory(steamID)); final var data = genericsInventoryService.getInventory(steamID);
return new GenericInventoryFetchResponse(ResultCode.Ok, "", data);
} }
@POST @POST
@Path("setSelected") @Path("setSelected")
public void setSelected(@HeaderParam("Authorization") final String authentication, @Consumes("application/json")
@Produces("application/json")
public BaseResult setSelected(@HeaderParam("Authorization") final String authentication,
final InventorySetSelectedRequest request) { final InventorySetSelectedRequest request) {
final var steamID = authenticateOrThrow(authentication); final var steamID = authenticateOrThrow(authentication);
logger.info("setSelected called by " + steamID); logger.info("setSelected called by " + steamID);
genericsInventoryService.setSelected(steamID, request.category(), request.itemKey()); if (genericsInventoryService.setSelected(steamID, request.category(), request.itemKey())) {
return new BaseResult(ResultCode.Ok);
} else {
return new BaseResult(ResultCode.InternalError);
}
} }
} }
@@ -0,0 +1,9 @@
package ch.gtache.elderscrollslegends.service.inventory;
import ch.gtache.elderscrollslegends.service.ResultCode;
import java.util.List;
public record GenericInventoryFetchResponse(ResultCode resultCode, String endpoint,
List<CategoryData> categories) {
}
@@ -3,23 +3,109 @@ package ch.gtache.elderscrollslegends.service.inventory;
import ch.gtache.elderscrollslegends.service.BaseService; import ch.gtache.elderscrollslegends.service.BaseService;
import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject; import jakarta.inject.Inject;
import org.jboss.logging.Logger;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.EnumMap;
import java.util.List; import java.util.List;
@ApplicationScoped @ApplicationScoped
class GenericsInventoryService extends BaseService { class GenericsInventoryService extends BaseService {
private static final Logger logger = Logger.getLogger(GenericsInventoryService.class);
private static final String GET_INVENTORY = "SELECT a.name, c.name, t.name FROM profile p " +
"LEFT JOIN avatar a ON p.avatar_id=a.id LEFT JOIN cardback c ON p.cardback_id=c.id " +
"LEFT JOIN title t ON p.title_id=t.id WHERE p.player_id=(SELECT id FROM player WHERE steam_id=?)";
@Inject @Inject
GenericsInventoryService(final DataSource dataSource) { GenericsInventoryService(final DataSource dataSource) {
super(dataSource); super(dataSource);
} }
List<CategoryData> getInventory(final String steamID) { List<CategoryData> getInventory(final String steamID) {
return List.of(); final var steamIDHandle = Long.parseLong(steamID);
final var mapping = new EnumMap<GenericInventoryCategory, String>(GenericInventoryCategory.class);
final var data = new ArrayList<CategoryData>(3);
try (final var connection = dataSource().getConnection()) {
try (final var statement = connection.prepareStatement(GET_INVENTORY)) {
statement.setLong(1, steamIDHandle);
try (final var rs = statement.executeQuery()) {
if (rs.next()) {
final var avatar = rs.getString(1);
final var cardback = rs.getString(2);
final var title = rs.getString(3);
mapping.put(GenericInventoryCategory.avatar, avatar);
mapping.put(GenericInventoryCategory.cardback, cardback);
mapping.put(GenericInventoryCategory.title, title);
}
}
}
for (final var value : GenericInventoryCategory.values()) {
final var table = value.name();
try (final var statement = connection.prepareStatement("SELECT t.name, t.description, pt.available, pt.locked FROM " + table + " t " +
"JOIN player_" + table + " pt ON t.id=pt." + table + "_id " +
"JOIN player p ON pt.player_id=p.id WHERE p.steam_id=?")) {
statement.setLong(1, steamIDHandle);
try (final var rs = statement.executeQuery()) {
final var list = new ArrayList<Data>();
while (rs.next()) {
final var name = rs.getString(1);
final var description = rs.getString(2);
final var available = rs.getBoolean(3);
final var locked = rs.getBoolean(4);
list.add(new Data(name, description, available, locked));
}
final var available = list.stream().filter(Data::available).map(Data::name).toList();
final var locked = list.stream().filter(Data::locked).map(Data::name).toList();
final var descriptions = list.stream().map(Data::description).toList();
data.add(new CategoryData(value, mapping.get(value), available, locked, descriptions));
}
}
}
} catch (final SQLException e) {
logger.error("Error getting data for " + steamID, e);
}
return data;
} }
void setSelected(final String steamID, final String category, final String itemKey) { private record Data(String name, String description, boolean available, boolean locked) {
} }
String getSelected(final String steamID, final GenericInventoryCategory category) {
final var steamIDHandle = Long.parseLong(steamID);
final var table = category.name();
final var field = table + "_id";
try (final var connection = dataSource().getConnection();
final var statement = connection.prepareStatement("SELECT t.name FROM " + table + " t JOIN profile p ON p." + field + "=t.id WHERE player_id=(SELECT id FROM player WHERE steam_id=?)")) {
statement.setLong(1, steamIDHandle);
try (final var rs = statement.executeQuery()) {
if (rs.next()) {
return rs.getString(1);
}
}
} catch (final SQLException e) {
logger.error("Error getting " + category + " for " + steamID, e);
}
return null;
}
boolean setSelected(final String steamID, final GenericInventoryCategory category, final String itemKey) {
final var steamIDHandle = Long.parseLong(steamID);
final var table = category.name();
final var field = table + "_id";
try (final var connection = dataSource().getConnection();
final var statement = connection.prepareStatement("UPDATE profile SET " + field + "=(SELECT id FROM " + table + " WHERE name=?) WHERE player_id=(SELECT id FROM player WHERE steam_id=?)")) {
statement.setString(1, itemKey);
statement.setLong(2, steamIDHandle);
return statement.executeUpdate() == 1;
} catch (final SQLException e) {
logger.error("Error setting " + category + " for " + steamID, e);
}
return false;
}
} }
@@ -1,4 +1,7 @@
package ch.gtache.elderscrollslegends.service.inventory; package ch.gtache.elderscrollslegends.service.inventory;
public record InventoryCreateDeckResponse(long deckId) { import ch.gtache.elderscrollslegends.service.ResultCode;
public record InventoryCreateDeckResponse(ResultCode resultCode, String endpoint,
long deckId) {
} }
@@ -1,20 +1,43 @@
package ch.gtache.elderscrollslegends.service.inventory; package ch.gtache.elderscrollslegends.service.inventory;
import ch.gtache.elderscrollslegends.service.BaseEndpoints;
import ch.gtache.elderscrollslegends.service.BaseResult;
import ch.gtache.elderscrollslegends.service.DeckService;
import ch.gtache.elderscrollslegends.service.ResultCode;
import ch.gtache.elderscrollslegends.service.account.AccountService;
import jakarta.inject.Inject;
import jakarta.ws.rs.Consumes; import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;
import jakarta.ws.rs.HeaderParam; import jakarta.ws.rs.HeaderParam;
import jakarta.ws.rs.POST; import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path; import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces; import jakarta.ws.rs.Produces;
import org.jboss.logging.Logger;
import static java.util.Objects.requireNonNull;
@Path("inventory") @Path("inventory")
public class InventoryEndpoints { public class InventoryEndpoints extends BaseEndpoints {
private static final Logger logger = Logger.getLogger(InventoryEndpoints.class);
private final InventoryService inventoryService;
private final DeckService deckService;
@Inject
InventoryEndpoints(final AccountService accountService, final InventoryService inventoryService,
final DeckService deckService) {
super(accountService);
this.inventoryService = requireNonNull(inventoryService);
this.deckService = requireNonNull(deckService);
}
@GET @GET
@Path("list_v2") @Path("list_v2")
@Produces("application/json") @Produces("application/json")
public InventoryListResponse list(@HeaderParam("Authorization") final String authentication) { public InventoryListResponse list(@HeaderParam("Authorization") final String authentication) {
return null; final var steamID = authenticateOrThrow(authentication);
logger.info("list called by " + steamID);
return new InventoryListResponse(ResultCode.Ok, "", inventoryService.getInventory(steamID));
} }
@POST @POST
@@ -23,15 +46,22 @@ public class InventoryEndpoints {
@Produces("application/json") @Produces("application/json")
public InventoryCreateDeckResponse createDeck(@HeaderParam("Authorization") final String authentication, public InventoryCreateDeckResponse createDeck(@HeaderParam("Authorization") final String authentication,
final InventoryCreateDeckRequest request) { final InventoryCreateDeckRequest request) {
return null; final var steamID = authenticateOrThrow(authentication);
logger.info("createDeck called by " + steamID + " : " + request);
final var createdDeck = deckService.createDeck(steamID, request.displayName());
return new InventoryCreateDeckResponse(ResultCode.Ok, "", createdDeck);
} }
@POST @POST
@Path("deleteDeck") @Path("deleteDeck")
@Consumes("application/json") @Consumes("application/json")
@Produces("application/json") @Produces("application/json")
public void deleteDeck(@HeaderParam("Authorization") final String authentication, public BaseResult deleteDeck(@HeaderParam("Authorization") final String authentication,
final InventoryDeleteDeckRequest request) { final InventoryDeleteDeckRequest request) {
final var steamID = authenticateOrThrow(authentication);
logger.info("deleteDeck called by " + steamID + " : " + request);
deckService.deleteDeck(steamID, request.deckId());
return new BaseResult(ResultCode.Ok);
} }
@POST @POST
@@ -40,7 +70,10 @@ public class InventoryEndpoints {
@Produces("application/json") @Produces("application/json")
public InventorySaveResult saveDeck(@HeaderParam("Authorization") final String authentication, public InventorySaveResult saveDeck(@HeaderParam("Authorization") final String authentication,
final Deck request) { final Deck request) {
return null; final var steamID = authenticateOrThrow(authentication);
logger.info("saveDeck called by " + steamID + " : " + request);
final var success = deckService.saveDeck(steamID, request);
return new InventorySaveResult(ResultCode.Ok, "", success);
} }
@POST @POST
@@ -49,8 +82,9 @@ public class InventoryEndpoints {
@Produces("application/json") @Produces("application/json")
public InventorySaveResult setSeens(@HeaderParam("Authorization") final String authentication, public InventorySaveResult setSeens(@HeaderParam("Authorization") final String authentication,
final InventorySetSeens request) { final InventorySetSeens request) {
return null; final var steamID = authenticateOrThrow(authentication);
logger.info("setSeens called by " + steamID + " : " + request);
final var success = inventoryService.setSeens(steamID, request);
return new InventorySaveResult(ResultCode.Ok, "", success);
} }
} }
@@ -1,6 +0,0 @@
package ch.gtache.elderscrollslegends.service.inventory;
import java.util.List;
public record InventoryFetchResponse(List<CategoryData> categories) {
}
@@ -1,4 +1,7 @@
package ch.gtache.elderscrollslegends.service.inventory; package ch.gtache.elderscrollslegends.service.inventory;
public record InventoryListResponse(InventoryDescLoadable inventory) { import ch.gtache.elderscrollslegends.service.ResultCode;
public record InventoryListResponse(ResultCode resultCode, String endpoint,
InventoryDescLoadable inventory) {
} }
@@ -1,4 +1,7 @@
package ch.gtache.elderscrollslegends.service.inventory; package ch.gtache.elderscrollslegends.service.inventory;
public record InventorySaveResult(boolean success) { import ch.gtache.elderscrollslegends.service.ResultCode;
public record InventorySaveResult(ResultCode resultCode, String endpoint,
boolean success) {
} }
@@ -0,0 +1,25 @@
package ch.gtache.elderscrollslegends.service.inventory;
import ch.gtache.elderscrollslegends.service.BaseService;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import javax.sql.DataSource;
import java.util.List;
@ApplicationScoped
class InventoryService extends BaseService {
@Inject
InventoryService(final DataSource dataSource) {
super(dataSource);
}
InventoryDescLoadable getInventory(final String steamID) {
return new InventoryDescLoadable(10, List.of(), List.of());
}
boolean setSeens(final String steamID, final InventorySetSeens request) {
return true;
}
}
@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.inventory; package ch.gtache.elderscrollslegends.service.inventory;
public record InventorySetSelectedRequest(String category, String itemKey) { public record InventorySetSelectedRequest(GenericInventoryCategory category, String itemKey) {
} }

Some files were not shown because too many files have changed in this diff Show More