diff --git a/bin/config_sample/config.ini b/bin/config_sample/config.ini index aa550251..79bd560a 100644 --- a/bin/config_sample/config.ini +++ b/bin/config_sample/config.ini @@ -8,9 +8,12 @@ port=27016 ; The server description that will appear on the master server. server_description=This is a placeholder server description. Tell the world of AO who you are here! -; The server's name. This appears both on the master server, and in messages sent to users by the server. +; The server's name. This appears on the master server. server_name=An Unnamed Server +; The server's nickname. This appears in messages sent to users by the server. +server_nick=NickName + ; The server's Message of the Day. This will be sent in OOC to joining users. motd=MOTD is not set. diff --git a/bin_tests/config/config.ini b/bin_tests/config/config.ini index aa550251..79bd560a 100644 --- a/bin_tests/config/config.ini +++ b/bin_tests/config/config.ini @@ -8,9 +8,12 @@ port=27016 ; The server description that will appear on the master server. server_description=This is a placeholder server description. Tell the world of AO who you are here! -; The server's name. This appears both on the master server, and in messages sent to users by the server. +; The server's name. This appears on the master server. server_name=An Unnamed Server +; The server's nickname. This appears in messages sent to users by the server. +server_nick=NickName + ; The server's Message of the Day. This will be sent in OOC to joining users. motd=MOTD is not set. diff --git a/core/include/config_manager.h b/core/include/config_manager.h index 434eda9f..5a5e9a54 100644 --- a/core/include/config_manager.h +++ b/core/include/config_manager.h @@ -150,6 +150,13 @@ class ConfigManager */ static QString serverName(); + /** + * @brief Returns the server nickname. + * + * @return See short description. + */ + static QString serverNick(); + /** * @brief Returns the server's Message of the Day. * diff --git a/core/src/aoclient.cpp b/core/src/aoclient.cpp index 9866b557..c5127223 100644 --- a/core/src/aoclient.cpp +++ b/core/src/aoclient.cpp @@ -433,17 +433,17 @@ void AOClient::calculateIpid() void AOClient::sendServerMessage(QString message) { - sendPacket("CT", {ConfigManager::serverName(), message, "1"}); + sendPacket("CT", {ConfigManager::serverNick(), message, "1"}); } void AOClient::sendServerMessageArea(QString message) { - server->broadcast(AOPacket("CT", {ConfigManager::serverName(), message, "1"}), m_current_area); + server->broadcast(AOPacket("CT", {ConfigManager::serverNick(), message, "1"}), m_current_area); } void AOClient::sendServerBroadcast(QString message) { - server->broadcast(AOPacket("CT", {ConfigManager::serverName(), message, "1"})); + server->broadcast(AOPacket("CT", {ConfigManager::serverNick(), message, "1"})); } bool AOClient::checkPermission(ACLRole::Permission f_permission) const diff --git a/core/src/config_manager.cpp b/core/src/config_manager.cpp index 07595fab..b11cc926 100644 --- a/core/src/config_manager.cpp +++ b/core/src/config_manager.cpp @@ -301,6 +301,11 @@ QString ConfigManager::serverName() return m_settings->value("Options/server_name", "An Unnamed Server").toString(); } +QString ConfigManager::serverNick() +{ + return m_settings->value("Options/server_nick", "").toString(); +} + QString ConfigManager::motd() { return m_settings->value("Options/motd", "MOTD not set").toString();