Revert some commits. Now repo is stable. I recommend to disable Wintergrasp, because now its use leads to a crash.

--HG--
branch : trunk
This commit is contained in:
n0n4m3
2009-12-27 11:27:38 +01:00
parent bdc8ba8b0c
commit 4737d8111a
2 changed files with 58 additions and 73 deletions
+2 -5
View File
@@ -737,7 +737,7 @@ void BattleGround::EndBattleGround(uint32 winner)
} }
// should remove spirit of redemption // should remove spirit of redemption
if (plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION)) if(plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
plr->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT); plr->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
if (!plr->isAlive()) if (!plr->isAlive())
@@ -996,12 +996,9 @@ void BattleGround::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
Player *plr = objmgr.GetPlayer(guid); Player *plr = objmgr.GetPlayer(guid);
// should remove spirit of redemption // should remove spirit of redemption
if (plr && plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION)) if(plr && plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
plr->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT); plr->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
if (plr->HasAuraType(SPELL_AURA_MOUNTED))
plr->RemoveAurasByType(SPELL_AURA_MOUNTED);
if(plr && !plr->isAlive()) // resurrect on exit if(plr && !plr->isAlive()) // resurrect on exit
{ {
plr->ResurrectPlayer(1.0f); plr->ResurrectPlayer(1.0f);
+51 -63
View File
@@ -1288,102 +1288,90 @@ void BattleGroundMgr::BuildBattleGroundStatusPacket(WorldPacket *data, BattleGro
void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg) void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg)
{ {
data->Initialize(MSG_PVP_LOG_DATA, (1+1+4+40*bg->GetPlayerScoresSize()));
uint8 type = (bg->isArena() ? 1 : 0); uint8 type = (bg->isArena() ? 1 : 0);
// last check on 3.0.3
data->Initialize(MSG_PVP_LOG_DATA, (1+1+4+40*bg->GetPlayerScoresSize()));
*data << uint8(type); // type (battleground=0/arena=1) *data << uint8(type); // type (battleground=0/arena=1)
if (type) // arena
if(type) // arena
{ {
if (bg->isRated()) // it seems this must be according to BG_WINNER_A/H and _NOT_ BG_TEAM_A/H
for (int i = 1; i >= 0; --i)
{ {
for (int8 i = 1; i >= 0; --i) // Rating difference per team first *data << uint32(bg->m_ArenaTeamRatingChanges[i]);
{ *data << uint32(3999); // huge thanks for TOM_RUS for this!
*data << uint32(0); // Padding *data << uint32(0); // added again in 3.1
*data << uint32(3000 + bg->m_ArenaTeamRatingChanges[i]); // rating change + 3000 sLog.outDebug("rating change: %d", bg->m_ArenaTeamRatingChanges[i]);
*data << uint32(0); // added again in 3.1 - padding?
} }
for (int8 i = 1; i >= 0; --i) // Send out arena team names per team for (int i = 1; i >= 0; --i)
{ {
uint32 at_id = bg->m_ArenaTeamIds[i]; uint32 at_id = bg->m_ArenaTeamIds[i];
ArenaTeam * at = objmgr.GetArenaTeamById(at_id); ArenaTeam * at = objmgr.GetArenaTeamById(at_id);
if (at)
*data << at->GetName(); *data << at->GetName();
} else
} *data << (uint8)0;
else // if (!bg->isRated())
{
// padding // /\rating // padding // team name
*data << uint32(0) << uint32(0) << uint32(0) << uint8(0);
*data << uint32(0) << uint32(0) << uint32(0) << uint8(0);
} }
} }
if (bg->GetStatus() != STATUS_WAIT_LEAVE) if (bg->GetStatus() != STATUS_WAIT_LEAVE)
{ {
*data << uint8(0); // Battleground still in progress. *data << uint8(0); // bg not ended
} }
else else
{ {
*data << uint8(1); // Battleground ended. *data << uint8(1); // bg ended
*data << uint8(bg->GetWinner()); // 0 or 1 *data << uint8(bg->GetWinner()); // who win
} }
*data << uint32(bg->GetPlayerScoresSize()); // Can't possibly be negative, but it was sent as int32 before. *data << (int32)(bg->GetPlayerScoresSize());
for (BattleGround::BattleGroundScoreMap::const_iterator itr = bg->GetPlayerScoresBegin(); itr != bg->GetPlayerScoresEnd(); ++itr) for (BattleGround::BattleGroundScoreMap::const_iterator itr = bg->GetPlayerScoresBegin(); itr != bg->GetPlayerScoresEnd(); ++itr)
{ {
// In here we send players' individual statistics for the match. *data << (uint64)itr->first;
*data << uint64(itr->first); // Player GUID *data << (int32)itr->second->KillingBlows;
*data << uint32(itr->second->KillingBlows); if (type == 0)
if (type) // if (bg->isArena()) {
*data << (int32)itr->second->HonorableKills;
*data << (int32)itr->second->Deaths;
*data << (int32)(itr->second->BonusHonor);
}
else
{ {
// BG Team ID (Green/Gold team, not faction teams in arena)
Player *plr = objmgr.GetPlayer(itr->first); Player *plr = objmgr.GetPlayer(itr->first);
uint8 team = 0; uint32 team = bg->GetPlayerTeam(itr->first);
if (plr) if (!team && plr)
team = plr->GetBGTeam(); team = plr->GetTeam();
if (( bg->GetWinner()==0 && team == ALLIANCE ) || ( bg->GetWinner()==1 && team==HORDE ))
*data << uint8(1);
else else
{ *data << uint8(0);
QueryResult *result = CharacterDatabase.PQuery("SELECT team FROM character_battleground_data WHERE guid = '%u'", GUID_LOPART(itr->first));
if (result)
{
team = (*result)[0].GetUInt8();
delete result;
} }
else *data << (int32)itr->second->DamageDone; // damage done
sLog.outError("Player GUID %u - unable to find correct BG Team ID for MSG_PVP_LOG_DATA (scoreboard). Defaulting to 0.", GUID_LOPART(itr->first)); *data << (int32)itr->second->HealingDone; // healing done
}
}
else // if (!bg->isArena())
{
*data << uint32(itr->second->HonorableKills);
*data << uint32(itr->second->Deaths);
*data << uint32(itr->second->BonusHonor);
}
*data << uint32(itr->second->DamageDone); // damage done
*data << uint32(itr->second->HealingDone); // healing done
switch(bg->GetTypeID()) // battleground specific things switch(bg->GetTypeID()) // battleground specific things
{ {
case BATTLEGROUND_AV: case BATTLEGROUND_AV:
*data << uint32(0x00000005); // count of next fields *data << (uint32)0x00000005; // count of next fields
*data << uint32(((BattleGroundAVScore*)itr->second)->GraveyardsAssaulted); // GraveyardsAssaulted *data << (uint32)((BattleGroundAVScore*)itr->second)->GraveyardsAssaulted; // GraveyardsAssaulted
*data << uint32(((BattleGroundAVScore*)itr->second)->GraveyardsDefended); // GraveyardsDefended *data << (uint32)((BattleGroundAVScore*)itr->second)->GraveyardsDefended; // GraveyardsDefended
*data << uint32(((BattleGroundAVScore*)itr->second)->TowersAssaulted); // TowersAssaulted *data << (uint32)((BattleGroundAVScore*)itr->second)->TowersAssaulted; // TowersAssaulted
*data << uint32(((BattleGroundAVScore*)itr->second)->TowersDefended); // TowersDefended *data << (uint32)((BattleGroundAVScore*)itr->second)->TowersDefended; // TowersDefended
*data << uint32(((BattleGroundAVScore*)itr->second)->MinesCaptured); // MinesCaptured *data << (uint32)((BattleGroundAVScore*)itr->second)->MinesCaptured; // MinesCaptured
break; break;
case BATTLEGROUND_WS: case BATTLEGROUND_WS:
*data << uint32(0x00000002); // count of next fields *data << (uint32)0x00000002; // count of next fields
*data << uint32(((BattleGroundWGScore*)itr->second)->FlagCaptures); // flag captures *data << (uint32)((BattleGroundWGScore*)itr->second)->FlagCaptures; // flag captures
*data << uint32(((BattleGroundWGScore*)itr->second)->FlagReturns); // flag returns *data << (uint32)((BattleGroundWGScore*)itr->second)->FlagReturns; // flag returns
break; break;
case BATTLEGROUND_AB: case BATTLEGROUND_AB:
*data << uint32(0x00000002); // count of next fields *data << (uint32)0x00000002; // count of next fields
*data << uint32(((BattleGroundABScore*)itr->second)->BasesAssaulted); // bases asssulted *data << (uint32)((BattleGroundABScore*)itr->second)->BasesAssaulted; // bases asssulted
*data << uint32(((BattleGroundABScore*)itr->second)->BasesDefended); // bases defended *data << (uint32)((BattleGroundABScore*)itr->second)->BasesDefended; // bases defended
break; break;
case BATTLEGROUND_EY: case BATTLEGROUND_EY:
*data << uint32(0x00000001); // count of next fields *data << (uint32)0x00000001; // count of next fields
*data << uint32(((BattleGroundEYScore*)itr->second)->FlagCaptures); // flag captures *data << (uint32)((BattleGroundEYScore*)itr->second)->FlagCaptures; // flag captures
break; break;
case BATTLEGROUND_NA: case BATTLEGROUND_NA:
case BATTLEGROUND_BE: case BATTLEGROUND_BE:
@@ -1394,11 +1382,11 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg)
case BATTLEGROUND_RV: // wotlk case BATTLEGROUND_RV: // wotlk
case BATTLEGROUND_IC: // wotlk case BATTLEGROUND_IC: // wotlk
case BATTLEGROUND_ABG: // wotlk case BATTLEGROUND_ABG: // wotlk
*data << uint32(0); // 0 *data << (int32)0; // 0
break; break;
default: default:
sLog.outDebug("Unhandled MSG_PVP_LOG_DATA for BG id %u", bg->GetTypeID()); sLog.outDebug("Unhandled MSG_PVP_LOG_DATA for BG id %u", bg->GetTypeID());
*data << uint32(0); *data << (int32)0;
break; break;
} }
} }