當前位置: 首頁>>代碼示例>>C#>>正文


C# Packet.WriteByte方法代碼示例

本文整理匯總了C#中Solar.FiestaLib.Networking.Packet.WriteByte方法的典型用法代碼示例。如果您正苦於以下問題:C# Packet.WriteByte方法的具體用法?C# Packet.WriteByte怎麽用?C# Packet.WriteByte使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Solar.FiestaLib.Networking.Packet的用法示例。


在下文中一共展示了Packet.WriteByte方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: WriteLook

 public static void WriteLook(WorldCharacter wchar, Packet packet)
 {
     packet.WriteByte(Convert.ToByte(0x00001 | (wchar.Character.Job << 2) | (Convert.ToByte(wchar.Character.Male)) << 7));
     packet.WriteByte(wchar.Character.Hair);
     packet.WriteByte(wchar.Character.HairColor);
     packet.WriteByte(wchar.Character.Face);
 }
開發者ID:iFeddy,項目名稱:SolarFiesta,代碼行數:7,代碼來源:PacketHelper.cs

示例2: 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:iFeddy,項目名稱:SolarFiesta,代碼行數:15,代碼來源:Handler9.cs

示例3: CreateWorldMessage

 public static Packet CreateWorldMessage(WorldMessageTypes pType, string pMessage)
 {
     var packet = new Packet(SH25Type.WorldMessage);
     packet.WriteByte((byte)pType);
     packet.WriteStringLen(pMessage, true);
     return packet;
 }
開發者ID:iFeddy,項目名稱:SolarFiesta,代碼行數:7,代碼來源:Handler25.cs

示例4: ShowDrops

 public static Packet ShowDrops(List<Drop> drops)
 {
     Packet packet = new Packet(SH7Type.ShowDrops);
     packet.WriteByte((byte)drops.Count);
     drops.ForEach(d => d.Write(packet));
     return packet;
 }
開發者ID:iFeddy,項目名稱:SolarFiesta,代碼行數:7,代碼來源:Handler7.cs

示例5: 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:iFeddy,項目名稱:SolarFiesta,代碼行數:7,代碼來源:Handler8.cs

示例6: SendSkillLearnt

 public static void SendSkillLearnt(ZoneCharacter character, ushort skillid)
 {
     using (var packet = new Packet(SH18Type.LearnSkill))
     {
         packet.WriteUShort(skillid);
         packet.WriteByte(0); //unk
         character.Client.SendPacket(packet);
     }
 }
開發者ID:iFeddy,項目名稱:SolarFiesta,代碼行數:9,代碼來源:Handler18.cs

示例7: SendServerTime

 public static void SendServerTime(WorldClient client)
 {
     using (var packet = new Packet(SH2Type.ServerTime))
     {
         packet.WriteByte(Convert.ToByte(DateTime.Now.Hour));
         packet.WriteUShort(Convert.ToUInt16(DateTime.Now.Minute));
         client.SendPacket(packet);
     }
 }
開發者ID:iFeddy,項目名稱:SolarFiesta,代碼行數:9,代碼來源:Handler2.cs

示例8: 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:iFeddy,項目名稱:SolarFiesta,代碼行數:9,代碼來源:Drop.cs

示例9: SendQuestion

 public static void SendQuestion(ZoneCharacter character, Question question, ushort range)
 {
     using (var packet = new Packet(SH15Type.Question))
     {
         packet.WriteString(question.Text, 129);
         packet.WriteUShort(character.MapObjectID);     // Obj id
         packet.WriteInt(character.Position.X);
         packet.WriteInt(character.Position.Y);
         packet.WriteUShort(range);        // Distance how far your allowed to run when the question window is closed by Client
         packet.WriteByte((byte)question.Answers.Count);
         for (byte i = 0; i < question.Answers.Count; ++i)
         {
             packet.WriteByte(i);
             packet.WriteString(question.Answers[i], 32);
         }
         character.Client.SendPacket(packet);
     }
 }
開發者ID:iFeddy,項目名稱:SolarFiesta,代碼行數:18,代碼來源:Handler15.cs

