Beispiel #1
0
        public void OnTick()
        {
            if (CurrentDuel != null)
            {
                CurrentDuel.OnTick();
            }

            foreach (KeyValuePair <ArenaDuel, DateTime> kvp in PendingDuels)
            {
                if (kvp.Value < DateTime.UtcNow)
                {
                    _Remove.Add(kvp.Key);
                }
            }

            if (_Remove.Count > 0)
            {
                foreach (ArenaDuel duel in _Remove)
                {
                    if (PendingDuels.ContainsKey(duel))
                    {
                        PendingDuels.Remove(duel);
                    }
                }

                _Remove.Clear();
            }
        }
Beispiel #2
0
        public void OnTick()
        {
            CurrentDuel?.OnTick();

            foreach (KeyValuePair <ArenaDuel, DateTime> kvp in PendingDuels)
            {
                if (kvp.Value < DateTime.UtcNow)
                {
                    _Remove.Add(kvp.Key);
                }
            }

            if (_Remove.Count > 0)
            {
                for (var index = 0; index < _Remove.Count; index++)
                {
                    ArenaDuel duel = _Remove[index];

                    if (PendingDuels.ContainsKey(duel))
                    {
                        PendingDuels.Remove(duel);
                    }
                }

                _Remove.Clear();
            }
        }
Beispiel #3
0
        public void RemovePendingDuel(ArenaDuel duel, bool cancel = false)
        {
            if (PendingDuels.ContainsKey(duel))
            {
                PendingDuels.Remove(duel);

                if (cancel)
                {
                    PVPArenaSystem.SendParticipantMessage(duel, 1115947); // The session owner has canceled the duel.
                }
            }
        }
Beispiel #4
0
        public void TryBeginDuel(ArenaDuel duel)
        {
            if (PendingDuels.ContainsKey(duel))
            {
                PendingDuels.Remove(duel);
            }

            if (CurrentDuel == null && BookedDuels.Count == 0)
            {
                CurrentDuel = duel;
                duel.DoPreDuel();
            }
            else
            {
                BookedDuels.Add(duel);
                PVPArenaSystem.SendParticipantMessage(duel, 1115960); // There are currently no open arenas. Your duel session has been added to the booking queue.
            }
        }