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


C# Packet.WriteUShort方法代码示例

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


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

示例1: BeginDisplayRest

 public static Packet BeginDisplayRest(ZoneCharacter character)
 {
     Packet packet = new Packet(SH8Type.BeginDisplayRest);
     packet.WriteUShort(character.MapObjectID);
     packet.WriteUShort(character.House.ItemID);
     packet.Fill(10, 0xff);
     return packet;
 }
开发者ID:Zepheus,项目名称:Zepheus_Fiesta,代码行数:8,代码来源:Handler8.cs

示例2: Write

        public void Write(Packet pPacket)
        {
            pPacket.WriteUShort(ID);
            pPacket.WriteInt(60000); // Cooldown
            //pPacket.WriteShort(Upgrades);
            pPacket.WriteUShort(GetUpgrades(4, 3, 2, 1));

            pPacket.WriteInt(9000);         // Skill exp???
        }
开发者ID:Canic,项目名称:Zepheus_2k15,代码行数:9,代码来源:Skill.cs

示例3: SendCharacterChunkEnd

 public static void SendCharacterChunkEnd(ZoneCharacter character)
 {
     using (var packet = new Packet(SH4Type.CharacterInfoEnd))
     {
         packet.WriteUShort(0xFFFF);
         packet.WriteUShort(0xFFFF);
         character.Client.SendPacket(packet);
     }
 }
开发者ID:Canic,项目名称:Zepheus_2k15,代码行数:9,代码来源:Handler4.cs

示例4: Write

 public void Write(Packet packet)
 {
     packet.WriteUShort(ID);
     packet.WriteUShort(Item.ItemID);
     packet.WriteInt(Position.X);
     packet.WriteInt(Position.Y);
     packet.WriteUShort((DroppedBy != null) ? DroppedBy.MapObjectID : (ushort)0xffff);
     packet.WriteByte(CanTake ? (byte)0x08 : (byte)0x00);
 }
开发者ID:Dextan,项目名称:Estrella,代码行数:9,代码来源:Drop.cs

示例5: Equip

 public static Packet Equip(ZoneCharacter character, Item equip)
 {
     //B2 00 - AB 38 - 07 - 0D 00 04
     Packet packet = new Packet(SH7Type.ShowEquip);
     packet.WriteUShort(character.MapObjectID);
     packet.WriteUShort(equip.ID);
     packet.WriteByte(equip.UpgradeStats.Upgrades);
     packet.Fill(3, 0xff);
     return packet;
 }
开发者ID:Dextan,项目名称:Estrella,代码行数:10,代码来源:Handler7.cs

示例6: SendChangeZone

 public static void SendChangeZone(ZoneCharacter character, ushort mapid, int x, int y, string ip, ushort port, ushort randomid)
 {
     using (var packet = new Packet(SH6Type.ChangeZone))
     {
         packet.WriteUShort(mapid);
         packet.WriteInt(x);
         packet.WriteInt(y);
         packet.WriteString(Settings.Instance.IP, 16);
         packet.WriteUShort(port);
         packet.WriteUShort(randomid);
         character.Client.SendPacket(packet);
     }
 }
开发者ID:Dextan,项目名称:Estrella,代码行数:13,代码来源:Handler6.cs

示例7: SendChangeZone

        public static void SendChangeZone(ZoneCharacter character, ushort mapid, int x, int y, string IP, ushort port, ushort randomid)
        {
            using (var packet = new Packet(SH6Type.ChangeZone))
            {
                packet.WriteUShort(mapid);
                packet.WriteInt(x);
                packet.WriteInt(y);

                packet.WriteString(character.Client.Host == "127.0.0.1" ? "127.0.0.1" : IP, 16);
                packet.WriteUShort(port);
                packet.WriteUShort(randomid);
                character.Client.SendPacket(packet);
            }
        }
开发者ID:Zepheus,项目名称:Zepheus_Fiesta,代码行数:14,代码来源:Handler6.cs

示例8: SendAttackAnimation

        public static void SendAttackAnimation(MapObject from, ushort objectID, ushort attackspeed, byte stance)
        {
            using (var packet = new Packet(SH9Type.AttackAnimation))
            {
                packet.WriteUShort(from.MapObjectID);
                packet.WriteUShort(objectID);
                packet.WriteByte(stance);

                packet.WriteUShort(attackspeed);

                packet.WriteByte(4);
                packet.WriteByte(100);
                from.MapSector.Broadcast(packet);
            }
        }
开发者ID:Dextan,项目名称:Estrella,代码行数:15,代码来源:Handler9.cs

