diff options
-rw-r--r-- | sql/updates/world/2013_09_11_01_world_sai.sql | 5 | ||||
-rw-r--r-- | sql/updates/world/2013_09_12_00_world_sai.sql | 17 | ||||
-rw-r--r-- | sql/updates/world/2013_09_13_00_world_conditions.sql | 1 | ||||
-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 |
9 files changed, 66 insertions, 23 deletions
diff --git a/sql/updates/world/2013_09_11_01_world_sai.sql b/sql/updates/world/2013_09_11_01_world_sai.sql new file mode 100644 index 00000000000..cb65806b29e --- /dev/null +++ b/sql/updates/world/2013_09_11_01_world_sai.sql @@ -0,0 +1,5 @@ +UPDATE `creature_template` SET`AIName`='SmartAI' WHERE `entry`=26321; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=26321; +DELETE FROM `smart_scripts` WHERE `entryorguid`=26321; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(26321,0,0,0,8,0,100,1,47530,0,0,0,33,26321,0,0,0,0,0,7,0,0,0,0,0,0,0,'Lothalor Ancient - On Spellhit - Give Credit to Invoker'); diff --git a/sql/updates/world/2013_09_12_00_world_sai.sql b/sql/updates/world/2013_09_12_00_world_sai.sql new file mode 100644 index 00000000000..449eebbc258 --- /dev/null +++ b/sql/updates/world/2013_09_12_00_world_sai.sql @@ -0,0 +1,17 @@ +-- [QUEST] War Is Hell +UPDATE `creature` SET `spawntimesecs`=60 WHERE `id` IN (24009,24010); + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (24009,24010); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (24009,24010) AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +-- Alliance Corpse +(24009, 0, 0, 1, 8, 0, 100, 1, 42793, 0, 0, 0, 11, 43297, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Alliance Corpse - SMART_EVENT_SPELLHIT - SMART_ACTION_CAST'), +(24009, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 20000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Alliance Corpse - SMART_EVENT_LINK - SMART_ACTION_FORCE_DESPAWN'), +-- Forsaken Corpse +(24010, 0, 0, 1, 8, 0, 100, 1, 42793, 0, 0, 0, 11, 43297, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Forsaken Corpse - SMART_EVENT_SPELLHIT - SMART_ACTION_CAST'), +(24010, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 20000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Forsaken Corpse - SMART_EVENT_LINK - SMART_ACTION_FORCE_DESPAWN'); + +DELETE FROM `conditions` WHERE `SourceEntry`=42793 AND `SourceTypeOrReferenceId`=17; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(17, 0, 42793, 0, 0, 31, 1, 3, 24009, 0, 0, 0, 0, '', ''), +(17, 0, 42793, 0, 1, 31, 1, 3, 24010, 0, 0, 0, 0, '', ''); diff --git a/sql/updates/world/2013_09_13_00_world_conditions.sql b/sql/updates/world/2013_09_13_00_world_conditions.sql new file mode 100644 index 00000000000..8f8dc774e54 --- /dev/null +++ b/sql/updates/world/2013_09_13_00_world_conditions.sql @@ -0,0 +1 @@ +UPDATE `conditions` SET `ElseGroup`=2 WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=75509; 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. |