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


C# Packet.WriteUInt方法代码示例

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


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

示例1: SendAttackDamage

        public static void SendAttackDamage(MapObject from, ushort objectID, ushort damage, bool crit, uint hpleft, ushort counter)
        {
            using (var packet = new Packet(SH9Type.AttackDamage))
            {
                packet.WriteUShort(from.MapObjectID);
                packet.WriteUShort(objectID);
                packet.WriteBool(crit);
                packet.WriteUShort(damage);
                packet.WriteUInt(hpleft);
                packet.WriteUShort(counter);
                packet.WriteByte(4);
                packet.WriteByte(100);

                from.MapSector.Broadcast(packet);
            }
        }
开发者ID:,项目名称:,代码行数:16,代码来源:

示例2: UpdateCharacterHpSp

        public void UpdateCharacterHpSp(ZoneCharacter pChar)
        {
            using (Packet packet = new Packet(SH14Type.UpdatePartyMemberStats))
            {
                packet.WriteByte(0x01);             // UNK
                packet.WriteString(pChar.Name, 16);
                packet.WriteUInt(pChar.HP);
                packet.WriteUInt(pChar.SP);

                AnnouncePacketToUpdatable(packet);
            }
            using(Packet packet = new Packet(SH14Type.SetMemberStats))
            {
                packet.WriteByte(1);				// UNK
                packet.WriteString(pChar.Name, 16);
                packet.WriteByte((byte) pChar.Job);
                packet.WriteByte(pChar.Level);
                packet.WriteUInt(pChar.MaxHP);
                packet.WriteUInt(pChar.MaxSP);
                packet.WriteByte(0x00);				// UNK
            }
        }
开发者ID:,项目名称:,代码行数:22,代码来源:

示例3: SendSkillPosition

 public static void SendSkillPosition(MapObject user, ushort animid, ushort skillid, uint x, uint y)
 {
     // 9 81 | [32 29] [B8 10] [56 0A 00 00] [3A 27 00 00] [75 70]
     using (var packet = new Packet(SH9Type.SkillAnimationPosition))
     {
         packet.WriteUShort(user.MapObjectID);
         packet.WriteUShort(skillid);
         packet.WriteUInt(x);
         packet.WriteUInt(y);
         packet.WriteUShort(animid);
         user.MapSector.Broadcast(packet);
     }
 }
开发者ID:,项目名称:,代码行数:13,代码来源:

示例4: SendUpdateSP

 public static void SendUpdateSP(ZoneCharacter character)
 {
     using (var p = new Packet(SH9Type.HealSP))
     {
         p.WriteUInt(character.SP);
         p.WriteUShort(character.UpdateCounter);
         character.Client.SendPacket(p);
     }
 }
开发者ID:,项目名称:,代码行数:9,代码来源:

示例5: WriteUpdateStats

 public void WriteUpdateStats(Packet packet)
 {
     packet.WriteUInt(HP);
     packet.WriteUInt(MaxHP); // Max HP
     packet.WriteUInt(SP);
     packet.WriteUInt(MaxSP); // Max SP
     packet.WriteByte(Level);
     packet.WriteUShort(this.UpdateCounter);
 }
开发者ID:,项目名称:,代码行数:9,代码来源:

示例6: SendSkill

 public static void SendSkill(MapObject user, ushort animid, List<SkillVictim> victims)
 {
     using (var packet = new Packet(SH9Type.SkillAnimationTarget))
     {
         packet.WriteUShort(animid);
         packet.WriteUShort(user.MapObjectID);
         packet.WriteByte((byte)(victims.Count > 255 ? 255 : victims.Count));
         for (byte i = 0; i < victims.Count && i != 255; i++)
         {
             var victim = victims[i];
             packet.WriteUShort(victim.MapObjectID);
             packet.WriteByte(victim.Stance1);
             packet.WriteByte(victim.Stance2);
             packet.WriteUInt(victim.Damage);
             packet.WriteUInt(victim.HPLeft);
             packet.WriteUShort(victim.HPCounter);
         }
         user.MapSector.Broadcast(packet);
     }
 }
开发者ID:,项目名称:,代码行数:20,代码来源:

