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


C# ServerPackets类代码示例

本文整理汇总了C#中ServerPackets的典型用法代码示例。如果您正苦于以下问题:C# ServerPackets类的具体用法?C# ServerPackets怎么用?C# ServerPackets使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Load

        public void Load(S.ObjectGold info)
        {
            Name = string.Format("Gold ({0:###,###,###})", info.Gold);


            BodyLibrary = Libraries.FloorItems;

            CurrentLocation = info.Location;
            MapLocation = info.Location;
            GameScene.Scene.MapControl.AddObject(this);

            if (info.Gold < 100)
                DrawFrame = 112;
            else if (info.Gold < 200)
                DrawFrame = 113;
            else if (info.Gold < 500)
                DrawFrame = 114;
            else if (info.Gold < 1000)
                DrawFrame = 115;
            else
                DrawFrame = 116;

            Size = BodyLibrary.GetTrueSize(DrawFrame);

            DrawY = CurrentLocation.Y;
        }
开发者ID:thedeaths,项目名称:mir2,代码行数:26,代码来源:ItemObject.cs

示例2: Load

        public void Load(S.ObjectSpell info)
        {
            CurrentLocation = info.Location;
            MapLocation = info.Location;
            GameScene.Scene.MapControl.AddObject(this);
            Spell = info.Spell;

            switch (Spell)
            {
                case Spell.TrapHexagon:
                    BodyLibrary = Libraries.Magic;
                    DrawFrame = 1390;
                    FrameInterval = 100;
                    FrameCount = 10;
                    break;
                case Spell.FireWall:
                    BodyLibrary = Libraries.Magic;
                    DrawFrame = 1630;
                    FrameInterval = 120;
                    FrameCount = 6;
                    Light = 3;
                    break;
                case Spell.PoisonField:
                    BodyLibrary = Libraries.Magic2;
                    DrawFrame = 1650;
                    FrameInterval = 120;
                    FrameCount = 20;
                    Light = 3;
                    break;
            }

            NextMotion = CMain.Time + FrameInterval;
            NextMotion -= NextMotion % 100;
        }
开发者ID:xiaofengzhiyu,项目名称:CSharpMir,代码行数:34,代码来源:SpellObject.cs

示例3: Load

        public void Load(S.ObjectNPC info)
        {
            Name = info.Name;
            NameColour = info.NameColour;

            CurrentLocation = info.Location;
            Movement = info.Location;
            MapLocation = info.Location;
            GameScene.Scene.MapControl.AddObject(this);
            Direction = info.Direction;
            if (info.Image < Libraries.NPCs.Length)
                BodyLibrary = Libraries.NPCs[info.Image];

            switch (info.Image)
            {
                case 23:
                    Frames = FrameSet.NPCs[1];
                    break;
                default:
                    Frames = FrameSet.NPCs[0];
                    break;
            }

            Light = 10;

            SetAction();
        }
开发者ID:xiaofengzhiyu,项目名称:CSharpMir,代码行数:27,代码来源:NPCObject.cs

示例4: Load

        public void Load(S.ObjectDeco info)
        {
            CurrentLocation = info.Location;
            MapLocation = info.Location;
            GameScene.Scene.MapControl.AddObject(this);
            Image = info.Image;

            BodyLibrary = Libraries.Deco;
        }
开发者ID:Pete107,项目名称:Mir2,代码行数:9,代码来源:DecoObject.cs

示例5: Load

        public void Load(S.UserInformation info)
        {
            Id = info.RealId;
            Name = info.Name;
            Settings.LoadTrackedQuests(info.Name);
            NameColour = info.NameColour;
            GuildName = info.GuildName;
            GuildRankName = info.GuildRank;
            Class = info.Class;
            Gender = info.Gender;
            Level = info.Level;

            CurrentLocation = info.Location;
            MapLocation = info.Location;
            GameScene.Scene.MapControl.AddObject(this);

            Direction = info.Direction;
            Hair = info.Hair;

            HP = info.HP;
            MP = info.MP;

            Experience = info.Experience;
            MaxExperience = info.MaxExperience;

            LevelEffects = info.LevelEffects;

            Inventory = info.Inventory;
            Equipment = info.Equipment;
            QuestInventory = info.QuestInventory;

            Magics = info.Magics;
            for (int i = 0; i < Magics.Count; i++ )
            {
                if (Magics[i].CastTime > 0)
                    Magics[i].CastTime = CMain.Time - Magics[i].CastTime;
            }

            IntelligentCreatures = info.IntelligentCreatures;//IntelligentCreature
            SummonedCreatureType = info.SummonedCreatureType;//IntelligentCreature
            CreatureSummoned = info.CreatureSummoned;//IntelligentCreature

            BindAllItems();

            RefreshStats();

            SetAction();
        }
开发者ID:Pete107,项目名称:Mir2,代码行数:48,代码来源:UserObject.cs

示例6: Load

        public void Load(S.ObjectItem info)
        {
            Name = info.Name;
            NameColour = info.NameColour;

            BodyLibrary = Libraries.FloorItems;

            CurrentLocation = info.Location;
            MapLocation = info.Location;
            GameScene.Scene.MapControl.AddObject(this);
            DrawFrame = info.Image;

            Size = BodyLibrary.GetTrueSize(DrawFrame);

            DrawY = CurrentLocation.Y;
        }
