summaryrefslogtreecommitdiff
path: root/bouncer/netcore.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2014-02-15 10:01:21 +0100
committerTreeki <treeki@gmail.com>2014-02-15 10:01:21 +0100
commit878a0c157b772a7ed04d4cc395059087f964b823 (patch)
tree623ad18853c846b6498ebbc56eb436a792f32ad3 /bouncer/netcore.cpp
parent04cf34e30aa6541568660dfe9e77b2b2c0a9db88 (diff)
downloadbounce4-878a0c157b772a7ed04d4cc395059087f964b823.tar.gz
bounce4-878a0c157b772a7ed04d4cc395059087f964b823.zip
implement rudimentary password authentication
Diffstat (limited to 'bouncer/netcore.cpp')
-rw-r--r--bouncer/netcore.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/bouncer/netcore.cpp b/bouncer/netcore.cpp
index f8c484e..98f13a1 100644
--- a/bouncer/netcore.cpp
+++ b/bouncer/netcore.cpp
@@ -329,6 +329,10 @@ void NetCore::loadConfig() {
auto sections = INI::load("config.ini");
for (auto &section : sections) {
+ if (section.title == "Header") {
+ bouncerPassword = section.data["password"];
+ }
+
if (section.title == "Server" && serverCount < SERVER_LIMIT) {
Server *s = constructServer(section.data["type"].c_str());
if (s) {
@@ -342,6 +346,13 @@ void NetCore::loadConfig() {
void NetCore::saveConfig() {
std::list<INI::Section> sections;
+ INI::Section header;
+ header.title = "Header";
+
+ header.data["password"] = bouncerPassword;
+
+ sections.push_back(header);
+
for (int i = 0; i < serverCount; i++) {
INI::Section section;
section.title = "Server";