示例7: SendPremiumItemList

 public static void SendPremiumItemList(ZoneCharacter character)
 {
     using (var packet = new Packet(SH4Type.CharacterItemList))
     {
         ushort count = 0;
         packet.WriteUShort(count);   // Count
         for (ushort i = 0; i < count; i++)
         {
             packet.WriteUShort(0x0010);    // Inventory
             packet.WriteUShort(0x0000);    // Slot
             packet.WriteUShort(0x033B);    // Item Handle      // (Iron Case, to add 4 extra inventories :P)
             packet.WriteUInt(1992027391);  // Activation Time (1992027391 - Permanent)
             packet.WriteUInt(1992027391);  // Expiring Time (1992027391 - Permanent)
         }
         character.Client.SendPacket(packet);
     }
 }
开发者ID:,项目名称:,代码行数:17,代码来源:

示例8: WriteDetailedInfoExtra

        public void WriteDetailedInfoExtra(Packet packet, bool levelUP = false)
        {
            if (!levelUP)
            {
                packet.WriteUShort(this.MapObjectID);
            }

            packet.WriteLong(this.Exp);
            packet.WriteULong(DataProvider.Instance.GetMaxExpForLevel(this.Level));

            packet.WriteInt(BaseStats.Strength);
            packet.WriteInt(BaseStats.Strength + GetExtraStr());
            packet.WriteInt(BaseStats.Endurance);
            packet.WriteInt(BaseStats.Endurance + GetExtraEnd());
            packet.WriteInt(BaseStats.Dexterity);
            packet.WriteInt(BaseStats.Dexterity + GetExtraDex());
            packet.WriteInt(BaseStats.Intelligence);
            packet.WriteInt(BaseStats.Intelligence + GetExtraInt());
            packet.WriteInt(0); // Wizdom. It isn't set in the server so it can contain shit from old buffers... :D
            packet.WriteInt(0); // I once had a name here :P
            packet.WriteInt(BaseStats.Spirit);
            packet.WriteInt(BaseStats.Spirit + GetExtraSpr());

            packet.WriteInt(GetWeaponDamage()); //base damage
            packet.WriteInt(GetWeaponDamage(true)); //increased damage (e.g. buffs)
            packet.WriteInt(GetMagicDamage()); //magic dmg
            packet.WriteInt(GetMagicDamage(true)); //inc magic dmg

            packet.WriteInt(GetWeaponDefense()); //todo equip stats loading (weapondef)
            packet.WriteInt(GetWeaponDefense(true)); //weapondef inc

            packet.WriteInt(GetAim()); //TODO: basestats aim + dex?
            packet.WriteInt(GetAim(true)); //aim inc (calcuate later based on dex)

            packet.WriteInt(GetEvasion()); //evasion
            packet.WriteInt(GetEvasion(true)); //evasion inc

            packet.WriteInt(GetWeaponDamage()); //damage block again
            packet.WriteInt(GetWeaponDamage(true));

            packet.WriteInt(GetMagicDamage()); //magic damage
            packet.WriteInt(GetMagicDamage(true));

            packet.WriteInt(GetMagicDefense()); //magic def
            packet.WriteInt(GetMagicDefense(true)); //magic def inc

            packet.WriteInt(1);
            packet.WriteInt(20);
            packet.WriteInt(2);
            packet.WriteInt(40);

            packet.WriteUInt(BaseStats.MaxHP); //max HP
            packet.WriteUInt(BaseStats.MaxSP); //max SP

            packet.WriteInt(0);                   // UNK
            packet.WriteInt(BaseStats.MaxSoulHP);   // Max HP Stones
            packet.WriteInt(BaseStats.MaxSoulSP);   // Max SP Stones
            packet.Fill(64, 0);
            if (!levelUP)
            {
                packet.WriteInt(this.Position.X);
                packet.WriteInt(this.Position.Y);
            }
        }
开发者ID:,项目名称:,代码行数:64,代码来源:

示例9: SendHouseList

 public static void SendHouseList(ZoneCharacter character)
 {
     //TODO: house loading
     using (var packet = new Packet(SH4Type.CharacterItemList))
     {
         byte count = 0;
         packet.WriteByte(count);   // Count
         packet.WriteByte(0x0C);    // Inventory
         packet.WriteByte(0x35);    // UNK    (In newest client it exists, in bit older, not)
         for (byte i = 0; i < count; i++)
         {
             packet.WriteByte(8);           // Item Data Length
             packet.WriteByte(i);           // Slot
             packet.WriteByte(0x30);        // UNK
             packet.WriteUShort((ushort)(31000 + i * 3));  // Item ID
             packet.WriteUInt(1992027391);  // Expiring Time (1992027391 - Permanent)
         }
         character.Client.SendPacket(packet);
     }
 }
