// TODO: Do *not* use too many ReaderWriterLock! They need huge amount of memories and go deep into the kern //private ReaderWriterLockSlim m_syncLock; public BattleRange(BattlegroundQueue bgqueue, uint battlegroupId) { // TODO: Fix //m_minLevel = bgqueue.Template.MinLevel + ((bgqueue.Template.LevelRange + 1) * battlegroupId); //if (m_minLevel > bgqueue.Template.MaxLevel) // m_minLevel = bgqueue.Template.MaxLevel; //m_maxLevel = bgqueue.Template.MinLevel + ((bgqueue.Template.LevelRange + 1) * battlegroupId) + bgqueue.Template.LevelRange; //if (m_maxLevel > bgqueue.Template.MaxLevel) // m_maxLevel = bgqueue.Template.MaxLevel; //m_size = 0; //m_ids = new IdQueue(); //m_battlegrounds = new Dictionary<uint, Battleground>(); //m_bgqueue = bgqueue; //m_battlegroupId = battlegroupId; //m_syncLock = new ReaderWriterLockSlim(); }
public static void SendStatusEnqueued(Character chr, int index, BattlegroundRelation relation, BattlegroundQueue queue) { var status = BattlegroundStatus.Enqueued; using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_BATTLEFIELD_STATUS)) { packet.Write(index); var bgId = queue.Template.Id; // 64-bit guid start packet.Write((byte)ArenaType.None); packet.Write((byte)1); // affects level range calculation? packet.Write((uint)bgId); packet.Write((ushort)8080); // 64-bit guid stop packet.Write((byte)0); // since 3.3 packet.Write((byte)0); // since 3.3 packet.Write(queue.InstanceId); // instance id packet.Write(false); // bool isRatedMatch packet.Write((int)status); packet.Write(queue.AverageWaitTime); // avg wait time for queue, in ms packet.Write((int)relation.QueueTime.TotalMilliseconds); // time in the queue, also in ms chr.Send(packet); } }
protected BattlegroundTeamQueue(BattlegroundQueue parentQueue, BattlegroundSide side) { _parentQueue = parentQueue; m_Side = side; }
protected BattlegroundTeamQueue(BattlegroundQueue parentQueue, BattlegroundSide side) { _parentQueue = parentQueue; m_Side = side; }