Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4

Conflicts:
	src/server/worldserver/worldserver.conf.dist
This commit is contained in:
Vincent-Michael
2013-09-13 23:21:50 +02:00
9 changed files with 64 additions and 28 deletions

View File

@@ -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, '', '');

View File

@@ -0,0 +1 @@
UPDATE `conditions` SET `ElseGroup`=2 WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=75509;

View File

@@ -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)

View File

@@ -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);

View File

@@ -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
};

View File

@@ -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)
{

View File

@@ -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();

View File

@@ -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

View File

@@ -870,6 +870,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
@@ -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.