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


C# Update.Append方法代码示例

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


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

示例1: Reset

        public static void Reset()
        {
            Scores = new SafeDictionary<uint, Guild>(100);

            LeftGate.Mesh = (ushort)(240 + LeftGate.Mesh % 10);
            RightGate.Mesh = (ushort)(270 + LeftGate.Mesh % 10);

            LeftGate.Hitpoints = LeftGate.MaxHitpoints;
            RightGate.Hitpoints = RightGate.MaxHitpoints;
            Pole.Hitpoints = Pole.MaxHitpoints;

            Update upd = new Update(true);
            upd.UID = LeftGate.UID;
            upd.Append(Update.Mesh, LeftGate.Mesh);
            upd.Append(Update.Hitpoints, LeftGate.Hitpoints);
            ServerBase.Kernel.SendWorldMessage(upd, ServerBase.Kernel.GamePool.Values, (ushort)1038);
            upd.Clear();
            upd.UID = RightGate.UID;
            upd.Append(Update.Mesh, RightGate.Mesh);
            upd.Append(Update.Hitpoints, RightGate.Hitpoints);
            ServerBase.Kernel.SendWorldMessage(upd, ServerBase.Kernel.GamePool.Values, (ushort)1038);

            foreach (Guild guild in ServerBase.Kernel.Guilds.Values)
            {
                guild.WarScore = 0;
            }

            IsWar = true;
        }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:29,代码来源:GuildWar.cs

示例2: Start

 public static void Start()
 {
     Scores = new SafeDictionary<uint, Guild>(100);
     StartTime = DateTime.Now;
     LeftGate.Mesh = (ushort)(240 + LeftGate.Mesh % 10);
     RightGate.Mesh = (ushort)(270 + LeftGate.Mesh % 10);
     ServerBase.Kernel.SendWorldMessage(new Message("Guild war has began!", System.Drawing.Color.Red, Message.Center), ServerBase.Kernel.GamePool.Values);
     FirstRound = true;
     foreach (Guild guild in ServerBase.Kernel.Guilds.Values)
     {
         guild.WarScore = 0;
     }
     Update upd = new Update(true);
     upd.UID = LeftGate.UID;
     upd.Append(Update.Mesh, LeftGate.Mesh);
     upd.Append(Update.Hitpoints, LeftGate.Hitpoints);
     ServerBase.Kernel.SendWorldMessage(upd, ServerBase.Kernel.GamePool.Values, (ushort)1038);
     upd.Clear();
     upd.UID = RightGate.UID;
     upd.Append(Update.Mesh, RightGate.Mesh);
     upd.Append(Update.Hitpoints, RightGate.Hitpoints);
     ServerBase.Kernel.SendWorldMessage(upd, ServerBase.Kernel.GamePool.Values, (ushort)1038);
     IsWar = true;
 }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:24,代码来源:GuildWar.cs

示例3: Update

 public void Update(byte type, ulong value, bool screen)
 {
     if (!SendUpdates)
         return;
     update = new Update(true);
     update.UID = UID;
     update.Append(type, value);
     if (EntityFlag == EntityFlag.Player)
     {
         if (!screen)
             update.Send(Owner as Client.GameState);
         else
             (Owner as Client.GameState).SendScreen(update, true);
     }
     else
     {
         MonsterInfo.SendScreen(update);
     }
 }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:19,代码来源:Entity.cs

示例4: GetDialog


