当前位置: 首页>>代码示例>>C#>>正文


C# Interfaces.Send方法代码示例

本文整理汇总了C#中Interfaces.Send方法的典型用法代码示例。如果您正苦于以下问题:C# Interfaces.Send方法的具体用法?C# Interfaces.Send怎么用?C# Interfaces.Send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Interfaces的用法示例。


在下文中一共展示了Interfaces.Send方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Add

 public bool Add(Interfaces.IConquerItem item)
 {
     try
     {
         if (item.Position > 19)
             return false;
         if (objects[item.Position - 1] == null)
         {
             UpdateItemview(item);
             objects[item.Position - 1] = item;
             item.Position = item.Position;
             item.Send(Owner);
             EntityEquipment equips = new EntityEquipment(true);
             equips.ParseHero(Owner);
             Owner.Send(equips);
             Owner.LoadItemStats(item);
             Owner.SendScreenSpawn(Owner.Entity, false);
             return true;
         }
         else return false;
     }
     catch (Exception e)
     {
         Program.SaveException(e);
         Console.WriteLine(e.ToString());
         return false;
     }
 }
开发者ID:AiiMz,项目名称:PserverWork,代码行数:28,代码来源:Equipment.cs

示例2: Add

        public bool Add(Interfaces.IConquerItem item)
        {
            if (objects[item.Position - 1] == null)
            {
                UpdateItemview(item);
                objects[item.Position - 1] = item;
                item.Position = item.Position;
                item.Send(Owner);

                Owner.SendScreenSpawn(Owner.Entity, false);

                return true;
            }
            else return false;
        }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:15,代码来源:Equipment.cs

示例3: AddSpell

 public bool AddSpell(Interfaces.ISkill spell)
 {
     if (Spells.ContainsKey(spell.ID))
     {
         if (Spells[spell.ID].Level < spell.Level)
         {
             Spells[spell.ID].Level = spell.Level;
             Spells[spell.ID].Experience = spell.Experience;
             if (spell.ID != 3060)
                 spell.Send(this);
         }
         return false;
     }
     else
     {
         if (spell.ID == 1045 || spell.ID == 1046)
         {
             if (Proficiencies.ContainsKey(Database.SpellTable.SpellInformations[spell.ID][spell.Level].WeaponSubtype))
             {
                 if (Proficiencies[Database.SpellTable.SpellInformations[spell.ID][spell.Level].WeaponSubtype].Level < 5)
                     return false;
             }
             else
                 return false;
         }
         Spells.Add(spell.ID, spell);
         if (spell.ID != 3060)
             spell.Send(this);
         return true;
     }
 }
开发者ID:AiiMz,项目名称:PserverWork,代码行数:31,代码来源:GameState.cs

示例4: AddProficiency

 public bool AddProficiency(Interfaces.ISkill proficiency)
 {
     if (Proficiencies.ContainsKey(proficiency.ID))
     {
         Proficiencies[proficiency.ID].Level = proficiency.Level;
         Proficiencies[proficiency.ID].Experience = proficiency.Experience;
         proficiency.Send(this);
         return false;
     }
     else
     {
         Proficiencies.Add(proficiency.ID, proficiency);
         proficiency.Send(this);
         return true;
     }
 }
开发者ID:AiiMz,项目名称:PserverWork,代码行数:16,代码来源:GameState.cs

示例5: ReviewItem

        public void ReviewItem(Interfaces.IConquerItem item)
        {
            Database.ConquerItemTable.DeleteItem(item.UID);
            if (item.Position != 0)
            {
                Network.GamePackets.ItemUsage iu = new Network.GamePackets.ItemUsage(true);
                iu.UID = item.UID;
                iu.dwParam = item.Position;
                iu.ID = Network.GamePackets.ItemUsage.UnequipItem;
                Owner.Send(iu);
            }
            Network.GamePackets.ItemUsage iud = new Network.GamePackets.ItemUsage(true);
            iud.UID = item.UID;
            iud.ID = Network.GamePackets.ItemUsage.RemoveInventory;
            Owner.Send(iud);

            Database.ConquerItemTable.AddItem(ref item, Owner);

            item.Send(Owner);
        }
开发者ID:AiiMz,项目名称:PserverWork,代码行数:20,代码来源:Inventory.cs