开发者ID:,项目名称:,代码行数:20,代码来源:

示例10: SendPremiumEmotions

 public static void SendPremiumEmotions(ZoneCharacter character)
 {
     using (var packet = new Packet(SH4Type.CharacterItemList))
     {
         byte count = 0;
         packet.WriteByte(count);   // Count
         packet.WriteByte(0x0F);    // Inventory
         packet.WriteByte(0xCB);    // UNK    (In newest client it exists, in bit older, not)
         for (byte i = 0; i < count; i++)
         {
             packet.WriteByte(8);           // Item Data Length
             packet.WriteByte(i);           // Slot
             packet.WriteByte(0x3C);        // Inventory thing
             packet.WriteUShort((ushort)(31500 + (16 < i ? 1 : 0) + i * 2));  // Item ID
             packet.WriteUInt(1992027391);  // Expiring Time (1992027391 - Permanent)
         }
         character.Client.SendPacket(packet);
     }
 }
开发者ID:,项目名称:,代码行数:19,代码来源:

示例11: WriteStats

        public void WriteStats(Packet Packet)
        {
            Packet.WriteUShort(ItemInfo.ItemID);

            switch (ItemInfo.Class)
            {
                case ItemClass.Mount:
                    Packet.WriteUShort(100); // food ?
                    Packet.WriteUInt(0); // use time?
                    Packet.WriteUInt(1992027391); // expire time?
                    Packet.WriteUShort(0); // unk ?
                    break;
                case ItemClass.QuestItem:
                    Packet.WriteByte(0); // unk ?
                    break;
                case ItemClass.PremiumItem:
                    Packet.WriteUInt(0); // use time
                    Packet.WriteUInt(1992027391); // expire time
                    break;

                case ItemClass.CollectCard:
                    Packet.WriteUInt(1000); // serial
                    Packet.WriteByte(5); // stars
                    break;
            }
        }
开发者ID:,项目名称:,代码行数:26,代码来源:

示例12: WriteEquipStats

        public void WriteEquipStats(Packet Packet)
        {
            var length = GetEquipLength(this);
            var statCount = GetInfoStatCount(this);

            length += (byte)(statCount * 3);

            Packet.WriteUShort(ItemInfo.ItemID);

            switch (ItemInfo.Slot)
            {
                case ItemSlot.Weapon:
                case ItemSlot.Weapon2:
                case ItemSlot.Armor:
                case ItemSlot.Pants:
                case ItemSlot.Boots:
                case ItemSlot.Helm:
                case ItemSlot.Pet:
                    Packet.WriteByte(0);//upgrades
                    Packet.WriteByte(0); // unk
                    Packet.WriteUInt(0); // unk2
                    Packet.WriteByte(0); // unk3

                    if ((ItemInfo.Slot == ItemSlot.Weapon
                        || ItemInfo.Slot == ItemSlot.Weapon2)
                        && ItemInfo.Class != ItemClass.Shield)
                    {
                        Packet.WriteUShort(0xFFFF); // title mob 1
                        Packet.WriteUInt(0);      // title mob 1 kill count
                        Packet.WriteUShort(0xFFFF); // title mob 2
                        Packet.WriteUInt(0);      // title mob 2 kill count
                        Packet.WriteUShort(0xFFFF); // title mob 3
                        Packet.WriteUInt(0);      // title mob 3 kill count

                        Packet.WriteUShort(0xFFFF); // unk
                        Packet.WriteString("", 16); // license adder name
                        Packet.WriteByte(0);
                    }

                    Packet.WriteUInt(1992027391); // unk4
                    break;

                case ItemSlot.Necklace:
                case ItemSlot.Earings:
                case ItemSlot.Ring:
                case ItemSlot.Ring2:
                    Packet.WriteUInt(1992027391); // expire time?
                    Packet.WriteUInt(0); // time ?
                    Packet.WriteByte(0);//upgrades

                    Packet.WriteUShort(0); // refinement stats?
                    Packet.WriteUShort((ushort)UpgradeStats.Str);
                    Packet.WriteUShort((ushort)UpgradeStats.End);
                    Packet.WriteUShort((ushort)UpgradeStats.Dex);
                    Packet.WriteUShort((ushort)UpgradeStats.Int);
                    Packet.WriteUShort((ushort)UpgradeStats.Spr);

                    break;

                default:
                    Packet.WriteUInt(0);
                    Packet.WriteUInt(1992027391); // expire time?
                    break;
            }

            switch (ItemInfo.Slot)
            {
                case ItemSlot.Weapon:
                case ItemSlot.Weapon2:
                case ItemSlot.Armor:
                case ItemSlot.Pants:
                case ItemSlot.Boots:
                case ItemSlot.Helm:
                case ItemSlot.Pet:
                case ItemSlot.Necklace:
                case ItemSlot.Earings:
                case ItemSlot.Ring:
                case ItemSlot.Ring2:
                    Packet.WriteByte((byte)(statCount << 1 | 1));

                    if (ItemInfo.Stats.Str > 0) { Packet.WriteByte(0); Packet.WriteUShort((ushort)ItemInfo.Stats.Str); }
                    if (ItemInfo.Stats.End > 0) { Packet.WriteByte(1); Packet.WriteUShort((ushort)ItemInfo.Stats.End); }
                    if (ItemInfo.Stats.Dex > 0) { Packet.WriteByte(2); Packet.WriteUShort((ushort)ItemInfo.Stats.Dex); }
                    if (ItemInfo.Stats.Spr > 0) { Packet.WriteByte(3); Packet.WriteUShort((ushort)ItemInfo.Stats.Spr); }
                    if (ItemInfo.Stats.Int > 0) { Packet.WriteByte(4); Packet.WriteUShort((ushort)ItemInfo.Stats.Int); }
                    break;
            }
        }
