[General] Small fixes
This commit is contained in:
parent
185bb4a291
commit
2d2c4c2c31
@ -491,7 +491,7 @@ namespace Components
|
|||||||
|
|
||||||
void Console::FreeNativeConsole()
|
void Console::FreeNativeConsole()
|
||||||
{
|
{
|
||||||
if (!Monitor::IsEnabled() && !Flags::HasFlag("stdout") && (!Dedicated::IsEnabled() || Flags::HasFlag("console")))
|
if (!Monitor::IsEnabled() && !Flags::HasFlag("stdout") && (!Dedicated::IsEnabled() || Flags::HasFlag("console")) && !Loader::PerformingUnitTests())
|
||||||
{
|
{
|
||||||
FreeConsole();
|
FreeConsole();
|
||||||
}
|
}
|
||||||
@ -643,7 +643,7 @@ namespace Components
|
|||||||
Utils::Hook(0x43D570, Console::Error, HOOK_JUMP).install()->quick();
|
Utils::Hook(0x43D570, Console::Error, HOOK_JUMP).install()->quick();
|
||||||
Utils::Hook(0x4859A5, Console::Input, HOOK_CALL).install()->quick();
|
Utils::Hook(0x4859A5, Console::Input, HOOK_CALL).install()->quick();
|
||||||
}
|
}
|
||||||
else
|
else if(!Loader::PerformingUnitTests())
|
||||||
{
|
{
|
||||||
FreeConsole();
|
FreeConsole();
|
||||||
}
|
}
|
||||||
|
@ -345,12 +345,10 @@ namespace Components
|
|||||||
{
|
{
|
||||||
Logger::Error("The fastfile you are trying to load is outdated (%d, expected %d)", header[1], XFILE_VERSION_IW4X);
|
Logger::Error("The fastfile you are trying to load is outdated (%d, expected %d)", header[1], XFILE_VERSION_IW4X);
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
|
||||||
else if (header[1] > XFILE_VERSION_IW4X)
|
else if (header[1] > XFILE_VERSION_IW4X)
|
||||||
{
|
{
|
||||||
Logger::Error("You are loading a fastfile that is too new (%d, expected %d), how's that possible?", header[1], XFILE_VERSION_IW4X);
|
Logger::Error("You are loading a fastfile that is too new (%d, expected %d), update your game", header[1], XFILE_VERSION_IW4X);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
*reinterpret_cast<unsigned __int64*>(header) = XFILE_MAGIC_UNSIGNED;
|
*reinterpret_cast<unsigned __int64*>(header) = XFILE_MAGIC_UNSIGNED;
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,12 @@ namespace Steam
|
|||||||
{
|
{
|
||||||
unsigned int Utils::GetSecondsSinceAppActive()
|
unsigned int Utils::GetSecondsSinceAppActive()
|
||||||
{
|
{
|
||||||
return 0;
|
return Game::Sys_Milliseconds() / 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int Utils::GetSecondsSinceComputerActive()
|
unsigned int Utils::GetSecondsSinceComputerActive()
|
||||||
{
|
{
|
||||||
return 0;
|
return timeGetTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
int Utils::GetConnectedUniverse()
|
int Utils::GetConnectedUniverse()
|
||||||
@ -21,12 +21,10 @@ namespace Steam
|
|||||||
|
|
||||||
unsigned int Utils::GetServerRealTime()
|
unsigned int Utils::GetServerRealTime()
|
||||||
{
|
{
|
||||||
static ::std::optional<unsigned int> timeDelta;
|
static std::optional<unsigned int> timeDelta;
|
||||||
|
|
||||||
if(!timeDelta.has_value())
|
if(!timeDelta.has_value())
|
||||||
{
|
{
|
||||||
unsigned int steamTime = static_cast<unsigned int>(time(nullptr));
|
unsigned int steamTime = static_cast<unsigned int>(time(nullptr));
|
||||||
|
|
||||||
if(Steam::Proxy::SteamUtils)
|
if(Steam::Proxy::SteamUtils)
|
||||||
{
|
{
|
||||||
steamTime = Steam::Proxy::SteamUtils->GetServerRealTime();
|
steamTime = Steam::Proxy::SteamUtils->GetServerRealTime();
|
||||||
@ -40,6 +38,11 @@ namespace Steam
|
|||||||
|
|
||||||
const char* Utils::GetIPCountry()
|
const char* Utils::GetIPCountry()
|
||||||
{
|
{
|
||||||
|
if (Steam::Proxy::SteamUtils)
|
||||||
|
{
|
||||||
|
return Steam::Proxy::SteamUtils->GetIPCountry();
|
||||||
|
}
|
||||||
|
|
||||||
return "US";
|
return "US";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,6 +63,11 @@ namespace Steam
|
|||||||
|
|
||||||
unsigned char Utils::GetCurrentBatteryPower()
|
unsigned char Utils::GetCurrentBatteryPower()
|
||||||
{
|
{
|
||||||
|
if (Steam::Proxy::SteamUtils)
|
||||||
|
{
|
||||||
|
return Steam::Proxy::SteamUtils->GetCurrentBatteryPower();
|
||||||
|
}
|
||||||
|
|
||||||
return 255;
|
return 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,10 +48,8 @@ namespace Utils
|
|||||||
{
|
{
|
||||||
ECC::Key key;
|
ECC::Key key;
|
||||||
|
|
||||||
register_prng(&sprng_desc);
|
|
||||||
|
|
||||||
ltc_mp = ltm_desc;
|
ltc_mp = ltm_desc;
|
||||||
|
register_prng(&sprng_desc);
|
||||||
ecc_make_key(nullptr, find_prng("sprng"), bits / 8, key.getKeyPtr());
|
ecc_make_key(nullptr, find_prng("sprng"), bits / 8, key.getKeyPtr());
|
||||||
|
|
||||||
return key;
|
return key;
|
||||||
@ -64,10 +62,8 @@ namespace Utils
|
|||||||
uint8_t buffer[512];
|
uint8_t buffer[512];
|
||||||
DWORD length = sizeof(buffer);
|
DWORD length = sizeof(buffer);
|
||||||
|
|
||||||
register_prng(&sprng_desc);
|
|
||||||
|
|
||||||
ltc_mp = ltm_desc;
|
ltc_mp = ltm_desc;
|
||||||
|
register_prng(&sprng_desc);
|
||||||
ecc_sign_hash(reinterpret_cast<const uint8_t*>(message.data()), message.size(), buffer, &length, nullptr, find_prng("sprng"), key.getKeyPtr());
|
ecc_sign_hash(reinterpret_cast<const uint8_t*>(message.data()), message.size(), buffer, &length, nullptr, find_prng("sprng"), key.getKeyPtr());
|
||||||
|
|
||||||
return std::string(reinterpret_cast<char*>(buffer), length);
|
return std::string(reinterpret_cast<char*>(buffer), length);
|
||||||
|
Loading…
Reference in New Issue
Block a user