From 2ab2a65ae17952fc7cfd10dd9a6bc8c0ceb1de6e Mon Sep 17 00:00:00 2001 From: illusion0001 <37698908+illusion0001@users.noreply.github.com> Date: Wed, 26 Jul 2023 23:06:49 -0500 Subject: [PATCH] Remove anti piracy message --- src/xenia/emulator.cc | 66 +++++-------------------------------------- src/xenia/emulator.h | 4 +-- src/xenia/xbox.h | 4 +-- 3 files changed, 10 insertions(+), 64 deletions(-) diff --git a/src/xenia/emulator.cc b/src/xenia/emulator.cc index f9b9900cf..f4b3ff794 100644 --- a/src/xenia/emulator.cc +++ b/src/xenia/emulator.cc @@ -114,9 +114,15 @@ Emulator::Emulator(const std::filesystem::path& command_line, // show the quickstart guide the first time they ever open the emulator uint64_t persistent_flags = GetPersistentEmulatorFlags(); if (!(persistent_flags & EmulatorFlagQuickstartShown)) { +#if XE_PLATFORM_WIN32 == 1 + if (MessageBoxW(nullptr, L"Xenia does not support or condone piracy in anyway shape or form\nDo you want to open the quickstart guide?", L"Xenia", MB_YESNO | MB_ICONQUESTION) == IDYES) { +#endif LaunchWebBrowser( "https://github.com/xenia-canary/xenia-canary/wiki/Quickstart#how-to-rip-games"); SetPersistentEmulatorFlags(persistent_flags | EmulatorFlagQuickstartShown); +#if XE_PLATFORM_WIN32 == 1 + } +#endif } } @@ -305,18 +311,7 @@ const std::unique_ptr Emulator::CreateVfsDeviceBasedOnPath( return std::make_unique( mount_path, parent_path, !cvars::allow_game_relative_writes); } else if (extension == ".7z" || extension == ".zip" || extension == ".rar") { - xe::ShowSimpleMessageBox( - xe::SimpleMessageBoxType::Error, - fmt::format("Xenia does not support running {} files, the file you " - "actually want to run is inside of this {} file.", - extension, extension)); - // user likely compressed the file themselves, then suffered a traumatic - // brain injury that caused them to forget how archives work - - LaunchWebBrowser(fmt::format( - "https://www.google.com/search?q=how+to+extract+{}+file", extension)); - - xe::FatalError("Terminating due to user's lack of basic computer skills."); + xe::FatalError(fmt::format("Xenia does not support running {} files.", extension)); } return std::make_unique(mount_path, path); } @@ -368,55 +363,8 @@ void Emulator::ClearStickyPersistentFlags() { ~EmulatorFlagIsoWarningSticky); } -void Emulator::CheckMountWarning(const std::filesystem::path& path) { - auto extension = CanonicalizeFileExtension(path); - - uint64_t emu_flags = GetPersistentEmulatorFlags(); - - bool moron_flag_set = (emu_flags & EmulatorFlagIsoWarningSticky) != 0ULL; - - if (!(emu_flags & EmulatorFlagIsoWarningAcknowledged) && - extension == ".iso") { - // get their attention, they're more likely to read the message if they're - // worried something is wrong with their computer - uint64_t time_started_reading = Clock::QueryHostUptimeMillis(); - // this isn't true really, they just won't be able to speak in discussion - // channels, and they can prove they have a physical copy - ShowSimpleMessageBox( - xe::SimpleMessageBoxType::Warning, - "PIRACY IS ILLEGAL, STAY OUT OF OUR DISCORD: ISO files are commonly " - "associated with piracy, which the " - "Xenia team " - "does not support or condone. Any users who come to the Xenia discord " - "for support who are found to be using pirated games will be banned " - "immediately, regardless of whether they own a physical copy."); - uint64_t time_finished_reading = Clock::QueryHostUptimeMillis(); - /* - we only show them this warning once. - if they immediately skipped it, assume they're an idiot and force - the warning every time they open the file don't do the check though if - we've already given them the moron flag - */ - if (!moron_flag_set && - (time_finished_reading - time_started_reading) < 2000) { - ShowSimpleMessageBox(xe::SimpleMessageBoxType::Warning, - "You clearly didn't read the warning. It will now " - "show every time you open an ISO file."); - SetPersistentEmulatorFlags(emu_flags | EmulatorFlagIsoWarningSticky); - } else { - // dont set the warning acknowledged bit, ever, if they skipped the first - // warning without reading it - if (!moron_flag_set) { - SetPersistentEmulatorFlags(emu_flags | - EmulatorFlagIsoWarningAcknowledged); - } - } - } -} - X_STATUS Emulator::MountPath(const std::filesystem::path& path, const std::string_view mount_path) { - CheckMountWarning(path); auto device = CreateVfsDeviceBasedOnPath(path, mount_path); if (!device->Initialize()) { xe::FatalError( diff --git a/src/xenia/emulator.h b/src/xenia/emulator.h index 7c8c29326..b6a7b2ea4 100644 --- a/src/xenia/emulator.h +++ b/src/xenia/emulator.h @@ -224,14 +224,12 @@ class Emulator { enum : uint64_t { EmulatorFlagQuickstartShown = 1ULL << 0, EmulatorFlagIsoWarningAcknowledged = 1ULL << 1, - EmulatorFlagIsoWarningSticky = 1ULL<<2, - + EmulatorFlagIsoWarningSticky = 1ULL<<2, }; static uint64_t GetPersistentEmulatorFlags(); static void SetPersistentEmulatorFlags(uint64_t new_flags); static std::string CanonicalizeFileExtension( const std::filesystem::path& path); - void CheckMountWarning(const std::filesystem::path& path); static bool ExceptionCallbackThunk(Exception* ex, void* data); bool ExceptionCallback(Exception* ex); diff --git a/src/xenia/xbox.h b/src/xenia/xbox.h index a8cc9414d..98a7137a9 100644 --- a/src/xenia/xbox.h +++ b/src/xenia/xbox.h @@ -61,9 +61,9 @@ typedef uint32_t X_STATUS; #define X_STATUS_OBJECT_NAME_COLLISION ((X_STATUS)0xC0000035L) #define X_STATUS_INVALID_PAGE_PROTECTION ((X_STATUS)0xC0000045L) #define X_STATUS_MUTANT_NOT_OWNED ((X_STATUS)0xC0000046L) -#define X_STATUS_THREAD_IS_TERMINATING ((X_STATUS)0xC000004BL) +#define X_STATUS_THREAD_IS_TERMINATING ((X_STATUS)0xC000004BL) #define X_STATUS_PROCEDURE_NOT_FOUND ((X_STATUS)0xC000007AL) -#define X_STATUS_INVALID_IMAGE_FORMAT ((X_STATUS)0xC000007BL) +#define X_STATUS_INVALID_IMAGE_FORMAT ((X_STATUS)0xC000007BL) #define X_STATUS_INSUFFICIENT_RESOURCES ((X_STATUS)0xC000009AL) #define X_STATUS_MEMORY_NOT_ALLOCATED ((X_STATUS)0xC00000A0L) #define X_STATUS_FILE_IS_A_DIRECTORY ((X_STATUS)0xC00000BAL)