diff options
author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-09-13 23:21:50 +0200 |
---|---|---|
committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-09-13 23:21:50 +0200 |
commit | 85e49d0d143b83432d85b5f645fb667cd166a9fc (patch) | |
tree | f0a1eec3942b2d64fb6be70a37e1bc8b3333f796 | |
parent | 974bf5c427a5b134f09abf48d814f8c8f7e31e3c (diff) | |
parent | f0cd684cd1f944622baac2164aa05e015e6d8060 (diff) |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
src/server/worldserver/worldserver.conf.dist
-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/Logging/AppenderFile.cpp | 4 | ||||
-rw-r--r-- | src/server/shared/Logging/AppenderFile.h | 3 | ||||
-rw-r--r-- | src/server/worldserver/worldserver.conf.dist | 12 |
9 files changed, 64 insertions, 28 deletions
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 03bfe56ac3e..c7bc229f4a9 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1991,10 +1991,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 142d2351662..f297e9a7b75 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1242,6 +1242,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 7e012e7da07..a649791546f 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -168,6 +168,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/Logging/AppenderFile.cpp b/src/server/shared/Logging/AppenderFile.cpp index 93d53bcc30d..54458346bb9 100644 --- a/src/server/shared/Logging/AppenderFile.cpp +++ b/src/server/shared/Logging/AppenderFile.cpp @@ -40,7 +40,7 @@ AppenderFile::~AppenderFile() void AppenderFile::_write(LogMessage const& message) { - bool exceedMaxSize = maxFileSize > 0 && (fileSize + message.Size()) > maxFileSize; + bool exceedMaxSize = maxFileSize > 0 && (fileSize.value() + message.Size()) > maxFileSize; if (dynamicName) { @@ -56,7 +56,7 @@ void AppenderFile::_write(LogMessage const& message) fprintf(logfile, "%s%s", message.prefix.c_str(), message.text.c_str()); fflush(logfile); - fileSize += message.Size(); + fileSize += uint64(message.Size()); if (dynamicName) CloseFile(); diff --git a/src/server/shared/Logging/AppenderFile.h b/src/server/shared/Logging/AppenderFile.h index c15974799e1..de94a46d692 100644 --- a/src/server/shared/Logging/AppenderFile.h +++ b/src/server/shared/Logging/AppenderFile.h @@ -19,6 +19,7 @@ #define APPENDERFILE_H #include "Appender.h" +#include "ace/Atomic_Op.h" class AppenderFile: public Appender { @@ -37,7 +38,7 @@ class AppenderFile: public Appender bool dynamicName; bool backup; uint64 maxFileSize; - uint64 fileSize; + ACE_Atomic_Op<ACE_Thread_Mutex, uint64> fileSize; }; #endif diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 194186c2d9a..dfd382c310e 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -871,6 +871,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 @@ -1187,7 +1194,6 @@ Warden.BanDuration = 86400 ################################################################################################### # PLAYER INTERACTION # -# # AllowTwoSide.Interaction.Calendar # Description: Allow calendar invites between factions. # Default: 0 - (Disabled) @@ -2607,7 +2613,6 @@ UI.ShowQuestLevelsInDialogs = 0 ################################################################################################### ################################################################################################### -# # LOGGING SYSTEM SETTINGS # # Appender config values: Given a appender "name" @@ -2796,7 +2801,6 @@ Log.Async.Enable = 0 ################################################################################################### ################################################################################################### -# # GUILD LEVELING SETTINGS # # Guild.LevelingEnabled @@ -2858,7 +2862,6 @@ Guild.WeeklyReputationCap = 4375 ################################################################################################### ################################################################################################### -# # CURRENCIES SETTINGS # # Currency.ResetInterval @@ -2942,7 +2945,6 @@ Currency.ConquestPointsArenaReward = 180 # ################################################################################################### -# # PACKET SPOOF PROTECTION SETTINGS # # These settings determine which action to take when harmful packet spoofing is detected. |