Exemple #1
0
        /// <summary>
        /// Called everytime a exchange invitation is detected.
        /// </summary>
        public void OnExchangeRequest(uint uniqueID)
        {
            Window w = Window.Get;

            if (w.Character_cbxRefuseExchange.Checked)
            {
                PacketBuilder.PlayerPetitionResponse(false, SRTypes.PlayerPetition.ExchangeRequest);
            }
            else if (w.Character_cbxAcceptExchange.Checked)
            {
                SREntity entity = InfoManager.GetEntity(uniqueID);
                if (w.Character_cbxAcceptExchangeLeaderOnly.Checked)
                {
                    bool found = false;
                    w.Party_lstvLeaderList.InvokeIfRequired(() => {
                        found = w.Party_lstvLeaderList.Items.ContainsKey(entity.Name.ToUpper());
                    });
                    if (found)
                    {
                        PacketBuilder.PlayerPetitionResponse(true, SRTypes.PlayerPetition.ExchangeRequest);
                    }
                }
                else
                {
                    PacketBuilder.PlayerPetitionResponse(true, SRTypes.PlayerPetition.ExchangeRequest);
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Called when a player is giving you resurrection request
        /// </summary>
        public void OnResurrection(uint UniqueID)
        {
            Window w = Window.Get;

            if (w.Character_cbxAcceptRess.Checked)
            {
                if (!w.Character_cbxAcceptRessPartyOnly.Checked)
                {
                    PacketBuilder.PlayerPetitionResponse(true, SRTypes.PlayerPetition.Resurrection);
                }
                else
                {
                    SREntity player = InfoManager.GetEntity(UniqueID);
                    if (player != null)
                    {
                        if (InfoManager.Party.Members.Find(p => p.Name == player.Name) != null)
                        {
                            PacketBuilder.PlayerPetitionResponse(true, SRTypes.PlayerPetition.Resurrection);
                        }
                    }
                }
            }
        }
Exemple #3
0
 /// <summary>
 /// Called when a near entity spawn.
 /// </summary>
 public void OnSpawn(SREntity entity)
 {
 }