开发者ID:ufaith,项目名称:cmirosg,代码行数:16,代码来源:ItemObject.cs

示例7: StartGame

        public void StartGame(S.StartGameBanned p)
        {
            StartGameButton.Enabled = true;

            TimeSpan d = p.ExpiryDate - CMain.Now;
            MirMessageBox.Show(string.Format("This account is banned.\n\nReason: {0}\nExpiryDate: {1}\nDuration: {2:#,##0} Hours, {3} Minutes, {4} Seconds", p.Reason,
                                             p.ExpiryDate, Math.Floor(d.TotalHours), d.Minutes, d.Seconds));
        }
开发者ID:thedeaths,项目名称:official-mir2c-,代码行数:8,代码来源:SelectScene.cs

示例8: DeleteCharacter

        private void DeleteCharacter(S.DeleteCharacterSuccess p)
        {
            DeleteCharacterButton.Enabled = true;
            MirMessageBox.Show("Your character was deleted successfully.");

            for (int i = 0; i < Characters.Count; i++)
                if (Characters[i].Index == p.CharacterIndex)
                {
                    Characters.RemoveAt(i);
                    break;
                }

            UpdateInterface();
        }
开发者ID:thedeaths,项目名称:official-mir2c-,代码行数:14,代码来源:SelectScene.cs

示例9: NewCharacter

 private void NewCharacter(S.NewCharacterSuccess p)
 {
     _character.Dispose();
     MirMessageBox.Show("Your character was created successfully.");
     
     Characters.Insert(0, p.CharInfo);
     _selected = 0;
     UpdateInterface();
 }
开发者ID:thedeaths,项目名称:official-mir2c-,代码行数:9,代码来源:SelectScene.cs

示例10: MountUpdate

        public void MountUpdate(S.MountUpdate info)
        {
            MountType = info.MountType;
            RidingMount = info.RidingMount;

            QueuedAction action = new QueuedAction { Action = MirAction.Standing, Direction = Direction, Location = CurrentLocation };
            ActionFeed.Insert(0, action);

            MountTime = CMain.Time;

            if (MountType < 0)
                GameScene.Scene.MountDialog.Hide();

            SetLibraries();
            SetEffects();

            PlayMountSound();
        }
开发者ID:nerestaren,项目名称:mir2,代码行数:18,代码来源:PlayerObject.cs

示例11: Update

        public void Update(S.PlayerUpdate info)
        {
            Weapon = info.Weapon;
            Armour = info.Armour;
            Light = info.Light;
            WingEffect = info.WingEffect;

            SetLibraries();
            SetEffects();
        }
开发者ID:nerestaren,项目名称:mir2,代码行数:10,代码来源:PlayerObject.cs

示例12: Load

        public void Load(S.ObjectPlayer info)
        {
            Name = info.Name;
            NameColour = info.NameColour;
            Class = info.Class;
            Gender = info.Gender;

            CurrentLocation = info.Location;
            MapLocation = info.Location;
            GameScene.Scene.MapControl.AddObject(this);

            Direction = info.Direction;
            Hair = info.Hair;

            Weapon = info.Weapon;
            Armour = info.Armour;
            Light = info.Light;

            Poison = info.Poison;

            Dead = info.Dead;
            Hidden = info.Hidden;

            WingEffect = info.WingEffect;

            SetLibraries();

            if (Dead) ActionFeed.Add(new QueuedAction { Action = MirAction.Dead, Direction = Direction, Location = CurrentLocation });
            if (info.Extra) Effects.Add(new Effect(Libraries.Magic2, 670, 10, 800, this));

            SetAction();
        }
开发者ID:WillMcKill,项目名称:MirRage,代码行数:32,代码来源:PlayerObject.cs

示例13: MailCost

        private void MailCost(S.MailCost p)
        {
            if(GameScene.Scene.MailComposeParcelDialog.Visible)
            {
                if (p.Cost > 0)
                    SoundManager.PlaySound(SoundList.Gold);

                GameScene.Scene.MailComposeParcelDialog.ParcelCostLabel.Text = p.Cost.ToString();
            }
        }
开发者ID:ElijahLOMCN,项目名称:mir2,代码行数:10,代码来源:GameScene.cs

示例14: ResizeInventory

 private void ResizeInventory(S.ResizeInventory p)
 {
     Array.Resize(ref User.Inventory, p.Size);
     InventoryDialog.RefreshInventory2();
 }
开发者ID:ElijahLOMCN,项目名称:mir2,代码行数:5,代码来源:GameScene.cs

示例15: ParcelCollected

 private void ParcelCollected(S.ParcelCollected p)
 {
     switch(p.Result)
     {
         case -1:
             MirMessageBox messageBox = new MirMessageBox(string.Format("No parcels to collect."), MirMessageBoxButtons.OK);
             messageBox.Show();
             break;
         case 0:
             messageBox = new MirMessageBox(string.Format("All parcels have been collected."), MirMessageBoxButtons.OK);
             messageBox.Show();
             break;
         case 1:
             GameScene.Scene.MailReadParcelDialog.Hide();
             break;
     }
 }
开发者ID:ElijahLOMCN,项目名称:mir2,代码行数:17,代码来源:GameScene.cs


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