From 9e9198e0907d3d6fd353c683478007f418d86dd8 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 25 Oct 2013 11:15:44 +0200 Subject: cIniFile doesn't store filename internally anymore. --- source/Authenticator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/Authenticator.cpp') diff --git a/source/Authenticator.cpp b/source/Authenticator.cpp index a45617f93..d7e05b4c2 100644 --- a/source/Authenticator.cpp +++ b/source/Authenticator.cpp @@ -47,8 +47,8 @@ cAuthenticator::~cAuthenticator() /// Read custom values from INI void cAuthenticator::ReadINI(void) { - cIniFile IniFile("settings.ini"); - if (!IniFile.ReadFile()) + cIniFile IniFile; + if (!IniFile.ReadFile("settings.ini")) { return; } @@ -74,7 +74,7 @@ void cAuthenticator::ReadINI(void) if (bSave) { IniFile.SetValueB("Authentication", "Authenticate", m_ShouldAuthenticate); - IniFile.WriteFile(); + IniFile.WriteFile("settings.ini"); } } -- cgit v1.2.3 From 77661f4c594190ff93de4924d62aaac9e112e8a2 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sat, 26 Oct 2013 17:08:28 +0200 Subject: Both the LoadWorlds() function and cAuthenticator now use the cIniFile object from the Root::Start() function. --- source/Authenticator.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'source/Authenticator.cpp') diff --git a/source/Authenticator.cpp b/source/Authenticator.cpp index a45617f93..a8aad524f 100644 --- a/source/Authenticator.cpp +++ b/source/Authenticator.cpp @@ -28,7 +28,6 @@ cAuthenticator::cAuthenticator(void) : m_Address(DEFAULT_AUTH_ADDRESS), m_ShouldAuthenticate(true) { - ReadINI(); } @@ -45,14 +44,8 @@ cAuthenticator::~cAuthenticator() /// Read custom values from INI -void cAuthenticator::ReadINI(void) +void cAuthenticator::ReadINI(cIniFile IniFile) { - cIniFile IniFile("settings.ini"); - if (!IniFile.ReadFile()) - { - return; - } - m_Server = IniFile.GetValue("Authentication", "Server"); m_Address = IniFile.GetValue("Authentication", "Address"); m_ShouldAuthenticate = IniFile.GetValueB("Authentication", "Authenticate", true); @@ -100,8 +93,9 @@ void cAuthenticator::Authenticate(int a_ClientID, const AString & a_UserName, co -void cAuthenticator::Start(void) +void cAuthenticator::Start(cIniFile IniFile) { + ReadINI(IniFile); m_ShouldTerminate = false; super::Start(); } -- cgit v1.2.3 From cb06f35cb80c2162c3b1e9e329fc81b5d8b417da Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sat, 26 Oct 2013 19:47:12 +0200 Subject: Changed "cIniFile IniFile" to cIniFile & IniFile" --- source/Authenticator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/Authenticator.cpp') diff --git a/source/Authenticator.cpp b/source/Authenticator.cpp index a8aad524f..368431010 100644 --- a/source/Authenticator.cpp +++ b/source/Authenticator.cpp @@ -44,7 +44,7 @@ cAuthenticator::~cAuthenticator() /// Read custom values from INI -void cAuthenticator::ReadINI(cIniFile IniFile) +void cAuthenticator::ReadINI(cIniFile & IniFile) { m_Server = IniFile.GetValue("Authentication", "Server"); m_Address = IniFile.GetValue("Authentication", "Address"); @@ -93,7 +93,7 @@ void cAuthenticator::Authenticate(int a_ClientID, const AString & a_UserName, co -void cAuthenticator::Start(cIniFile IniFile) +void cAuthenticator::Start(cIniFile & IniFile) { ReadINI(IniFile); m_ShouldTerminate = false; -- cgit v1.2.3 From a7d44d69ddd8bfd5cd749dc9bcdf23597ae6d1cd Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 27 Oct 2013 09:09:39 +0100 Subject: Authenticator doesn't save the ini file. Didn't load it -> shouldn't save it. --- source/Authenticator.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'source/Authenticator.cpp') diff --git a/source/Authenticator.cpp b/source/Authenticator.cpp index a32e9ce8f..e09fd0871 100644 --- a/source/Authenticator.cpp +++ b/source/Authenticator.cpp @@ -67,7 +67,6 @@ void cAuthenticator::ReadINI(cIniFile & IniFile) if (bSave) { IniFile.SetValueB("Authentication", "Authenticate", m_ShouldAuthenticate); - IniFile.WriteFile("settings.ini"); } } -- cgit v1.2.3