Merge pull request #3140 from cuberite/revert-3137-issue3136
Revert "Issue3136"
This commit is contained in:
commit
5231e4a7e4
@ -963,3 +963,6 @@ AStringVector ReadUpgradeIniPorts(
|
|||||||
|
|
||||||
return Ports;
|
return Ports;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -108,26 +108,31 @@ std::vector<std::pair<AString, AString>> cOverridesSettingsRepository::GetValues
|
|||||||
{
|
{
|
||||||
auto overrides = m_Overrides->GetValues(a_keyName);
|
auto overrides = m_Overrides->GetValues(a_keyName);
|
||||||
auto main = m_Main->GetValues(a_keyName);
|
auto main = m_Main->GetValues(a_keyName);
|
||||||
|
std::sort(overrides.begin(), overrides.end(), [](std::pair<AString, AString> a, std::pair<AString, AString> b) -> bool { return a < b ;});
|
||||||
|
std::sort(main.begin(), main.end(), [](std::pair<AString, AString> a, std::pair<AString, AString> b) -> bool { return a < b ;});
|
||||||
|
|
||||||
auto ret = overrides;
|
std::vector<std::pair<AString, AString>> ret;
|
||||||
|
|
||||||
for (const auto & mainpair : main)
|
|
||||||
|
size_t overridesIndex = 0;
|
||||||
|
for (auto pair : main)
|
||||||
{
|
{
|
||||||
bool found = false;
|
if (overridesIndex >= overrides.size())
|
||||||
for (const auto & returnpair : ret)
|
|
||||||
{
|
{
|
||||||
if (returnpair.first == mainpair.first)
|
ret.push_back(pair);
|
||||||
{
|
continue;
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (found == false)
|
if (pair.first == overrides[overridesIndex].first)
|
||||||
{
|
{
|
||||||
ret.push_back(mainpair);
|
continue;
|
||||||
}
|
}
|
||||||
|
while (pair.first > overrides[overridesIndex].first)
|
||||||
|
{
|
||||||
|
ret.push_back(overrides[overridesIndex]);
|
||||||
|
overridesIndex++;
|
||||||
|
}
|
||||||
|
ret.push_back(pair);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -265,3 +270,4 @@ bool cOverridesSettingsRepository::Flush()
|
|||||||
{
|
{
|
||||||
return m_Overrides->Flush() && m_Main->Flush();
|
return m_Overrides->Flush() && m_Main->Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -371,7 +371,7 @@ static std::unique_ptr<cMemorySettingsRepository> ParseArguments(int argc, char
|
|||||||
// Parse the comand line args:
|
// Parse the comand line args:
|
||||||
TCLAP::CmdLine cmd("Cuberite");
|
TCLAP::CmdLine cmd("Cuberite");
|
||||||
TCLAP::ValueArg<int> slotsArg ("s", "max-players", "Maximum number of slots for the server to use, overrides setting in setting.ini", false, -1, "number", cmd);
|
TCLAP::ValueArg<int> slotsArg ("s", "max-players", "Maximum number of slots for the server to use, overrides setting in setting.ini", false, -1, "number", cmd);
|
||||||
TCLAP::MultiArg<int> portsArg ("p", "port", "The port numbers the server should listen to", false, "port", cmd);
|
TCLAP::MultiArg<int> portsArg ("p", "port", "The port number the server should listen to", false, "port", cmd);
|
||||||
TCLAP::SwitchArg commLogArg ("", "log-comm", "Log server client communications to file", cmd);
|
TCLAP::SwitchArg commLogArg ("", "log-comm", "Log server client communications to file", cmd);
|
||||||
TCLAP::SwitchArg commLogInArg ("", "log-comm-in", "Log inbound server client communications to file", cmd);
|
TCLAP::SwitchArg commLogInArg ("", "log-comm-in", "Log inbound server client communications to file", cmd);
|
||||||
TCLAP::SwitchArg commLogOutArg ("", "log-comm-out", "Log outbound server client communications to file", cmd);
|
TCLAP::SwitchArg commLogOutArg ("", "log-comm-out", "Log outbound server client communications to file", cmd);
|
||||||
@ -392,7 +392,7 @@ static std::unique_ptr<cMemorySettingsRepository> ParseArguments(int argc, char
|
|||||||
{
|
{
|
||||||
for (auto port: portsArg.getValue())
|
for (auto port: portsArg.getValue())
|
||||||
{
|
{
|
||||||
repo->AddValue("Server", "Ports", static_cast<Int64>(port));
|
repo->AddValue("Server", "Port", static_cast<Int64>(port));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (commLogArg.getValue())
|
if (commLogArg.getValue())
|
||||||
@ -555,3 +555,7 @@ int main(int argc, char ** argv)
|
|||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user