开发者ID:,项目名称:,代码行数:88,代码来源:

示例13: GotIngame

        public static void GotIngame(WorldClient client, Packet packet)
        {
            /* using (var p1 = new Packet(SH4Type.CharacterGuildacademyinfo))
               {
               if(client.Character.GuildAcademy != null)
               {

               }
               else
               {
               p1.Fill(5, 0);
               }
               client.SendPacket(p1);
               }
              using (var p2 = new Packet(SH4Type.CharacterGuildinfo))
               {
                  if (client.Character.Guild != null)
                  {
                      client.Character.Guild.Details.WriteMessageAsGuildMember(p2, client.Character.Guild);

                  }
                  else
                  {
                      p2.WriteInt(0);
                  }
              client.SendPacket(p2);
               }*/
               // dafuq no op code..
               using (var p = new Packet(0x581C))
               {
             //p.WriteShort();
               p.WriteUInt(0x4d0bc167);   // 21h
               client.SendPacket(p);
               }
               // dafuq no op code..
               using (var p3 = new Packet(0x581D))
               {
               p3.WriteShort(0);           //zero kingdom quests!
               client.SendPacket(p3);
               }

               using (var p4 = new Packet(21, 7))
               {
               p4.WriteByte((byte)client.Character.Friends.Count);
               client.Character.WriteFriendData(p4);
               client.SendPacket(p4);
               }
               using (var p5 = new Packet(SH2Type.UnkTimePacket))
               {
               p5.WriteShort(256);
               client.SendPacket(p5);
               }
               if (!client.Character.IsIngame)
               {
               client.Character.IsIngame = true;

               client.Character.OneIngameLoginLoad();
               MasterManager.Instance.SendMasterList(client);
               //SendMasterList(pClient);
               }

               Managers.CharacterManager.InvokdeIngame(client.Character);
               client.Character.OnGotIngame();
        }
开发者ID:,项目名称:,代码行数:64,代码来源:

示例14: UpdateCharacterLevel

        public void UpdateCharacterLevel(ZoneCharacter pChar)
        {
            using (Packet packet = new Packet(SH14Type.SetMemberStats))
            {
                packet.WriteByte(0x01);             // UNK
                packet.WriteString(pChar.Name, 16);
                packet.WriteByte((byte)pChar.Job);
                packet.WriteByte(pChar.Level);
                packet.WriteUInt(pChar.MaxHP);
                packet.WriteUInt(pChar.MaxSP);
                packet.WriteByte(0x01);             // UNK

                AnnouncePacket(packet);
            }
        }
开发者ID:,项目名称:,代码行数:15,代码来源:

示例15: SendGainExp

 public static void SendGainExp(ZoneCharacter who, uint amount, ushort mobid = (ushort) 0xFFFF)
 {
     using (var packet = new Packet(SH9Type.GainExp))
     {
         packet.WriteUInt(amount);
         packet.WriteUShort(mobid);
         who.Client.SendPacket(packet);
     }
 }
开发者ID:,项目名称:,代码行数:9,代码来源:


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