Skip to content

Instantly share code, notes, and snippets.

@walkline
Created December 24, 2011 08:35
Show Gist options
  • Save walkline/1516814 to your computer and use it in GitHub Desktop.
Save walkline/1516814 to your computer and use it in GitHub Desktop.
diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
index 0d76759..012cd1d 100755
--- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
@@ -166,6 +166,17 @@ GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, Battlegr
sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, Team->GetName().c_str(), ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating);
}
+ //arena 3x3 & 5x5 announce
+ if (isRated && ginfo->ArenaType > 2 && leader)
+ {
+ ArenaTeam* Team = sArenaTeamMgr->GetArenaTeamById(arenateamid);
+ if (Team && (getMSTime() - leader->getLastQueue()) >= 60*1000)
+ {
+ sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, Team->GetName().c_str(), ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating);
+ leader->setLastQueue(getMSTime());
+ }
+ }
+
//add players from group to ginfo
{
//ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_Lock);
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 9d736bb..d7bbd2c 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -856,6 +856,8 @@ Player::Player (WorldSession* session): Unit(), m_achievementMgr(this), m_reputa
spectateCanceled = false;
spectateFrom = NULL;
+ lastQueue = 0;
+
SetPendingBind(0, 0);
}
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index e5bd4a9..9ba4c57 100755
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1162,6 +1162,8 @@ class Player : public Unit, public GridObject<Player>
Unit* getSpectateFrom() { return spectateFrom; }
bool isSpectator() const { return spectatorFlag; }
void SetSpectate(bool on);
+ uint32 getLastQueue() { return lastQueue; }
+ void setLastQueue(uint32 value) { lastQueue = value; }
bool Has310Flyer(bool checkAllSpells, uint32 excludeSpellId = 0);
void SetHas310Flyer(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_HAS_310_FLYER; else m_ExtraFlags &= ~PLAYER_EXTRA_HAS_310_FLYER; }
void SetPvPDeath(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_PVP_DEATH; else m_ExtraFlags &= ~PLAYER_EXTRA_PVP_DEATH; }
@@ -2864,6 +2866,9 @@ class Player : public Unit, public GridObject<Player>
bool spectatorFlag;
bool spectateCanceled;
Unit *spectateFrom;
+
+ //announce antiflood
+ uint32 lastQueue;
};
void AddItemsSetItem(Player*player, Item* item);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment