Merge remote-tracking branch 'origin/master' into 4.3.4

Conflicts:
	src/server/game/Server/WorldSocket.cpp
This commit is contained in:
Nay committed 2013-02-09 20:33:30 +00:00
commit 984e1feadf
23 files changed
+101 -126

No files matched your search

@@ -0,0 +1,3 @@
UPDATE `account` SET `sessionkey`='';
ALTER TABLE `account`
CHANGE `sessionkey` `sessionkey` varchar(80) NOT NULL DEFAULT '' COMMENT 'Temporary storage of session key used to pass data from authserver to worldserver' AFTER `sha_pass_hash`;
@@ -0,0 +1 @@
ALTER TABLE `account` CHANGE `sessionkey` `sessionkey` varchar(80) NOT NULL DEFAULT '' AFTER `sha_pass_hash`;
@@ -0,0 +1,8 @@
DELETE FROM `areatrigger_teleport` WHERE `id` IN (2406, 2407, 2408, 2409, 2410, 2411);
INSERT INTO `areatrigger_teleport` (`id`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`, `name`) VALUES
(2406, 0, -276.241, 1652.68, 77.5589, 3.14159, 'Shadowfang - South Fall Target'),
(2407, 0, -276.241, 1652.68, 77.5589, 3.14159, 'Shadowfang - South Fall Target'),
(2408, 0, -225.34, 1556.53, 93.0454, 4.71239, 'Shadowfang Front Fall Exit Target'),
(2409, 0, -225.34, 1556.53, 93.0454, 4.71239, 'Shadowfang Front Fall Exit Target'),
(2410, 0, -181.26, 1580.65, 97.4466, 6.28319, 'Shadowfang - North Fall Target'),
(2411, 0, -181.26, 1580.65, 97.4466, 6.28319, 'Shadowfang - North Fall Target');
@@ -0,0 +1,10 @@
SET @GUID = 4522;
SET @SINK = 300177;
-- spawn TEMP South Sinkhole
DELETE FROM `gameobject` WHERE `guid`=@GUID AND `id`=@SINK;
INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
(@GUID, @SINK, 571, 1, 1, 3488.48, 4515.98, -20.7394, 5.34436, 0, 0, 0.452361, -0.891835, 300, 0, 1);
-- increase TEMP South Sinkhole spellfocus radius
UPDATE `gameobject_template` SET `data1`=20 WHERE `entry`=@SINK;
+1 -1
View File
@@ -207,7 +207,7 @@ AuthSocket::AuthSocket(RealmSocket& socket) : pPatch(NULL), socket_(socket)
// Close patch file descriptor before leaving
AuthSocket::~AuthSocket(void) {}
// Accept the connection and set the s random value for SRP6
// Accept the connection
void AuthSocket::OnAccept(void)
{
sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' Accepting connection", socket().getRemoteAddress().c_str(), socket().getRemotePort());
+1 -5
View File
@@ -132,16 +132,12 @@ namespace FactorySelector
const GameObjectAICreator* ai_factory = NULL;
GameObjectAIRegistry& ai_registry(*GameObjectAIRepository::instance());
// scriptname in db
if (GameObjectAI* scriptedAI = sScriptMgr->GetGameObjectAI(go))
return scriptedAI;
ai_factory = ai_registry.GetRegistryItem(go->GetAIName());
// scriptname in db
if (!ai_factory)
if (GameObjectAI* scriptedAI = sScriptMgr->GetGameObjectAI(go))
return scriptedAI;
//future goAI types go here
std::string ainame = (ai_factory == NULL || go->GetScriptId()) ? "NullGameObjectAI" : ai_factory->key();
+6 -5
View File
@@ -430,13 +430,14 @@ void SmartAI::MovementInform(uint32 MovementType, uint32 Data)
void SmartAI::RemoveAuras()
{
// Only loop throught the applied auras, because here is where all auras on the current unit are stored
Unit::AuraApplicationMap appliedAuras = me->GetAppliedAuras();
for (Unit::AuraApplicationMap::iterator iter = appliedAuras.begin(); iter != appliedAuras.end(); ++iter)
Unit::AuraApplicationMap& appliedAuras = me->GetAppliedAuras();
for (Unit::AuraApplicationMap::iterator iter = appliedAuras.begin(); iter != appliedAuras.end();)
{
Aura const* aura = iter->second->GetBase();
if (!aura->GetSpellInfo()->IsPassive() && !aura->GetSpellInfo()->HasAura(SPELL_AURA_CONTROL_VEHICLE) && aura->GetCaster() != me)
me->RemoveAurasDueToSpell(aura->GetId());
if (!aura->IsPassive() && !aura->HasEffectType(SPELL_AURA_CONTROL_VEHICLE) && aura->GetCasterGUID() != me->GetGUID())
me->RemoveAura(iter);
else
++iter;
}
}
+8
View File
@@ -187,6 +187,14 @@ AccountOpResult AccountMgr::ChangePassword(uint32 accountId, std::string newPass
LoginDatabase.Execute(stmt);
stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_VS);
stmt->setString(0, "");
stmt->setString(1, "");
stmt->setString(2, username);
LoginDatabase.Execute(stmt);
return AOR_OK;
}
+5 -4
View File
@@ -162,16 +162,17 @@ bool Battlefield::Update(uint32 diff)
// Kick players who chose not to accept invitation to the battle
if (m_uiKickDontAcceptTimer <= diff)
{
time_t now = time(NULL);
for (int team = 0; team < 2; team++)
for (PlayerTimerMap::iterator itr = m_InvitedPlayers[team].begin(); itr != m_InvitedPlayers[team].end(); ++itr)
if ((*itr).second <= time(NULL))
KickPlayerFromBattlefield((*itr).first);
if (itr->second <= now)
KickPlayerFromBattlefield(itr->first);
InvitePlayersInZoneToWar();
for (int team = 0; team < 2; team++)
for (PlayerTimerMap::iterator itr = m_PlayersWillBeKick[team].begin(); itr != m_PlayersWillBeKick[team].end(); ++itr)
if ((*itr).second <= time(NULL))
KickPlayerFromBattlefield((*itr).first);
if (itr->second <= now)
KickPlayerFromBattlefield(itr->first);
m_uiKickDontAcceptTimer = 1000;
}
+1 -1
View File
@@ -72,7 +72,7 @@ class BfGraveyard;
typedef std::set<uint64> GuidSet;
typedef std::vector<BfGraveyard*> GraveyardVect;
typedef std::map<uint64, uint32> PlayerTimerMap;
typedef std::map<uint64, time_t> PlayerTimerMap;
class BfCapturePoint
{
+3 -1
View File
@@ -1565,7 +1565,9 @@ void Player::Update(uint32 p_time)
GetSession()->m_muteTime = 0;
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
stmt->setInt64(0, 0); // Set the mute time to 0
stmt->setUInt32(1, GetSession()->GetAccountId());
stmt->setString(1, "");
stmt->setString(2, "");
stmt->setUInt32(3, GetSession()->GetAccountId());
LoginDatabase.Execute(stmt);
}
@@ -100,6 +100,8 @@ typedef std::map<int8, VehicleSeat> SeatMap;
class TransportBase
{
public:
virtual ~TransportBase() { }
/// This method transforms supplied transport offsets into global coordinates
virtual void CalculatePassengerPosition(float& x, float& y, float& z, float& o) = 0;
+7 -9
View File
@@ -840,6 +840,8 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
}
// Get the account information from the realmd database
// 0 1 2 3 4 5 6 7 8
// SELECT id, sessionkey, last_ip, locked, expansion, mutetime, locale, recruiter, os FROM account WHERE username = ?
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_INFO_BY_NAME);
stmt->setString(0, account);
@@ -856,15 +858,11 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
Field* fields = result->Fetch();
uint8 expansion = fields[6].GetUInt8();
uint8 expansion = fields[4].GetUInt8();
uint32 world_expansion = sWorld->getIntConfig(CONFIG_EXPANSION);
if (expansion > world_expansion)
expansion = world_expansion;
sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: (s, v) check s: %s v: %s",
fields[5].GetCString(),
fields[4].GetCString());
///- Re-check ip locking (same check as in realmd).
if (fields[3].GetUInt8() == 1) // if ip is locked
{
@@ -880,7 +878,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
k.SetHexStr(fields[1].GetCString());
int64 mutetime = fields[7].GetInt64();
int64 mutetime = fields[5].GetInt64();
//! Negative mutetime indicates amount of seconds to be muted effective on next login - which is now.
if (mutetime < 0)
{
@@ -894,12 +892,12 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
LoginDatabase.Execute(stmt);
}
locale = LocaleConstant (fields[8].GetUInt8());
locale = LocaleConstant (fields[6].GetUInt8());
if (locale >= TOTAL_LOCALES)
locale = LOCALE_enUS;
uint32 recruiter = fields[9].GetUInt32();
std::string os = fields[10].GetString();
uint32 recruiter = fields[7].GetUInt32();
std::string os = fields[8].GetString();
// Must be done before WorldSession is created
if (sWorld->getBoolConfig(CONFIG_WARDEN_ENABLED) && os != "Win" && os != "OSX")
+33 -89
View File
@@ -37,7 +37,6 @@ EndContentData */
enum DyingKodo
{
// signed for 9999
SAY_SMEED_HOME = 0,
QUEST_KODO = 5561,
@@ -49,7 +48,7 @@ enum DyingKodo
NPC_TAMED_KODO = 11627,
SPELL_KODO_KOMBO_ITEM = 18153,
SPELL_KODO_KOMBO_PLAYER_BUFF = 18172, //spells here have unclear function, but using them at least for visual parts and checks
SPELL_KODO_KOMBO_PLAYER_BUFF = 18172,
SPELL_KODO_KOMBO_DESPAWN_BUFF = 18377,
SPELL_KODO_KOMBO_GOSSIP = 18362
@@ -64,111 +63,56 @@ public:
{
if (player->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) && creature->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF))
{
//the expected quest objective
player->TalkedToCreature(creature->GetEntry(), creature->GetGUID());
player->TalkedToCreature(creature->GetEntry(), 0);
player->RemoveAurasDueToSpell(SPELL_KODO_KOMBO_PLAYER_BUFF);
creature->GetMotionMaster()->MoveIdle();
}
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
bool EffectDummyCreature(Unit* pCaster, uint32 spellId, uint32 effIndex, Creature* creatureTarget)
struct npc_aged_dying_ancient_kodoAI : public ScriptedAI
{
//always check spellid and effectindex
if (spellId == SPELL_KODO_KOMBO_ITEM && effIndex == 0)
npc_aged_dying_ancient_kodoAI(Creature* creature) : ScriptedAI(creature) {}
void MoveInLineOfSight(Unit* who)
{
//no effect if player/creature already have aura from spells
if (pCaster->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) || creatureTarget->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF))
return true;
if (creatureTarget->GetEntry() == NPC_AGED_KODO ||
creatureTarget->GetEntry() == NPC_DYING_KODO ||
creatureTarget->GetEntry() == NPC_ANCIENT_KODO)
if (who->GetEntry() == NPC_SMEED && me->IsWithinDistInMap(who, 10.0f) && !me->HasAura(SPELL_KODO_KOMBO_GOSSIP))
{
pCaster->CastSpell(pCaster, SPELL_KODO_KOMBO_PLAYER_BUFF, true);
creatureTarget->UpdateEntry(NPC_TAMED_KODO);
creatureTarget->CastSpell(creatureTarget, SPELL_KODO_KOMBO_DESPAWN_BUFF, false);
if (creatureTarget->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
creatureTarget->GetMotionMaster()->MoveIdle();
creatureTarget->GetMotionMaster()->MoveFollow(pCaster, PET_FOLLOW_DIST, creatureTarget->GetFollowAngle());
me->GetMotionMaster()->Clear();
DoCast(me, SPELL_KODO_KOMBO_GOSSIP, true);
if (Creature* smeed = who->ToCreature())
smeed->AI()->Talk(SAY_SMEED_HOME);
}
//always return true when we are handling this spell and effect
return true;
}
return false;
}
void SpellHit(Unit* caster, SpellInfo const* spell)
{
if (spell->Id == SPELL_KODO_KOMBO_ITEM)
{
if (!(caster->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) || me->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF))
&& (me->GetEntry() == NPC_AGED_KODO || me->GetEntry() == NPC_DYING_KODO || me->GetEntry() == NPC_ANCIENT_KODO))
{
caster->CastSpell(caster, SPELL_KODO_KOMBO_PLAYER_BUFF, true);
DoCast(me, SPELL_KODO_KOMBO_DESPAWN_BUFF, true);
me->UpdateEntry(NPC_TAMED_KODO);
me->GetMotionMaster()->MoveFollow(caster, PET_FOLLOW_DIST, me->GetFollowAngle());
}
}
else if (spell->Id == SPELL_KODO_KOMBO_GOSSIP)
{
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->DespawnOrUnsummon(60000);
}
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_aged_dying_ancient_kodoAI(creature);
}
struct npc_aged_dying_ancient_kodoAI : public ScriptedAI
{
npc_aged_dying_ancient_kodoAI(Creature* creature) : ScriptedAI(creature) { Reset(); }
uint32 DespawnTimer;
void Reset()
{
DespawnTimer = 0;
}
void MoveInLineOfSight(Unit* who)
{
if (who->GetEntry() == NPC_SMEED)
{
if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
return;
if (me->IsWithinDistInMap(who, 10.0f))
{
if (Creature* talker = who->ToCreature())
talker->AI()->Talk(SAY_SMEED_HOME);
//spell have no implemented effect (dummy), so useful to notify spellHit
DoCast(me, SPELL_KODO_KOMBO_GOSSIP, true);
}
}
}
void SpellHit(Unit* /*pCaster*/, SpellInfo const* pSpell)
{
if (pSpell->Id == SPELL_KODO_KOMBO_GOSSIP)
{
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
DespawnTimer = 60000;
}
}
void UpdateAI(const uint32 diff)
{
//timer should always be == 0 unless we already updated entry of creature. Then not expect this updated to ever be in combat.
if (DespawnTimer && DespawnTimer <= diff)
{
if (!me->getVictim() && me->isAlive())
{
Reset();
me->setDeathState(JUST_DIED);
me->Respawn();
return;
}
} else DespawnTimer -= diff;
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
};
};
/*######
@@ -322,5 +322,5 @@ public:
void AddSC_boss_volazj()
{
new boss_volazj;
new boss_volazj();
}
@@ -424,7 +424,7 @@ public:
void AddSC_boss_taldaram()
{
new boss_taldaram;
new mob_taldaram_flamesphere;
new prince_taldaram_sphere;
new boss_taldaram();
new mob_taldaram_flamesphere();
new prince_taldaram_sphere();
}
@@ -336,5 +336,5 @@ public:
void AddSC_instance_ahnkahet()
{
new instance_ahnkahet;
new instance_ahnkahet();
}
@@ -360,5 +360,5 @@ public:
void AddSC_boss_anub_arak()
{
new boss_anub_arak;
new boss_anub_arak();
}
@@ -198,5 +198,5 @@ public:
void AddSC_boss_hadronox()
{
new boss_hadronox;
new boss_hadronox();
}
@@ -213,5 +213,5 @@ public:
void AddSC_instance_azjol_nerub()
{
new instance_azjol_nerub;
new instance_azjol_nerub();
}
@@ -153,7 +153,7 @@ public:
Summons.DespawnAll();
}
void EnterCombat(Unit* who)
void EnterCombat(Unit* /*who*/)
{
if (instance)
instance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS);
@@ -77,7 +77,8 @@ class DatabaseWorkerPool
{
T* t = new T(_queue, _connectionInfo);
res &= t->Open();
WPFatal (mysql_get_server_version(t->GetHandle()) >= MIN_MYSQL_SERVER_VERSION, "TrinityCore does not support MySQL versions below 5.1");
if (res) // only check mysql version if connection is valid
WPFatal(mysql_get_server_version(t->GetHandle()) >= MIN_MYSQL_SERVER_VERSION, "TrinityCore does not support MySQL versions below 5.1");
_connections[IDX_ASYNC][i] = t;
++_connectionCount[IDX_ASYNC];
}
@@ -42,7 +42,7 @@ void LoginDatabaseConnection::DoPrepareStatements()
PrepareStatement(LOGIN_SEL_FAILEDLOGINS, "SELECT id, failed_logins FROM account WHERE username = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_ID_BY_NAME, "SELECT id FROM account WHERE username = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_LIST_BY_NAME, "SELECT id, username FROM account WHERE username = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_INFO_BY_NAME, "SELECT id, sessionkey, last_ip, locked, v, s, expansion, mutetime, locale, recruiter, os FROM account WHERE username = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_INFO_BY_NAME, "SELECT id, sessionkey, last_ip, locked, expansion, mutetime, locale, recruiter, os FROM account WHERE username = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL, "SELECT id, username FROM account WHERE email = ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_NUM_CHARS_ON_REALM, "SELECT numchars FROM realmcharacters WHERE realmid = ? AND acctid= ?", CONNECTION_SYNCH);
PrepareStatement(LOGIN_SEL_ACCOUNT_BY_IP, "SELECT id, username FROM account WHERE last_ip = ?", CONNECTION_SYNCH);