示例6: Remove

        public bool Remove(Interfaces.IConquerItem item, Enums.ItemUse use)
        {
            if (inventory.ContainsKey(item.UID))
            {
                if (!Network.PacketHandler.IsEquipment(item.ID))
                {
                    if (item.StackSize != 0)
                    {
                        item.StackSize--;
                        if (item.StackSize != 0)
                        {
                            Database.ConquerItemTable.UpdateStackItem(item, Owner);
                            item.Mode = Enums.ItemMode.Update;
                            item.Send(Owner);
                            item.Mode = Enums.ItemMode.Default;
                            return true;
                        }
                    }
                }
                switch (use)
                {
                    case Enums.ItemUse.Remove: Database.ConquerItemTable.RemoveItem(item.UID); break;
                    case Enums.ItemUse.Delete: Database.ConquerItemTable.DeleteItem(item.UID); break;
                    case Enums.ItemUse.Move: Database.ConquerItemTable.UpdateLocation(item, Owner); break;
                }

                inventory.Remove(item.UID);
                objects = inventory.Values.ToArray();
                Network.GamePackets.ItemUsage iu = new Network.GamePackets.ItemUsage(true);
                iu.UID = item.UID;
                iu.ID = Network.GamePackets.ItemUsage.RemoveInventory;
                Owner.Send(iu);
                return true;
            }
            return false;
        }
开发者ID:AiiMz,项目名称:PserverWork,代码行数:36,代码来源:Inventory.cs

示例7: Add

 public bool Add(Interfaces.IConquerItem item, Enums.ItemUse use)
 {
     if (!Database.ConquerItemInformation.BaseInformations.ContainsKey(item.ID))
         return true;
     if (Count == 40 && CanStack(item.ID) == null)
     {
         Owner.Send(ServerBase.Constants.FullInventory);
         return false;
     }
     if (!inventory.ContainsKey(item.UID))
     {
         item.Position = 0;
         if (!Network.PacketHandler.IsEquipment(item.ID))
         {
             if (item.StackSize != item.MaxStackSize)
             {
                 Interfaces.IConquerItem stacker = null;
                 if ((stacker = CanStack(item.ID)) != null)
                 {
                     bool Continue = false;
                     if (stacker.StackSize + item.StackSize > stacker.MaxStackSize)
                     {
                         Continue = true;
                         item.StackSize = (ushort)(stacker.StackSize + item.StackSize - stacker.MaxStackSize);
                         stacker.StackSize = stacker.MaxStackSize;
                     }
                     else
                         stacker.StackSize++;
                     Database.ConquerItemTable.UpdateStackItem(stacker, Owner);
                     stacker.Mode = Enums.ItemMode.Update;
                     stacker.Send(Owner);
                     stacker.Mode = Enums.ItemMode.Default;
                     if (!Continue)
                         return true;
                 }
             }
         }
         switch (use)
         {
             case Enums.ItemUse.CreateAndAdd:
                 item.UID = Conquer_Online_Server.Network.GamePackets.ConquerItem.ItemUID.Next;
                 Database.ConquerItemTable.AddItem(ref item, Owner);
                 item.MobDropped = false;
                 break;
             case Enums.ItemUse.Add:
                 Database.ConquerItemTable.UpdateLocation(item, Owner);
                 break;
             case Enums.ItemUse.Move:
                 item.Position = 0;
                 item.StatsLoaded = false;
                 Database.ConquerItemTable.UpdateLocation(item, Owner);
                 break;
         }
         inventory.Add(item.UID, item);
         objects = inventory.Values.ToArray();
         item.Mode = Enums.ItemMode.Default;
         if (use != Enums.ItemUse.None)
             item.Send(Owner);
         return true;
     }
     return false;
 }
开发者ID:AiiMz,项目名称:PserverWork,代码行数:62,代码来源:Inventory.cs

示例8: CheckItemExtra

        public static void CheckItemExtra(Interfaces.IConquerItem i, Client.GameState c)
        {
            if (i.RefineryTime.Ticks != 0)
            {
                if (DateTime.Now > i.RefineryTime)
                {
                    i.RefineItem = 0;
                    i.RefineryTime = new DateTime(0);

                    Game_ItemSoul expire = new Game_ItemSoul()
                    {
                        Identifier = i.UID
                    };
                    expire.Expired(c);
                    i.Send(c);
                    c.Send(PacketHandler.WindowStats(c));

                    Database.ConquerItemTable.UpdateRefineryItem(i);
                    Database.ConquerItemTable.UpdateRefineryTime(i);

                    if (!c.Equipment.Free(i.Position))
                    {
                        //c.UnloadItemStats(i, true);
                        c.LoadItemStats(c.Entity);
                    }
                }
            }
        }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:28,代码来源:ConquerItem.cs

