summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortycho <work.tycho@gmail.com>2015-05-23 15:50:28 +0200
committertycho <work.tycho@gmail.com>2015-05-23 15:50:28 +0200
commitb29ae54d912a69f24946f8e1ff34448455d5afc3 (patch)
treeaeabb17db1922556466087cf6ebb7302d956f6c1
parentFix tests (diff)
parentMerge pull request #2116 from mc-server/CMakeCacheOptions (diff)
downloadcuberite-b29ae54d912a69f24946f8e1ff34448455d5afc3.tar
cuberite-b29ae54d912a69f24946f8e1ff34448455d5afc3.tar.gz
cuberite-b29ae54d912a69f24946f8e1ff34448455d5afc3.tar.bz2
cuberite-b29ae54d912a69f24946f8e1ff34448455d5afc3.tar.lz
cuberite-b29ae54d912a69f24946f8e1ff34448455d5afc3.tar.xz
cuberite-b29ae54d912a69f24946f8e1ff34448455d5afc3.tar.zst
cuberite-b29ae54d912a69f24946f8e1ff34448455d5afc3.zip
-rw-r--r--CMakeLists.txt3
-rw-r--r--src/Entities/Player.cpp9
-rw-r--r--src/OverridesSettingsRepository.cpp2
-rw-r--r--src/main.cpp54
4 files changed, 38 insertions, 30 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2bb780eba..ae83662c9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,6 +52,9 @@ if(MSVC OR MSVC_IDE)
endif()
endif()
+set(BUILD_TOOLS OFF CACHE BOOL "")
+set(SELF_TEST OFF CACHE BOOL "")
+
# This has to be done before any flags have been set up.
if(${BUILD_TOOLS})
message("Building tools")
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 4ed5ef8a3..b5a48d9bf 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -1212,6 +1212,15 @@ void cPlayer::SetGameMode(eGameMode a_GameMode)
SetCanFly(false);
}
+ if (IsGameModeSpectator() && IsVisible())
+ {
+ SetVisible(false);
+ }
+ else if (!IsVisible())
+ {
+ SetVisible(true);
+ }
+
m_World->BroadcastPlayerListUpdateGameMode(*this);
}
diff --git a/src/OverridesSettingsRepository.cpp b/src/OverridesSettingsRepository.cpp
index 6defdd6b5..e63f2c44c 100644
--- a/src/OverridesSettingsRepository.cpp
+++ b/src/OverridesSettingsRepository.cpp
@@ -260,7 +260,7 @@ bool cOverridesSettingsRepository::DeleteValue(const AString & a_KeyName, const
}
else
{
- return m_Overrides->DeleteValue(a_KeyName, a_ValueName);
+ return m_Main->DeleteValue(a_KeyName, a_ValueName);
}
}
diff --git a/src/main.cpp b/src/main.cpp
index 8a237b8ee..5cd057278 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -374,6 +374,14 @@ std::unique_ptr<cMemorySettingsRepository> parseArguments(int argc, char **argv)
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 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 noBufArg("", "no-output-buffering", "Disable output buffering", cmd);
+
cmd.parse(argc, argv);
auto repo = cpp14::make_unique<cMemorySettingsRepository>();
@@ -396,6 +404,22 @@ std::unique_ptr<cMemorySettingsRepository> parseArguments(int argc, char **argv)
}
}
+ if (commLogArg.getValue())
+ {
+ g_ShouldLogCommIn = true;
+ g_ShouldLogCommOut = true;
+ }
+ else
+ {
+ g_ShouldLogCommIn = commLogInArg.getValue();
+ g_ShouldLogCommOut = commLogOutArg.getValue();
+ }
+
+ if (noBufArg.getValue())
+ {
+ setvbuf(stdout, nullptr, _IONBF, 0);
+ }
+
repo->SetReadOnly();
return repo;
@@ -473,35 +497,7 @@ int main(int argc, char **argv)
for (int i = 0; i < argc; i++)
{
AString Arg(argv[i]);
- if (
- (NoCaseCompare(Arg, "/commlog") == 0) ||
- (NoCaseCompare(Arg, "/logcomm") == 0)
- )
- {
- g_ShouldLogCommIn = true;
- g_ShouldLogCommOut = true;
- }
- else if (
- (NoCaseCompare(Arg, "/commlogin") == 0) ||
- (NoCaseCompare(Arg, "/comminlog") == 0) ||
- (NoCaseCompare(Arg, "/logcommin") == 0)
- )
- {
- g_ShouldLogCommIn = true;
- }
- else if (
- (NoCaseCompare(Arg, "/commlogout") == 0) ||
- (NoCaseCompare(Arg, "/commoutlog") == 0) ||
- (NoCaseCompare(Arg, "/logcommout") == 0)
- )
- {
- g_ShouldLogCommOut = true;
- }
- else if (NoCaseCompare(Arg, "nooutbuf") == 0)
- {
- setvbuf(stdout, nullptr, _IONBF, 0);
- }
- else if (NoCaseCompare(Arg, "/service") == 0)
+ if (NoCaseCompare(Arg, "/service") == 0)
{
cRoot::m_RunAsService = true;
}