Exemplo n.º 1
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            ShadowguardController controller = ShadowguardController.Instance;

            if (info.ButtonID == 123)
            {
                if (controller.RemoveFromQueue(User))
                {
                    User.SendLocalizedMessage(1156248); // You have been removed from all Shadowguard queues
                }
            }
            else if (info.ButtonID > 0)
            {
                int id = info.ButtonID - 1;
                if (id >= 0 && id < _Encounters.Length)
                {
                    EncounterType       type = _Encounters[id];
                    ShadowguardInstance inst = controller.GetAvailableInstance(type);

                    if (controller.CanTryEncounter(User, type))
                    {
                        if (inst == null)
                        {
                            controller.AddToQueue(User, type);
                        }
                        else
                        {
                            inst.TryBeginEncounter(User, false, type);
                            controller.RemoveFromQueue(User);
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (info.ButtonID > 0)
            {
                int id = info.ButtonID - 1;

                if (id >= 0 && id < _Encounters.Length)
                {
                    ShadowguardController controller = ShadowguardController.Instance;

                    EncounterType       type = _Encounters[id];
                    ShadowguardInstance inst = controller.GetAvailableInstance(type);

                    if (controller.CanTryEncounter(User, type))
                    {
                        if (inst == null)
                        {
                            controller.AddToQueue(User, type);
                        }
                        else
                        {
                            inst.TryBeginEncounter(User, false, type);
                            controller.RemoveFromQueue(User);
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
 public override void OnClick()
 {
     if (_Controller != null && _Controller.IsInQueue(_From))
     {
         if (_Controller.RemoveFromQueue(_From))
         {
             _From.SendLocalizedMessage(1156248); // You have been removed from all Shadowguard queues
         }
     }
 }