示例9: WriteBasicCharInfo

        public static void WriteBasicCharInfo(WorldCharacter wchar, Packet packet)
        {
            packet.WriteInt(wchar.Character.ID);
            packet.WriteString(wchar.Character.Name, 16);
            packet.WriteUShort(wchar.Character.CharLevel);
            packet.WriteByte(wchar.Character.Slot);
            MapInfo mapinfo;
            if (!DataProvider.Instance.Maps.TryGetValue(wchar.Character.Map, out mapinfo))
            {
                Log.WriteLine(LogLevel.Warn, "{0} has an invalid MapID ({1})", wchar.Character.Name, wchar.Character.Map);
                wchar.Character.Map = 0;//we reset
                packet.WriteString("Rou", 12);
            }
            else
            {
                packet.WriteString(mapinfo.ShortName, 12);
            }
            packet.WriteByte(0);               // UNK
            packet.WriteInt(0x00000000);       // Random seed
            WriteLook(wchar, packet);
            WriteEquipment(wchar, packet);
            WriteRefinement(wchar, packet);
            packet.Fill(4, 0xff);      		// UNK
            packet.WriteString("Rou", 12); //TODO: load from mapinfo.shn
            packet.WriteInt(0);				// X, doesn't matter
            packet.WriteInt(0);        		// Y, neither

            packet.WriteInt(0x63dd45ca);
            packet.WriteByte(0);
            packet.WriteInt(100);      		// Test later!
            packet.WriteByte(0);
            wchar.Detach();
        }
开发者ID:Zepheus,项目名称:Zepheus_Fiesta,代码行数:33,代码来源:PacketHelper.cs

示例10: Animation

 public static Packet Animation(ZoneCharacter character, byte id)
 {
     Packet packet = new Packet(SH8Type.Emote);
     packet.WriteUShort(character.MapObjectID);
     packet.WriteByte(id);
     return packet;
 }
开发者ID:Zepheus,项目名称:Zepheus_Fiesta,代码行数:7,代码来源:Handler8.cs

示例11: AddBlock

 public static void AddBlock(WorldClient client, Packet packet)
 {
     string AddBlockname;
     if (packet.TryReadString(out AddBlockname, 16))
     {
         client.Character.BlocketUser.Add(AddBlockname);
         using (var pp = new Packet(SH42Type.AddToBlockList))
         {
             pp.WriteUShort(7168);//unk
             pp.WriteString(AddBlockname, 16);
             pp.WriteUShort(0);//unk
             client.SendPacket(pp);
         }
         Program.DatabaseManager.GetClient().ExecuteQuery("INSERT INTO BlockUser (CharID,BlockCharname) VALUES ('" + client.Character.ID + "','" + AddBlockname + "')");
     }
 }
开发者ID:Dextan,项目名称:Estrella,代码行数:16,代码来源:Handler42.cs

示例12: LeaveParty

        public static void LeaveParty(WorldClient client, Packet packet)
        {
            Party party;
            party = Program.Entity.Parties.First(c => c.CharNo == client.Character.Character.ID);

            foreach (Party PartyListFromDB in Program.Entity.Parties.Where(c => c.PartyNo == party.PartyNo).OrderBy(c => c.MasterNo))
            {
                Character character;
                character = Program.Entity.Characters.First(c => c.ID == PartyListFromDB.CharNo);
                WorldClient Partyclient = ClientManager.Instance.GetClientByCharname(character.Name);
                using (var ppacket = new Packet(SH14Type.LeaveParty))
                {
                    ppacket.WriteString(client.Character.Character.Name, 16);
                    ppacket.WriteUShort(1281);
                    Partyclient.SendPacket(ppacket);
                }
            }

            if(Program.Entity.Parties.Where(c => c.PartyNo == party.PartyNo).Count() == 2){
                Party OtherClientParty;
                OtherClientParty = Program.Entity.Parties.First(c => c.CharNo != client.Character.Character.ID);
                Program.Entity.DeleteObject(OtherClientParty);
            }

            Program.Entity.DeleteObject(party);
            Program.Entity.SaveChanges();
        }
开发者ID:Canic,项目名称:Zepheus_2k15,代码行数:27,代码来源:Handler14.cs

示例13: FailedUnequip

 public static void FailedUnequip(ZoneCharacter character)
 {
     using (var packet = new Packet(SH12Type.FailedUnequip))
     {
         packet.WriteUShort(706);
         character.Client.SendPacket(packet);
     }
 }
开发者ID:Canic,项目名称:Zepheus_2k15,代码行数:8,代码来源:Handler12.cs

示例14: SendConnectError

 public static void SendConnectError(WorldClient client, ConnectErrors error)
 {
     using (var packet = new Packet(SH4Type.ConnectError))
     {
         packet.WriteUShort((ushort)error);
         client.SendPacket(packet);
     }
 }
开发者ID:Dextan,项目名称:Estrella,代码行数:8,代码来源:Handler4.cs

示例15: FailedEquip

 public static void FailedEquip(ZoneCharacter character, ushort val = 0)
 {
     using (var packet = new Packet(SH12Type.FailedEquip))
     {
         packet.WriteUShort(val);
         character.Client.SendPacket(packet);
     }
 }
开发者ID:Canic,项目名称:Zepheus_2k15,代码行数:8,代码来源:Handler12.cs


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