-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix league game submission failing with the Windows Store version of …
…the game
- Loading branch information
1 parent
57670ca
commit 1a4b280
Showing
6 changed files
with
72 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include <Core/api/game/game.h> | ||
#include <Core/api/system/save_files.h> | ||
#include <Core/utils/byte_stream.h> | ||
#include <Modloader/app/methods/Grdk/Wrapper.h> | ||
#include <Modloader/app/methods/SaveGameController.h> | ||
#include <Modloader/app/methods/System/IO/File.h> | ||
|
||
using namespace app::classes; | ||
|
||
namespace core::api::save_files { | ||
app::Byte__Array* get_byte_array(int slot_index, int backup_index) { | ||
if (Grdk::Wrapper::get_InitializedOk()) { // Handle GRDK (Xbox Account) saves | ||
return Grdk::Wrapper::Load_1(slot_index, backup_index); | ||
} | ||
|
||
auto save_info = SaveGameController::GetSaveFileInfo(game::save_controller(), slot_index, backup_index); | ||
auto path = save_info->fields.m_FullBackupSaveFilePath; | ||
auto path_str = il2cpp::convert_csstring(path); | ||
return System::IO::File::ReadAllBytes(path); | ||
} | ||
|
||
std::vector<std::byte> get_bytes(int slot_index, int backup_index) { | ||
return utils::ByteStream(get_byte_array(slot_index, backup_index)).peek_to_end(); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#pragma once | ||
|
||
#include <vector> | ||
|
||
namespace core::api::save_files { | ||
/** | ||
* Get the on-disk save data for a save file. | ||
* @param slot_index Save slot index | ||
* @param backup_index Backup slot index. Set this to -1 to request the current game save file. | ||
* @return Pointer to an il2cpp array of System.Byte. | ||
*/ | ||
CORE_DLLEXPORT app::Byte__Array* get_byte_array(int slot_index, int backup_index = -1); | ||
|
||
/** | ||
* Get the on-disk save data for a save file. | ||
* @param slot_index Save slot index | ||
* @param backup_index Backup slot index. Set this to -1 to request the current game save file. | ||
* @return Byte vector containing the on-disk save data | ||
*/ | ||
CORE_DLLEXPORT std::vector<std::byte> get_bytes(int slot_index, int backup_index = -1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters