feat: admen abooze
This commit is contained in:
@@ -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
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user