diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-11-05 22:15:39 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-11-05 22:15:39 +0100 |
commit | a263dc8e83d1dc805aac8469cc2c740d88336575 (patch) | |
tree | 282f0ded16c33662a2f13244c6fa949fcdce182b /source | |
parent | Removed settings/webadmin.example.ini files (diff) | |
download | cuberite-a263dc8e83d1dc805aac8469cc2c740d88336575.tar cuberite-a263dc8e83d1dc805aac8469cc2c740d88336575.tar.gz cuberite-a263dc8e83d1dc805aac8469cc2c740d88336575.tar.bz2 cuberite-a263dc8e83d1dc805aac8469cc2c740d88336575.tar.lz cuberite-a263dc8e83d1dc805aac8469cc2c740d88336575.tar.xz cuberite-a263dc8e83d1dc805aac8469cc2c740d88336575.tar.zst cuberite-a263dc8e83d1dc805aac8469cc2c740d88336575.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Blocks/BlockTorch.h | 13 | ||||
-rw-r--r-- | source/Defines.h | 5 | ||||
-rw-r--r-- | source/PluginManager.cpp | 24 | ||||
-rw-r--r-- | source/PluginManager.h | 4 | ||||
-rw-r--r-- | source/Server.cpp | 4 | ||||
-rw-r--r-- | source/WebAdmin.cpp | 2 |
6 files changed, 28 insertions, 24 deletions
diff --git a/source/Blocks/BlockTorch.h b/source/Blocks/BlockTorch.h index a52b373cb..36383a524 100644 --- a/source/Blocks/BlockTorch.h +++ b/source/Blocks/BlockTorch.h @@ -166,19 +166,6 @@ public: } - /* - virtual bool CanBePlacedAt(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace) override - { - if (TorchCanBePlacedAt(a_World, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace)) - { - return true; - } - - return (FindSuitableFace(a_World, a_BlockX, a_BlockY, a_BlockZ) != BLOCK_FACE_BOTTOM); - } - */ - - virtual bool CanBeAt(int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override { char Face = MetaDataToDirection(a_Chunk.GetMeta(a_RelX, a_RelY, a_RelZ)); diff --git a/source/Defines.h b/source/Defines.h index 6dd81137e..60dab12be 100644 --- a/source/Defines.h +++ b/source/Defines.h @@ -35,10 +35,15 @@ extern bool g_BlockPistonBreakable[256]; /// Can this block hold snow atop? extern bool g_BlockIsSnowable[256]; +/// Does this block require a tool to drop? extern bool g_BlockRequiresSpecialTool[256]; +/// Is this block solid (player cannot walk through)? extern bool g_BlockIsSolid[256]; +/// Can torches be placed on this block? +extern bool g_BlockIsTorchPlaceable[256]; + diff --git a/source/PluginManager.cpp b/source/PluginManager.cpp index 0ff7736ec..3ac2366ca 100644 --- a/source/PluginManager.cpp +++ b/source/PluginManager.cpp @@ -118,13 +118,7 @@ void cPluginManager::ReloadPluginsNow(cIniFile & a_SettingsIni) unsigned int NumPlugins = ((KeyNum != -1) ? (a_SettingsIni.GetNumValues(KeyNum)) : 0); if (KeyNum == -1) { - a_SettingsIni.AddKeyName("Plugins"); - a_SettingsIni.AddKeyComment("Plugins", " Plugin=Debuggers"); - a_SettingsIni.AddKeyComment("Plugins", " Plugin=HookNotify"); - a_SettingsIni.AddKeyComment("Plugins", " Plugin=ChunkWorx"); - a_SettingsIni.SetValue("Plugins", "Plugin", "Core"); - a_SettingsIni.SetValue("Plugins", "Plugin", "TransAPI"); - a_SettingsIni.SetValue("Plugins", "Plugin", "ChatLog"); + InsertDefaultPlugins(a_SettingsIni); } else if (NumPlugins > 0) { @@ -163,6 +157,22 @@ void cPluginManager::ReloadPluginsNow(cIniFile & a_SettingsIni) +void cPluginManager::InsertDefaultPlugins(cIniFile & a_SettingsIni) +{ + a_SettingsIni.AddKeyName("Plugins"); + a_SettingsIni.AddKeyComment("Plugins", " Plugin=Debuggers"); + a_SettingsIni.AddKeyComment("Plugins", " Plugin=HookNotify"); + a_SettingsIni.AddKeyComment("Plugins", " Plugin=ChunkWorx"); + a_SettingsIni.AddKeyComment("Plugins", " Plugin=APIDump"); + a_SettingsIni.SetValue("Plugins", "Plugin", "Core"); + a_SettingsIni.SetValue("Plugins", "Plugin", "TransAPI"); + a_SettingsIni.SetValue("Plugins", "Plugin", "ChatLog"); +} + + + + + void cPluginManager::Tick(float a_Dt) { while (!m_DisablePluginList.empty()) diff --git a/source/PluginManager.h b/source/PluginManager.h index f2ea000c9..4140bffb5 100644 --- a/source/PluginManager.h +++ b/source/PluginManager.h @@ -275,12 +275,14 @@ private: void ReloadPluginsNow(void); /// Reloads all plugins with a cIniFile object expected to be initialised to settings.ini - /// Used because cRoot otherwise overwrites any configuration generation here if cRoot's IniFile is not used void ReloadPluginsNow(cIniFile & a_SettingsIni); /// Unloads all plugins void UnloadPluginsNow(void); + /// Handles writing default plugins if 'Plugins' key not found using a cIniFile object expected to be intialised to settings.ini + void InsertDefaultPlugins(cIniFile & a_SettingsIni); + /// Adds the plugin into the internal list of plugins and initializes it. If initialization fails, the plugin is removed again. bool AddPlugin(cPlugin * a_Plugin); diff --git a/source/Server.cpp b/source/Server.cpp index 380c7416e..75ce35cb7 100644 --- a/source/Server.cpp +++ b/source/Server.cpp @@ -195,9 +195,9 @@ void cServer::PlayerDestroying(const cPlayer * a_Player) bool cServer::InitServer(cIniFile & a_SettingsIni) { - m_Description = a_SettingsIni.GetValueSet("Server", "Description", "MCServer - The Minecraft server in C++!").c_str(); + m_Description = a_SettingsIni.GetValueSet("Server", "Description", "MCServer - in C++!").c_str(); m_MaxPlayers = a_SettingsIni.GetValueSetI("Server", "MaxPlayers", 100); - m_bIsHardcore = a_SettingsIni.GetValueSetB("Server", "HardcoreEnabled"); + m_bIsHardcore = a_SettingsIni.GetValueSetB("Server", "HardcoreEnabled", false); m_PlayerCount = 0; m_PlayerCountDiff = 0; diff --git a/source/WebAdmin.cpp b/source/WebAdmin.cpp index 7dc49942f..7a1d332a5 100644 --- a/source/WebAdmin.cpp +++ b/source/WebAdmin.cpp @@ -103,7 +103,7 @@ bool cWebAdmin::Init(void) LOGD("Initialising WebAdmin..."); AString PortsIPv4 = m_IniFile.GetValueSet("WebAdmin", "Port", "8080"); - AString PortsIPv6 = m_IniFile.GetValueSet("WebAdmin", "Port-IPv6", ""); + AString PortsIPv6 = m_IniFile.GetValueSet("WebAdmin", "PortsIPv6", ""); if (!m_HTTPServer.Initialize(PortsIPv4, PortsIPv6)) { |