示例9: Add

        public bool Add(Interfaces.IConquerItem item, Enums.ItemUse use)
        {
            try {
            if (!Database.ConquerItemInformation.BaseInformations.ContainsKey(item.ID))
                return true;
            if (Count == 40)
            {
                Owner.Send(ServerBase.Constants.FullInventory);
                return false;
            }
            if (!inventory.ContainsKey(item.UID))
            {
                item.Position = 0;
                Interfaces.IConquerItem _ExistingItem;
                Database.ConquerItemInformation iteminfo = new PhoenixProject.Database.ConquerItemInformation(item.ID, 0);
                if (Owner.Inventory.Contains(iteminfo.BaseInformation.ID, iteminfo.BaseInformation.StackSize, out _ExistingItem) && Owner.SpiltStack && use !=Enums.ItemUse.None)
                {

                    if (_ExistingItem.StackSize == 0)
                        _ExistingItem.StackSize = 1;
                    ushort _StackCount = iteminfo.BaseInformation.StackSize;
                    _StackCount -= (ushort)_ExistingItem.StackSize;

                    if (_StackCount >= 1)
                        _StackCount += 1;
                    _ExistingItem.StackSize += 1;

                    Database.ConquerItemTable.UpdateStack(_ExistingItem);
                    _ExistingItem.Mode = Game.Enums.ItemMode.Update;
                    _ExistingItem.Send(Owner);
                    _ExistingItem.Mode = Game.Enums.ItemMode.Default;
                    switch (use)
                    {

                        case Enums.ItemUse.Add:
                            Database.ConquerItemTable.DeleteItem(item.UID);
                            break;
                        case Enums.ItemUse.Move:
                            Database.ConquerItemTable.DeleteItem(item.UID);
                            break;
                    }
                    // Owner.SpiltStack = false;
                    return true;

                }
                else
                {
                    switch (use)
                    {
                        case Enums.ItemUse.CreateAndAdd:
                            item.UID = PhoenixProject.Client.AuthState.nextID;
                            PhoenixProject.Client.AuthState.nextID++;
                            Database.ConquerItemTable.AddItem(ref item, Owner);
                            item.MobDropped = false;
                            break;
                        case Enums.ItemUse.Add:
                            Database.ConquerItemTable.UpdateLocation(item, Owner);
                            break;
                        case Enums.ItemUse.Move:
                            item.Position = 0;
                            item.StatsLoaded = false;
                            Database.ConquerItemTable.UpdateLocation(item, Owner);
                            break;
                    }
                    inventory.Add(item.UID, item);
                    objects = inventory.Values.ToArray();
                    item.Mode = Enums.ItemMode.Default;
                    if (use != Enums.ItemUse.None)
                        item.Send(Owner);
                    return true;
                }
            }
            }
            catch (Exception e)
            {
            Program.SaveException(e);
            }
            return false;
        }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:79,代码来源:Inventory.cs

示例10: Inscribe

 public void Inscribe(ArsenalType Type, Interfaces.IConquerItem Item, Client.GameState client)
 {
     if (!Inscribed[Type].ContainsKey(Item.UID))
     {
         Item.Mode = Enums.ItemMode.Update;
         Item.Inscribed = true;
         Item.Send(client);
         Item.Mode = Enums.ItemMode.Default;
         ArsenalSingle Inscriber = new ArsenalSingle();
         Inscriber.D_UID = client.Entity.UID;
         Inscriber.Item = Item;
         Inscriber.Name = client.Entity.Name;
         Inscriber.UID = Item.UID;
         Inscriber.Type = Type;
         Inscriber.Donation = GetDonation(Item);
         Inscribed[Type].Add(Inscriber.UID, Inscriber);
         Database.ArsenalsTable.Inscribe(Type, Inscriber.Donation, Item, client.Entity);
         Donation[Type] += Inscriber.Donation;
     }
     else
     {
         client.Send(new Network.GamePackets.Message("This item is already inscribed!", System.Drawing.Color.Red, 2005));
         return;
     }
 }
开发者ID:AiiMz,项目名称:PserverWork,代码行数:25,代码来源:Arsenals.cs


注:本文中的Interfaces.Send方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。