//.........这里部分代码省略.........
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion

                            #region Gates
                            case 516074:
                                {
                                    if (client.Guild != null)
                                    {
                                        if (client.Guild.PoleKeeper)
                                        {
                                            switch (npcRequest.OptionID)
                                            {
                                                case 0:
                                                    dialog.Text("Select the option you want to pursue.");
                                                    if (client.AsMember.Rank == PhoenixProject.Game.Enums.GuildMemberRank.GuildLeader || client.AsMember.Rank == PhoenixProject.Game.Enums.GuildMemberRank.DeputyLeader)
                                                    {
                                                        dialog.Option("Open gate.", 1);
                                                        dialog.Option("Close gate.", 2);
                                                    }
                                                    dialog.Option("Get inside.", 3);
                                                    dialog.Option("Nothing.", 255);
                                                    dialog.Send();
                                                    break;
                                                case 1:
                                                    {
                                                        PhoenixProject.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh = (ushort)(250 + PhoenixProject.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh % 10);

                                                        Update upd = new Update(true);
                                                        upd.UID = PhoenixProject.Game.ConquerStructures.Society.GuildWar.LeftGate.UID;
                                                        upd.Append(Update.Mesh, PhoenixProject.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh);
                                                        client.SendScreen(upd, true);
                                                        break;
                                                    }
                                                case 2:
                                                    {
                                                        PhoenixProject.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh = (ushort)(240 + PhoenixProject.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh % 10);

                                                        Update upd = new Update(true);
                                                        upd.UID = PhoenixProject.Game.ConquerStructures.Society.GuildWar.LeftGate.UID;
                                                        upd.Append(Update.Mesh, PhoenixProject.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh);
                                                        client.SendScreen(upd, true);
                                                        break;
                                                    }
                                                case 3:
                                                    {
                                                        client.Entity.Teleport(1038, 162, 198);
                                                        break;
                                                    }
                                            }
                                        }
                                    }
                                    break;
                                }
                            case 516075:
                                {
                                    if (client.Guild != null)
                                    {
                                        if (client.Guild.PoleKeeper)
                                        {
                                            switch (npcRequest.OptionID)
                                            {
                                                case 0:
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:67,代码来源:NPCS.cs

示例5: Die

        public void Die(Game.Entity killer)
        {
            if (MapID == 1038)
            {
                if (UID != 810)
                {
                    if (Hitpoints != 0 || Mesh != 251 && Mesh != 281)
                    {
                        if (Mesh == 241)
                            Mesh = (ushort)(250 + Mesh % 10);
                        else
                            Mesh = (ushort)(280 + Mesh % 10);

                        Update upd = new Update(true);
                        upd.UID = UID;
                        upd.Append(Update.Mesh, Mesh);
                        killer.Owner.SendScreen(upd, true);
                        Hitpoints = 0;
                    }
                    Attack attack = new Attack(true);
                    attack.Attacker = killer.UID;
                    attack.Attacked = UID;
                    attack.AttackType = Network.GamePackets.Attack.Kill;
                    attack.X = X;
                    attack.Y = Y;
                    killer.Owner.Send(attack);
                    killer.KOCount++;
                }
            }
            else
            {
                Attack attack = new Attack(true);
                attack.Attacker = killer.UID;
                attack.Attacked = UID;
                attack.AttackType = Network.GamePackets.Attack.Kill;
                attack.X = X;
                attack.Y = Y;
                killer.Owner.Send(attack);
                Hitpoints = MaxHitpoints;
                Update upd = new Update(true);
                upd.UID = UID;
                upd.Append(Update.Hitpoints, MaxHitpoints);
                killer.Owner.SendScreen(upd, true);
            }
        }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:45,代码来源:SobNpcSpawn.cs

示例6: Reload


//.........这里部分代码省略.........
                        for (int extray = -16; extray < 16; extray++)
                        {
                            var tile = Map.Floor.GetLocation(X + extrax, Y + extray);
                            if (tile != null)
                            {
                                if (tile.Item != null)
                                {
                                    short dist = ServerBase.Kernel.GetDistance(Owner.Entity.PX, Owner.Entity.PY, (ushort)(X + extrax), (ushort)(Y + extray));

                                    if (dist >= 16)
                                    {
                                        var item = tile.Item;
                                        if (Time32.Now > item.OnFloor.AddSeconds(ServerBase.Constants.FloorItemSeconds) || item.PickedUpAlready)
                                        {
                                            item.Type = Network.GamePackets.FloorItem.Remove;
                                            for (int c = 0; c < Owner.Screen.Objects.Count; c++)
                                            {
                                                //For a multi threaded application, while we go through the collection
                                                //the collection might change. We will make sure that we wont go off
                                                //the limits with a check.
                                                if (c >= Owner.Screen.Objects.Count)
                                                    break;
                                                Interfaces.IMapObject _obj = Owner.Screen.Objects[c];
                                                if (_obj == null)
                                                    continue;
                                                if (_obj.MapObjType == MapObjectType.Player)
                                                {
                                                    (_obj as Entity).Owner.Send(item.ToArray());
                                                }
                                            }
                                            Map.Floor[item.X, item.Y, MapObjectType.Item, null] = true;
                                        }
                                        else
                                            item.SendSpawn(Owner, false);
                                    }
                                }
                                if (tile.Npc != null)
                                {
                                    short dist = ServerBase.Kernel.GetDistance(Owner.Entity.PX, Owner.Entity.PY, (ushort)(X + extrax), (ushort)(Y + extray));

                                    if (dist >= 16)
                                    {
                                        tile.Npc.SendSpawn(Owner);
                                    }
                                }
                            }
                        }
                    }
                    try
                    {
                        for (int x = 0; x < Map.Entities.Count; x++)
                        {
                            if (x >= Map.Entities.Count)
                                break;
                            if (Map.Entities[x] != null)
                            {
                                Game.Entity monster = Map.Entities[x];
                                if (Kernel.GetDistance(monster.X, monster.Y, Owner.Entity.X, Owner.Entity.Y) <= Constants.nScreenDistance && !Contains(monster.UID))
                                {
                                    if (!monster.Dead)
                                    {
                                        monster.SendSpawn(Owner);
                                        if (monster.MaxHitpoints > 65535)
                                        {
                                            Update upd = new Update(true) { UID = monster.UID };
                                            upd.Append(Update.Hitpoints, monster.Hitpoints);
                                            Owner.Send(upd);
                                        }
                                    }
                                }
                            }
                        }

                    }
                    catch { }
                    try
                    {
                        for (int x = 0; x < Map.Companions.Count; x++)
                        {
                            if (x >= Map.Companions.Count)
                                break;
                            if (Map.Companions[x] != null)
                            {
                                Game.Entity monster = Map.Companions[x];
                                if (monster == null) continue;
                                if (Kernel.GetDistance(monster.X, monster.Y, Owner.Entity.X, Owner.Entity.Y) <= Constants.nScreenDistance && !Contains(monster.UID))
                                {
                                    if (!monster.Dead)
                                    {
                                        monster.SendSpawn(Owner);
                                    }
                                }
                            }
                        }
                    }
                    catch { }
                }
            }
            catch (Exception e) { Program.SaveException(e); }
        }
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:101,代码来源:Screen.cs

