Skip to content

Commit

Permalink
Implemented suggestions
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
tigerw committed Nov 5, 2013
1 parent 0c2c803 commit a263dc8
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 24 deletions.
13 changes: 0 additions & 13 deletions source/Blocks/BlockTorch.h
Expand Up @@ -166,19 +166,6 @@ class cBlockTorchHandler :
}


/*
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));
Expand Down
5 changes: 5 additions & 0 deletions source/Defines.h
Expand Up @@ -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];




Expand Down
24 changes: 17 additions & 7 deletions source/PluginManager.cpp
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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())
Expand Down
4 changes: 3 additions & 1 deletion source/PluginManager.h
Expand Up @@ -275,12 +275,14 @@ class cPluginManager // tolua_export
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);

Expand Down
4 changes: 2 additions & 2 deletions source/Server.cpp
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion source/WebAdmin.cpp
Expand Up @@ -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))
{
Expand Down

0 comments on commit a263dc8

Please sign in to comment.