1
0

Implemented suggestions

- Reverted changes to WebAdmin.cpp IPv6 ports and Server.cpp server
description
+ Added default value explicitly for HardCore value
* Split PluginManager plugin defaults write to new function
- Removed a commented block from BlockTorch and...
+ Added g_BlockIsTorchPlaceable to Defines.h
This commit is contained in:
Tiger Wang 2013-11-05 21:15:39 +00:00
parent 0c2c803a16
commit a263dc8e83
6 changed files with 28 additions and 24 deletions

View File

@ -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 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)); char Face = MetaDataToDirection(a_Chunk.GetMeta(a_RelX, a_RelY, a_RelZ));

View File

@ -35,10 +35,15 @@ extern bool g_BlockPistonBreakable[256];
/// Can this block hold snow atop? /// Can this block hold snow atop?
extern bool g_BlockIsSnowable[256]; extern bool g_BlockIsSnowable[256];
/// Does this block require a tool to drop?
extern bool g_BlockRequiresSpecialTool[256]; extern bool g_BlockRequiresSpecialTool[256];
/// Is this block solid (player cannot walk through)?
extern bool g_BlockIsSolid[256]; extern bool g_BlockIsSolid[256];
/// Can torches be placed on this block?
extern bool g_BlockIsTorchPlaceable[256];

View File

@ -118,13 +118,7 @@ void cPluginManager::ReloadPluginsNow(cIniFile & a_SettingsIni)
unsigned int NumPlugins = ((KeyNum != -1) ? (a_SettingsIni.GetNumValues(KeyNum)) : 0); unsigned int NumPlugins = ((KeyNum != -1) ? (a_SettingsIni.GetNumValues(KeyNum)) : 0);
if (KeyNum == -1) if (KeyNum == -1)
{ {
a_SettingsIni.AddKeyName("Plugins"); InsertDefaultPlugins(a_SettingsIni);
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");
} }
else if (NumPlugins > 0) 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) void cPluginManager::Tick(float a_Dt)
{ {
while (!m_DisablePluginList.empty()) while (!m_DisablePluginList.empty())

View File

@ -275,12 +275,14 @@ private:
void ReloadPluginsNow(void); void ReloadPluginsNow(void);
/// Reloads all plugins with a cIniFile object expected to be initialised to settings.ini /// 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); void ReloadPluginsNow(cIniFile & a_SettingsIni);
/// Unloads all plugins /// Unloads all plugins
void UnloadPluginsNow(void); 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. /// 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); bool AddPlugin(cPlugin * a_Plugin);

View File

@ -195,9 +195,9 @@ void cServer::PlayerDestroying(const cPlayer * a_Player)
bool cServer::InitServer(cIniFile & a_SettingsIni) 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_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_PlayerCount = 0;
m_PlayerCountDiff = 0; m_PlayerCountDiff = 0;

View File

@ -103,7 +103,7 @@ bool cWebAdmin::Init(void)
LOGD("Initialising WebAdmin..."); LOGD("Initialising WebAdmin...");
AString PortsIPv4 = m_IniFile.GetValueSet("WebAdmin", "Port", "8080"); 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)) if (!m_HTTPServer.Initialize(PortsIPv4, PortsIPv6))
{ {