示例7: Execute


//.........这里部分代码省略.........
                                                                attacked.Owner.SendScreen(suse, true);
                                                            else
                                                                attacked.MonsterInfo.SendScreen(suse);
                                                        }
                                                    }
                                                }
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region ExtraXP
                                    case 1040:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                if (attacker.Owner.Team != null)
                                                {
                                                    PrepareSpell(spell, attacker.Owner);
                                                    foreach (Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                    {
                                                        if (teammate.Entity.UID != attacker.UID)
                                                        {
                                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, teammate.Entity.X, teammate.Entity.Y) <= spell.Distance)
                                                            {
                                                                teammate.XPCount += 20;
                                                                Update update = new Update(true);
                                                                update.UID = teammate.Entity.UID;
                                                                update.Append(Update.XPCircle, teammate.XPCount);
                                                                update.Send(teammate);
                                                                suse.Targets.Add(teammate.Entity.UID, 20);

                                                                if (spell.NextSpellID != 0)
                                                                {
                                                                    attack.Damage = spell.NextSpellID;
                                                                    attacker.AttackPacket = attack;
                                                                }
                                                                else
                                                                {
                                                                    attacker.AttackPacket = null;
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                if (attacked.EntityFlag == EntityFlag.Player)
                                                    attacked.Owner.SendScreen(suse, true);
                                                else
                                                    attacked.MonsterInfo.SendScreen(suse);
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region WeaponSpells
                                    #region Circle
                                    case 5010:
                                    case 7020:

                                        //case 11110:
                                        //case 10490:
                                        {
开发者ID:Mromany,项目名称:Conquista5679-TheHunterSource-,代码行数:67,代码来源:Handle.cs


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