diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Groups/Group.cpp | 18 | ||||
| -rw-r--r-- | src/server/game/World/World.cpp | 3 | ||||
| -rw-r--r-- | src/server/game/World/World.h | 1 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_account.cpp | 33 | ||||
| -rw-r--r-- | src/server/shared/Packets/ByteBuffer.h | 1 | ||||
| -rw-r--r-- | src/server/worldserver/worldserver.conf.dist | 10 |
6 files changed, 43 insertions, 23 deletions
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index f43e49a3440..8ec6aac9d4e 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1943,10 +1943,22 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo) if (SendMsgTo) { - if (isEmpty) - SendMsgTo->SendResetInstanceSuccess(instanceSave->GetMapId()); - else + if (!isEmpty) SendMsgTo->SendResetInstanceFailed(0, instanceSave->GetMapId()); + else if (sWorld->getBoolConfig(CONFIG_INSTANCES_RESET_ANNOUNCE)) + { + if (Group* group = SendMsgTo->GetGroup()) + { + for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) + if (Player* player = itr->GetSource()) + player->SendResetInstanceSuccess(instanceSave->GetMapId()); + } + + else + SendMsgTo->SendResetInstanceSuccess(instanceSave->GetMapId()); + } + else + SendMsgTo->SendResetInstanceSuccess(instanceSave->GetMapId()); } if (isEmpty || method == INSTANCE_RESET_GROUP_DISBAND || method == INSTANCE_RESET_CHANGE_DIFFICULTY) diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index bfc512bc9a6..9e7b1f2f2b5 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1206,6 +1206,9 @@ void World::LoadConfigSettings(bool reload) // Max instances per hour m_int_configs[CONFIG_MAX_INSTANCES_PER_HOUR] = sConfigMgr->GetIntDefault("AccountInstancesPerHour", 5); + // Anounce reset of instance to whole party + m_bool_configs[CONFIG_INSTANCES_RESET_ANNOUNCE] = sConfigMgr->GetBoolDefault("InstancesResetAnnounce", false); + // AutoBroadcast m_bool_configs[CONFIG_AUTOBROADCAST] = sConfigMgr->GetBoolDefault("AutoBroadcast.On", false); m_int_configs[CONFIG_AUTOBROADCAST_CENTER] = sConfigMgr->GetIntDefault("AutoBroadcast.Center", 0); diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index edcabf71095..9435fa8aa94 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -160,6 +160,7 @@ enum WorldBoolConfigs CONFIG_UI_QUESTLEVELS_IN_DIALOGS, // Should we add quest levels to the title in the NPC dialogs? CONFIG_EVENT_ANNOUNCE, CONFIG_STATS_LIMITS_ENABLE, + CONFIG_INSTANCES_RESET_ANNOUNCE, BOOL_CONFIG_VALUE_COUNT }; diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index c48eba50f72..f0d27104035 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -438,6 +438,7 @@ public: static bool HandleAccountPasswordCommand(ChatHandler* handler, char const* args) { + // If no args are given at all, we can return false right away. if (!*args) { handler->SendSysMessage(LANG_CMD_SYNTAX); @@ -445,13 +446,18 @@ public: return false; } + // First, we check config. What security type (sec type) is it ? Depending on it, the command branches out uint32 pwConfig = sWorld->getIntConfig(CONFIG_ACC_PASSCHANGESEC); // 0 - PW_NONE, 1 - PW_EMAIL, 2 - PW_RBAC - char* oldPassword = strtok((char*)args, " "); - char* newPassword = strtok(NULL, " "); - char* passwordConfirmation = strtok(NULL, " "); - char* emailConfirmation = strtok(NULL, " "); + // Command is supposed to be: .account password [$oldpassword] [$newpassword] [$newpasswordconfirmation] [$emailconfirmation] + char* oldPassword = strtok((char*)args, " "); // This extracts [$oldpassword] + char* newPassword = strtok(NULL, " "); // This extracts [$newpassword] + char* passwordConfirmation = strtok(NULL, " "); // This extracts [$newpasswordconfirmation] + const char* emailConfirmation; // This defines the emailConfirmation variable, which is optional depending on sec type. + if (!(emailConfirmation = strtok(NULL, " "))) // This extracts [$emailconfirmation]. If it doesn't exist, however... + emailConfirmation = ""; // ... it's simply "" for emailConfirmation. + //Is any of those variables missing for any reason ? We return false. if (!oldPassword || !newPassword || !passwordConfirmation) { handler->SendSysMessage(LANG_CMD_SYNTAX); @@ -459,17 +465,7 @@ public: return false; } - if ((pwConfig == PW_EMAIL || (pwConfig == PW_RBAC && handler->HasPermission(RBAC_PERM_EMAIL_CONFIRM_FOR_PASS_CHANGE))) && !emailConfirmation) - { - handler->SendSysMessage(LANG_CMD_SYNTAX); - handler->SetSentErrorMessage(true); - TC_LOG_INFO(LOG_FILTER_CHARACTER, "Account: %u (IP: %s) Character:[%s] (GUID: %u) Tried to change password, but entered no email at all. Has Perm: [%s]", - handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress().c_str(), - handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUIDLow(), - handler->HasPermission(RBAC_PERM_EMAIL_CONFIRM_FOR_PASS_CHANGE) ? "Yes" : "No"); - return false; - } - + // We compare the old, saved password to the entered old password - no chance for the unauthorized. if (!AccountMgr::CheckPassword(handler->GetSession()->GetAccountId(), std::string(oldPassword))) { handler->SendSysMessage(LANG_COMMAND_WRONGOLDPASSWORD); @@ -480,8 +476,9 @@ public: return false; } - if ((pwConfig == PW_EMAIL || (pwConfig == PW_RBAC && handler->HasPermission(RBAC_PERM_EMAIL_CONFIRM_FOR_PASS_CHANGE))) // Either PW_EMAIL or PW_RBAC with the Permission - && !AccountMgr::CheckEmail(handler->GetSession()->GetAccountId(), std::string(emailConfirmation))) + // This compares the old, current email to the entered email - however, only... + if ((pwConfig == PW_EMAIL || (pwConfig == PW_RBAC && handler->HasPermission(RBAC_PERM_EMAIL_CONFIRM_FOR_PASS_CHANGE))) // ...if either PW_EMAIL or PW_RBAC with the Permission is active... + && !AccountMgr::CheckEmail(handler->GetSession()->GetAccountId(), std::string(emailConfirmation))) // ... and returns false if the comparison fails. { handler->SendSysMessage(LANG_COMMAND_WRONGEMAIL); handler->SetSentErrorMessage(true); @@ -492,6 +489,7 @@ public: return false; } + // Making sure that newly entered password is correctly entered. if (strcmp(newPassword, passwordConfirmation) != 0) { handler->SendSysMessage(LANG_NEW_PASSWORDS_NOT_MATCH); @@ -499,6 +497,7 @@ public: return false; } + // Changes password and prints result. AccountOpResult result = AccountMgr::ChangePassword(handler->GetSession()->GetAccountId(), std::string(newPassword)); switch (result) { diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index b015e8daa35..d2677538805 100644 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -23,6 +23,7 @@ #include "Errors.h" #include "ByteConverter.h" +#include <ace/OS_NS_time.h> #include <exception> #include <list> #include <map> diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index cd9c475c5a2..62008a3eb38 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -907,6 +907,13 @@ Instance.ResetTimeHour = 4 Instance.UnloadDelay = 1800000 # +# InstancesResetAnnounce +# Description: Announce the reset of one instance to whole party. +# Default: false - (Disabled, don't show, blizzlike) +# true - (Enabled, show) + +InstancesResetAnnounce = false +# # Quests.LowLevelHideDiff # Description: Level difference between player and quest level at which quests are # considered low-level and are not shown via exclamation mark (!) at quest @@ -1213,7 +1220,6 @@ Warden.BanDuration = 86400 ################################################################################################### # PLAYER INTERACTION # -# # AllowTwoSide.Interaction.Calendar # Description: Allow calendar invites between factions. # Default: 0 - (Disabled) @@ -2639,7 +2645,6 @@ UI.ShowQuestLevelsInDialogs = 0 ################################################################################################### ################################################################################################### -# # LOGGING SYSTEM SETTINGS # # Appender config values: Given a appender "name" @@ -2828,7 +2833,6 @@ Log.Async.Enable = 0 ################################################################################################### ################################################################################################### -# # PACKET SPOOF PROTECTION SETTINGS # # These settings determine which action to take when harmful packet spoofing is detected. |
