[General]: Cleanup (#921)
This commit is contained in:
parent
169d2215d6
commit
625a80afc8
@ -86,7 +86,6 @@ namespace Components
|
|||||||
const auto* cxt = Game::ScrPlace_GetActivePlacement(localClientNum);
|
const auto* cxt = Game::ScrPlace_GetActivePlacement(localClientNum);
|
||||||
|
|
||||||
auto addressText = Network::Address(*Game::connectedHost).getString();
|
auto addressText = Network::Address(*Game::connectedHost).getString();
|
||||||
|
|
||||||
if (addressText == "0.0.0.0:0"s || addressText == "loopback"s)
|
if (addressText == "0.0.0.0:0"s || addressText == "loopback"s)
|
||||||
{
|
{
|
||||||
addressText = "Listen Server"s;
|
addressText = "Listen Server"s;
|
||||||
@ -251,7 +250,13 @@ namespace Components
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Utils::InfoString info(data.substr(0, data.find_first_of('\n')));
|
const auto pos = data.find_first_of('\n');
|
||||||
|
if (pos == std::string::npos)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Utils::InfoString info(data.substr(0, pos));
|
||||||
|
|
||||||
Dvar::Var("uiSi_ServerName").set(info.get("sv_hostname"));
|
Dvar::Var("uiSi_ServerName").set(info.get("sv_hostname"));
|
||||||
Dvar::Var("uiSi_MaxClients").set(info.get("sv_maxclients"));
|
Dvar::Var("uiSi_MaxClients").set(info.get("sv_maxclients"));
|
||||||
|
@ -188,7 +188,7 @@ namespace Utils
|
|||||||
std::string hash(reinterpret_cast<char*>(buffer), sizeof(buffer));
|
std::string hash(reinterpret_cast<char*>(buffer), sizeof(buffer));
|
||||||
if (!hex) return hash;
|
if (!hex) return hash;
|
||||||
|
|
||||||
return String::DumpHex(hash, "");
|
return String::DumpHex(hash, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
@ -212,7 +212,7 @@ namespace Utils
|
|||||||
std::string hash(reinterpret_cast<char*>(buffer), sizeof(buffer));
|
std::string hash(reinterpret_cast<char*>(buffer), sizeof(buffer));
|
||||||
if (!hex) return hash;
|
if (!hex) return hash;
|
||||||
|
|
||||||
return String::DumpHex(hash, "");
|
return String::DumpHex(hash, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
@ -236,7 +236,7 @@ namespace Utils
|
|||||||
std::string hash(reinterpret_cast<char*>(buffer), sizeof(buffer));
|
std::string hash(reinterpret_cast<char*>(buffer), sizeof(buffer));
|
||||||
if (!hex) return hash;
|
if (!hex) return hash;
|
||||||
|
|
||||||
return String::DumpHex(hash, "");
|
return String::DumpHex(hash, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
@ -260,7 +260,7 @@ namespace Utils
|
|||||||
std::string hash(reinterpret_cast<char*>(buffer), sizeof(buffer));
|
std::string hash(reinterpret_cast<char*>(buffer), sizeof(buffer));
|
||||||
if (!hex) return hash;
|
if (!hex) return hash;
|
||||||
|
|
||||||
return String::DumpHex(hash, "");
|
return String::DumpHex(hash, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
@ -272,7 +272,7 @@ namespace Utils
|
|||||||
return Compute(data.data(), data.size());
|
return Compute(data.data(), data.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int JenkinsOneAtATime::Compute(const char *key, std::size_t len)
|
unsigned int JenkinsOneAtATime::Compute(const char* key, std::size_t len)
|
||||||
{
|
{
|
||||||
unsigned int hash, i;
|
unsigned int hash, i;
|
||||||
for (hash = i = 0; i < len; ++i)
|
for (hash = i = 0; i < len; ++i)
|
||||||
|
@ -335,7 +335,7 @@ namespace Utils
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static unsigned int Compute(const std::string& data);
|
static unsigned int Compute(const std::string& data);
|
||||||
static unsigned int Compute(const char *key, std::size_t len);
|
static unsigned int Compute(const char* key, std::size_t len);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user