feat: admen abooze

This commit is contained in:
2026-09-09 21:14:45 +02:00
parent 043f8f07c0
commit 02ba3b3663
68 changed files with 228 additions and 2039 deletions
+31 -3
View File
@@ -46,16 +46,27 @@ namespace steam_proxy
#ifndef DEV_BUILD
try
{
const std::string game_type = game::environment::is_sp() ? "singleplayer" : "multiplayer";
state_ = this->start_mod("\xF0\x9F\x92\x8E" " iw6-mod: " + (game_type), game::environment::is_sp() ? 209160 : 209170);
const std::string game_type = "multiplayer";
state_ = this->start_mod("\xF0\x9F\x92\x8E" " iw6-mod: " + (game_type), 209170);
}
catch (const std::exception& ex)
{
state_ = ownership_state::error;
printf("Steam: %s\n", ex.what());
}
#ifdef STEAM_OWNERSHIP_CHECK
if (utils::nt::is_wine())
{
state_ = ownership_state::success;
return;
}
#endif
#ifdef STEAM_OWNERSHIP_CHECK
evaluate_ownership_state(state_);
#endif
#endif
(void)state_;
}
void pre_destroy() override
@@ -212,6 +223,23 @@ namespace steam_proxy
return scheduler::cond_end;
});
}
#ifdef STEAM_OWNERSHIP_CHECK
void evaluate_ownership_state(const ownership_state state)
{
switch (state)
{
case ownership_state::nosteam:
throw std::runtime_error("Steam must be running to play this game!");
case ownership_state::unowned:
throw std::runtime_error("You must own the game on Steam to play this mod!");
case ownership_state::error:
throw std::runtime_error("Failed to verify ownership of the game!");
case ownership_state::success:
break;
}
}
#endif
};
}