From aa61f55b743a8ecf3cd8e1f99e1d9a0308f6d014 Mon Sep 17 00:00:00 2001 From: andrew Date: Tue, 21 Jan 2014 15:58:17 +0200 Subject: Scoreboard protocol support --- src/Server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Server.cpp') diff --git a/src/Server.cpp b/src/Server.cpp index 5280270b9..eb76fcaeb 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -501,7 +501,7 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac } } #endif - + if (cPluginManager::Get()->ExecuteConsoleCommand(split, a_Output)) { a_Output.Finished(); -- cgit v1.2.3 From 5f34c78091a7c884a9c27c0f0691cd1f03174dfe Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 23 Jan 2014 23:35:23 +0100 Subject: PolarSSL is fully used for 1.3.2 protocol encryption. --- src/Server.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/Server.cpp') diff --git a/src/Server.cpp b/src/Server.cpp index 34ee066cb..f64af62eb 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -284,17 +284,9 @@ int cServer::GetNumPlayers(void) void cServer::PrepareKeys(void) { - // TODO: Save and load key for persistence across sessions - // But generating the key takes only a moment, do we even need that? - LOGD("Generating protocol encryption keypair..."); - - time_t CurTime = time(NULL); - CryptoPP::RandomPool rng; - rng.Put((const byte *)&CurTime, sizeof(CurTime)); - m_PrivateKey.GenerateRandomWithKeySize(rng, 1024); - CryptoPP::RSA::PublicKey pk(m_PrivateKey); - m_PublicKey = pk; + VERIFY(m_PrivateKey.Generate(1024)); + m_PublicKeyDER = m_PrivateKey.GetPubKeyDER(); } -- cgit v1.2.3 From 314fc3cdac702a44a257ada5fab52f0a7d37ffcd Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 25 Jan 2014 14:42:26 +0000 Subject: Mob bugfixes * Mobs no longer require constant line-of-sight to a player to remain aggravated * Fixed an ASSERT * Fixed mobs jumping * Fixed Idle state not properly using AI + Added FILE_IO_PREFIX to favicon loading + Implemented #563 --- src/Server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Server.cpp') diff --git a/src/Server.cpp b/src/Server.cpp index 34ee066cb..2774c8b46 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -194,7 +194,7 @@ bool cServer::InitServer(cIniFile & a_SettingsIni) m_PlayerCount = 0; m_PlayerCountDiff = 0; - m_FaviconData = Base64Encode(cFile::ReadWholeFile("favicon.png")); // Will return empty string if file nonexistant; client doesn't mind + m_FaviconData = Base64Encode(cFile::ReadWholeFile(FILE_IO_PREFIX + AString("favicon.png"))); // Will return empty string if file nonexistant; client doesn't mind if (m_bIsConnected) { -- cgit v1.2.3 From bc6fc859f4c245d17d3bbc2028d93b42b1232d01 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 28 Jan 2014 23:53:07 +0100 Subject: Protocol 1.7: Forced encryption on all connections. This is for testing purposes only, to find bugs in the encryption. Once the encryption is deemed stable, it will be enabled only for servers with enabled Authentication. --- src/Server.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Server.cpp') diff --git a/src/Server.cpp b/src/Server.cpp index 3f9f8a4ac..ba2b46d55 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -237,7 +237,8 @@ bool cServer::InitServer(cIniFile & a_SettingsIni) m_bIsConnected = true; m_ServerID = "-"; - if (a_SettingsIni.GetValueSetB("Authentication", "Authenticate", true)) + m_ShouldAuthenticate = a_SettingsIni.GetValueSetB("Authentication", "Authenticate", true); + if (m_ShouldAuthenticate) { MTRand mtrand1; unsigned int r1 = (mtrand1.randInt() % 1147483647) + 1000000000; -- cgit v1.2.3 From 645c096e2b76c6a42a2b0c679553475d63054f75 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sun, 9 Feb 2014 00:02:16 +0100 Subject: The console reload command also reloads the groups. --- src/Server.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Server.cpp') diff --git a/src/Server.cpp b/src/Server.cpp index ba2b46d55..62b4442d2 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -459,6 +459,7 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac if (split[0] == "reload") { cPluginManager::Get()->ReloadPlugins(); + cRoot::Get()->ReloadGroups(); return; } -- cgit v1.2.3 From 011a334a8a1bf7a7efcfbbbe895ebae9432ce118 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sun, 9 Feb 2014 00:06:37 +0100 Subject: Split "reload" in "reloadplugins" and "reloadgroups". --- src/Server.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/Server.cpp') diff --git a/src/Server.cpp b/src/Server.cpp index 62b4442d2..671d251cd 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -456,12 +456,15 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac PrintHelp(split, a_Output); return; } - if (split[0] == "reload") + if (split[0] == "reloadplugins") { cPluginManager::Get()->ReloadPlugins(); - cRoot::Get()->ReloadGroups(); return; } + if (split[0] == "reloadgroups") + { + cRoot::Get()->ReloadGroups(); + } // There is currently no way a plugin can do these (and probably won't ever be): if (split[0].compare("chunkstats") == 0) -- cgit v1.2.3 From 2a741e719cd827344bc441a04b27f3e3c8493d33 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sun, 9 Feb 2014 00:13:25 +0100 Subject: "reload" is back. --- src/Server.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Server.cpp') diff --git a/src/Server.cpp b/src/Server.cpp index 671d251cd..ab1458da4 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -456,6 +456,12 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac PrintHelp(split, a_Output); return; } + if (split[0] == "reload") + { + cPluginManager::Get()->ReloadPlugins(); + cRoot::Get()->ReloadGroups(); + return; + } if (split[0] == "reloadplugins") { cPluginManager::Get()->ReloadPlugins(); @@ -464,6 +470,7 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac if (split[0] == "reloadgroups") { cRoot::Get()->ReloadGroups(); + return; } // There is currently no way a plugin can do these (and probably won't ever be): -- cgit v1.2.3 From 50bebd2dbdb26a48ce1637bf515770d1bfc50d99 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 20 Feb 2014 20:11:17 +0100 Subject: Disabled the leak finder. --- src/Server.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Server.cpp') diff --git a/src/Server.cpp b/src/Server.cpp index ab1458da4..c60418b41 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -39,7 +39,9 @@ extern "C" { // For the "dumpmem" server command: /// Synchronize this with main.cpp - the leak finder needs initialization before it can be used to dump memory -#define ENABLE_LEAK_FINDER +// _X 2014_02_20: Disabled for canon repo, it makes the debug version too slow in MSVC2013 +// and we haven't had a memory leak for over a year anyway. +// #define ENABLE_LEAK_FINDER #if defined(_MSC_VER) && defined(_DEBUG) && defined(ENABLE_LEAK_FINDER) #pragma warning(push) -- cgit v1.2.3 From 21febaf4b342aecd5d797b1e2017591fde208388 Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 21 Feb 2014 14:53:46 +0100 Subject: Add 'Group not found', when the Server load the users.ini and add auto generate from users.ini --- src/Server.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Server.cpp') diff --git a/src/Server.cpp b/src/Server.cpp index ab1458da4..4842c1782 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -460,16 +460,20 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac { cPluginManager::Get()->ReloadPlugins(); cRoot::Get()->ReloadGroups(); + a_Output.Finished(); return; } if (split[0] == "reloadplugins") { cPluginManager::Get()->ReloadPlugins(); + a_Output.Finished(); return; } if (split[0] == "reloadgroups") { cRoot::Get()->ReloadGroups(); + a_Output.Out("Groups reloaded!"); + a_Output.Finished(); return; } -- cgit v1.2.3 From 5b3957233402c36f3262b7246047131e65c5eeb3 Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 21 Feb 2014 14:56:33 +0100 Subject: Remove old Output Finish --- src/Server.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/Server.cpp') diff --git a/src/Server.cpp b/src/Server.cpp index 4842c1782..c80348872 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -460,13 +460,11 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac { cPluginManager::Get()->ReloadPlugins(); cRoot::Get()->ReloadGroups(); - a_Output.Finished(); return; } if (split[0] == "reloadplugins") { cPluginManager::Get()->ReloadPlugins(); - a_Output.Finished(); return; } if (split[0] == "reloadgroups") -- cgit v1.2.3 From b4bf13aa4f004a7819e262679a295d8ca886557b Mon Sep 17 00:00:00 2001 From: andrew Date: Tue, 11 Mar 2014 16:01:17 +0200 Subject: Unified Vector classes --- src/Server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Server.cpp') diff --git a/src/Server.cpp b/src/Server.cpp index fcbcaa919..1b168ff20 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -24,7 +24,7 @@ #include "MersenneTwister.h" #include "inifile/iniFile.h" -#include "Vector3f.h" +#include "Vector3.h" #include #include -- cgit v1.2.3 From 7e6ee7ef8158a037c11405986513aa344ce68f42 Mon Sep 17 00:00:00 2001 From: Tycho Date: Tue, 11 Mar 2014 14:43:14 -0700 Subject: Fixed more Format issues --- src/Server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Server.cpp') diff --git a/src/Server.cpp b/src/Server.cpp index fcbcaa919..194195136 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -550,7 +550,7 @@ void cServer::PrintHelp(const AStringVector & a_Split, cCommandOutputCallback & for (AStringPairs::const_iterator itr = Callback.m_Commands.begin(), end = Callback.m_Commands.end(); itr != end; ++itr) { const AStringPair & cmd = *itr; - a_Output.Out(Printf("%-*s%s\n", Callback.m_MaxLen, cmd.first.c_str(), cmd.second.c_str())); + a_Output.Out(Printf("%-*s%s\n", static_cast(Callback.m_MaxLen), cmd.first.c_str(), cmd.second.c_str())); } // for itr - Callback.m_Commands[] a_Output.Finished(); } -- cgit v1.2.3