diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-11-04 22:51:24 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-11-04 22:51:24 +0100 |
commit | e832736e0bf315585f873b43520d1d771930a1c2 (patch) | |
tree | d9fce26b198075371b04356b6f66f31da51f4493 /source/WebAdmin.cpp | |
parent | Protocol 1.7: Added more client-bound packets. (diff) | |
download | cuberite-e832736e0bf315585f873b43520d1d771930a1c2.tar cuberite-e832736e0bf315585f873b43520d1d771930a1c2.tar.gz cuberite-e832736e0bf315585f873b43520d1d771930a1c2.tar.bz2 cuberite-e832736e0bf315585f873b43520d1d771930a1c2.tar.lz cuberite-e832736e0bf315585f873b43520d1d771930a1c2.tar.xz cuberite-e832736e0bf315585f873b43520d1d771930a1c2.tar.zst cuberite-e832736e0bf315585f873b43520d1d771930a1c2.zip |
Diffstat (limited to 'source/WebAdmin.cpp')
-rw-r--r-- | source/WebAdmin.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source/WebAdmin.cpp b/source/WebAdmin.cpp index 8c95e4e21..7dc49942f 100644 --- a/source/WebAdmin.cpp +++ b/source/WebAdmin.cpp @@ -56,7 +56,7 @@ cWebAdmin::~cWebAdmin() { if (m_IsInitialized) { - LOG("Stopping WebAdmin..."); + LOGD("Stopping WebAdmin..."); } } @@ -87,7 +87,11 @@ bool cWebAdmin::Init(void) { if (!m_IniFile.ReadFile("webadmin.ini")) { - return false; + LOGWARN("Regenerating webadmin.ini, all settings will be reset"); + m_IniFile.AddHeaderComment(" This file controls the webadmin feature of MCServer"); + m_IniFile.AddHeaderComment(" Username format: [User:*username*] | Password format: Password=*password*; for example:"); + m_IniFile.AddHeaderComment(" [User:admin]"); + m_IniFile.AddHeaderComment(" Password=admin"); } if (!m_IniFile.GetValueSetB("WebAdmin", "Enabled", true)) @@ -96,16 +100,17 @@ bool cWebAdmin::Init(void) return true; } - LOG("Initialising WebAdmin..."); + LOGD("Initialising WebAdmin..."); AString PortsIPv4 = m_IniFile.GetValueSet("WebAdmin", "Port", "8080"); - AString PortsIPv6 = m_IniFile.GetValueSet("WebAdmin", "PortsIPv6", ""); + AString PortsIPv6 = m_IniFile.GetValueSet("WebAdmin", "Port-IPv6", ""); if (!m_HTTPServer.Initialize(PortsIPv4, PortsIPv6)) { return false; } m_IsInitialized = true; + m_IniFile.WriteFile("webadmin.ini"); return true; } @@ -121,7 +126,7 @@ bool cWebAdmin::Start(void) return false; } - LOG("Starting WebAdmin..."); + LOGD("Starting WebAdmin..."); // Initialize the WebAdmin template script and load the file m_TemplateScript.Create(); |