示例10: Equip

 public static Packet Equip(ZoneCharacter character, Equip equip)
 {
     //B2 00 - AB 38 - 07 - 0D 00 04
     Packet packet = new Packet(SH7Type.ShowEquip);
     packet.WriteUShort(character.MapObjectID);
     packet.WriteUShort(equip.ItemID);
     packet.WriteByte(equip.Upgrades);
     packet.Fill(3, 0xff);
     return packet;
 }
開發者ID:iFeddy,項目名稱:SolarFiesta,代碼行數:10,代碼來源:Handler7.cs

示例11: Write

 public void Write(Packet packet)
 {
     packet.WriteUShort(this.MapObjectID);
     packet.WriteByte(2); //always 2 (type i bet shown / transparent?)
     packet.WriteUShort(ID);
     packet.WriteInt(this.Position.X);
     packet.WriteInt(this.Position.Y);
     packet.WriteByte(this.Rotation); //TODO: rotation for NPC (from txt official files?)
     if (Gate != null)
     {
         packet.WriteByte(1);
         packet.WriteString(Gate.MapClient, 12);
         packet.Fill(41, 0);
     }
     else
     {
         packet.Fill(54, 0); //find out later
     }
 }
開發者ID:iFeddy,項目名稱:SolarFiesta,代碼行數:19,代碼來源:NPC.cs

示例12: SpawnMultiPlayer

 public static Packet SpawnMultiPlayer(List<ZoneCharacter> characters, ZoneCharacter exclude = null)
 {
     Packet packet = new Packet(SH7Type.SpawnMultiPlayer);
     packet.WriteByte(exclude == null ? (byte)characters.Count : (byte)(characters.Count - 1));
     foreach (var character in characters)
     {
         if (character == exclude) continue;
         character.WriteCharacterDisplay(packet);
     }
     return packet;
 }
開發者ID:iFeddy,項目名稱:SolarFiesta,代碼行數:11,代碼來源:Handler7.cs

示例13: SendActiveSkillList

 public static void SendActiveSkillList(ZoneCharacter character)
 {
     using (var packet = new Packet(SH4Type.CharacterActiveSkillList))
     {
         var list = character.SkillsActive.Values;
         packet.WriteByte(0);
         packet.WriteInt(character.ID);
         packet.WriteUShort((ushort)list.Count); // Skill count (max 300)
         foreach (var skill in list)
         {
             skill.Write(packet);
         }
         character.Client.SendPacket(packet);
     }
 }
開發者ID:iFeddy,項目名稱:SolarFiesta,代碼行數:15,代碼來源:Handler4.cs

示例14: WritePacket

        public void WritePacket(Packet pPacket)
        {
            pPacket.WriteUShort(ItemID);
            if (this.Type != HouseType.Resting)
            {
                pPacket.Fill(10, 0xFF); // Unknown

                pPacket.WriteString(this.Name, 30);
            }
            else
            {
                pPacket.WriteHexAsBytes("BE 02 FA 01 F8 01");
                pPacket.Fill(34, 0xFF); // No idea!?
            }
            pPacket.WriteByte(0xFF);
        }
開發者ID:iFeddy,項目名稱:SolarFiesta,代碼行數:16,代碼來源:House.cs

示例15: MultiObjectList

 public static Packet MultiObjectList(List<MapObject> objs, int start, int end)
 {
     Packet packet = new Packet(SH7Type.SpawnMultiObject);
     packet.WriteByte((byte)(end - start));
     Log.WriteLine(LogLevel.Debug, "Sending {0} objects ({1} - {2})", end - start, start, end);
     for (int i = start; i < end; i++)
     {
         var obj = objs[i];
         if (obj is NPC)
         {
             ((NPC)obj).Write(packet);
         }
         else if (obj is Mob) // Just to be sure
         {
             ((Mob)obj).Write(packet);
         }
         else
         {
             Log.WriteLine(LogLevel.Warn, "What the F is {0} doing here lol", obj.ToString());
         }
      }
     return packet;
 }
開發者ID:iFeddy,項目名稱:SolarFiesta,代碼行數:23,代碼來源:Handler7.cs


注:本文中的Solar.FiestaLib.Networking.Packet.WriteByte方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。