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


C# Packet.WriteShort方法代码示例

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


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

示例1: SendError

 public static void SendError(ZoneClient client, ServerError error)
 {
     using (Packet pack = new Packet(SH3Type.Error))
     {
         pack.WriteShort((byte)error);
         client.SendPacket(pack);
     }
 }
开发者ID:,项目名称:,代码行数:8,代码来源:

示例2: BySPStoneHandler

 public static void BySPStoneHandler(ZoneClient client, Packet packet)
 {
     short Amount;
     if (packet.TryReadShort(out Amount))
     {
         client.Character.ChangeMoney(client.Character.Character.Money -= client.Character.BaseStats.PriceSPStone);
         short Am = Amount += client.Character.StonesSP;
         client.Character.StonesHP = Am;
         using (var p = new Packet(SH20Type.ChangeSPStones))
         {
             p.WriteShort(Am);
             client.SendPacket(p);
         }
     }
 }
开发者ID:,项目名称:,代码行数:15,代码来源:

示例3: WriteBasicCharInfo

        public static void WriteBasicCharInfo(WorldCharacter wchar, Packet packet)
        {
            packet.WriteInt(wchar.Character.ID); //charid
            packet.FillPadding(wchar.Character.Name, 0x10);
            packet.WriteInt(0);//unk
            packet.WriteShort((short)wchar.Character.CharLevel); //level
            packet.WriteByte(wchar.Character.Slot);
            MapInfo mapinfo;
            if (!DataProvider.Instance.Maps.TryGetValue(wchar.Character.PositionInfo.Map, out mapinfo))
            {
                Log.WriteLine(LogLevel.Warn, "{0} has an invalid MapID ({1})", wchar.Character.Name, wchar.Character.PositionInfo.Map);
                wchar.Character.PositionInfo.Map = 0;
                packet.FillPadding(mapinfo.ShortName, 0x0D); //townname
            }
            else
            {
                packet.FillPadding(mapinfo.ShortName, 0x0D); //townname
            }

            //packet.WriteByte(0); // UNK
            packet.WriteInt(0); // Random seed
            WriteLook(wchar,packet);
            WriteEquipment(wchar,packet);
            WriteRefinement(wchar,packet);
            packet.WriteByte(0);

            packet.WriteByte(0xF0);
            packet.WriteByte(0xFF);//unk
            packet.WriteByte(0xFF);

            packet.FillPadding(mapinfo.ShortName, 0x0c);
            packet.WriteInt(0); //pos
            packet.WriteInt(0); //pos
            packet.WriteUShort(0xdb78);
            packet.WriteUShort(4910);//unk
            packet.WriteUShort(25600);
            packet.Fill(4, 0);
        }
开发者ID:,项目名称:,代码行数:38,代码来源:

示例4: SendHandshake

 private void SendHandshake(short pXorPos)
 {
     Packet packet = new Packet(SH2Type.SetXorKeyPosition);
     packet.WriteShort(pXorPos);
     SendPacket(packet);
 }
开发者ID:,项目名称:,代码行数:6,代码来源:

示例5: On_GameClient_LeaveGuild

        public static void On_GameClient_LeaveGuild(WorldClient Client, Packet pPacket)
        {
            if (Client.Character.Guild == null)
            {
                return;
            }

            GuildMember member;
            if (Client.Character.Guild.GetMember(Client.Character.Character.Name, out member))
            {
                Client.Character.Guild.RemoveMember(member, null, true);

                using (var packet = new Packet(SH29Type.LeaveGuildResponse))
                {
                    packet.WriteShort(3137);

                    Client.SendPacket(packet);
                }
            }
        }
开发者ID:,项目名称:,代码行数:20,代码来源:

示例6: WriteDetailedInfo

 public void WriteDetailedInfo(Packet pPacket)
 {
     pPacket.WriteInt(ID);
     pPacket.WriteString(this.Name, 16);
     pPacket.WriteByte(this.Slot);
     pPacket.WriteByte(this.Level);
     pPacket.WriteLong(this.Exp);
     pPacket.WriteInt(12345678);                // UNK
     pPacket.WriteShort(this.StonesHP);
     pPacket.WriteShort(this.StonesSP);
     pPacket.WriteUInt(this.HP);
     pPacket.WriteUInt(this.SP);
     pPacket.WriteInt(this.Fame);
     pPacket.WriteLong(this.Inventory.Money);
     pPacket.WriteString(this.Map.MapInfo.ShortName, 12);
     pPacket.WriteInt(this.Position.X);
     pPacket.WriteInt(this.Position.Y);
     pPacket.WriteByte(this.Rotation);
     pPacket.WriteByte(this.Str);//  -.
     pPacket.WriteByte(this.End);//   |
     pPacket.WriteByte(this.Dex);//   |  Boni
     pPacket.WriteByte(this.Int);//   |
     pPacket.WriteByte(this.Spr);//  -'
     pPacket.WriteShort(0);               // UNK
     pPacket.WriteUInt(0);               // Killpoints (TODO)
     pPacket.Fill(7, 0);                 // UNK
 }
开发者ID:,项目名称:,代码行数:27,代码来源:

示例7: WriteCharacterDisplay

        public void WriteCharacterDisplay(Packet packet)
        {
            packet.WriteUShort(MapObjectID);
            packet.WriteString(Name, 16);
            packet.WriteInt(Position.X);
            packet.WriteInt(Position.Y);
            packet.WriteByte(Rotation);                // Rotation
            packet.WriteByte((byte)State);          // Player State (1,2 - Player, 3 - Dead, 4 - Resting, 5 - Vendor, 6 - On Mount)
            packet.WriteByte((byte)Job);
            if (State != PlayerState.Resting && State != PlayerState.Vendor && this.House == null)
            {
                WriteLook(packet);
                WriteEquipment(packet);
            }
            else
            {
                this.House.WritePacket(packet);
            }
            WriteRefinement(packet);
            //(IsMale ? 1 : 0)
            int mount = (this.Mount != null) ? (int) this.Mount.Handle : (int)0xffff;
            packet.WriteUShort((ushort)mount);  // Mount Handle
            packet.WriteUShort(0xffff);
            packet.WriteByte(0xff);          // Emote (0xff = nothing)
            packet.WriteUShort(0xffff);
            packet.WriteShort(0);
            packet.WriteUShort(0);             // Mob ID (title = 10)

            packet.Fill(55, 0);                // Buff Bits? Something like that
            if (this.Character.GuildID > 1)
            {
                packet.WriteInt(this.Guild.ID);
            }
            else if (this.Character.AcademyID > 0)
            {
                packet.WriteInt(this.Character.AcademyID);
            }
            else
            {
                packet.WriteInt(0);
            }
            packet.WriteByte(0x02);            // UNK (0x02)

            packet.WriteBool(this.IsInaAcademy);            // In Guild Academy (0 - No, 1 - Yes)
            packet.WriteBool(true);            // Pet AutoPickup   (0 - Off, 1 - On)
            packet.WriteByte(this.Level);
        }
开发者ID:,项目名称:,代码行数:47,代码来源:

示例8: UseTeleporter

        public static void UseTeleporter(ZoneClient client, Packet packet)
        {
            byte anwser;
            if (packet.TryReadByte(out anwser))
            {
                using (Packet Packet = new Packet(SH6Type.TelePorter))
                {
                    Packet.WriteShort(6593);//code for normal teleport
                    client.SendPacket(Packet);
                }
                switch (anwser)
                {
                    case 0:
                        client.Character.ChangeMap(0, 4199, 4769);//Roumen

                        break;
                    case 1:
                        client.Character.ChangeMap(9, 11802, 10466);//Eldrine

                        break;
                    case 2:
                        client.Character.ChangeMap(75, 9069, 9312);//EldGbl02
                        break;
                    case 3:
                        client.Character.ChangeMap(5,13658,7812);//RouVal01

                        break;
                    default:
                        Log.WriteLine(LogLevel.Warn,"Unkown Teleport Answer {1}",anwser);
                        break;
                }
            }
        }
开发者ID:,项目名称:,代码行数:33,代码来源:

示例9: VersionInfo

 public static void VersionInfo(LoginClient pClient, Packet pPacket)
 {
     ushort year;
     ushort version;
     if (!pPacket.TryReadUShort(out year) ||
         !pPacket.TryReadUShort(out version)) {
     Log.WriteLine(LogLevel.Warn, "Invalid client version.");
     pClient.Disconnect();
     return;
     }
     Log.WriteLine(LogLevel.Debug, "Client version authenticated - Year: {0} Version: {1}.", year, version);
     using (Packet response = new Packet(SH3Type.VersionAllowed)) {
     response.WriteShort(1);
     pClient.SendPacket(response);
     }
 }
开发者ID:,项目名称:,代码行数:16,代码来源:

示例10: FriendListDelete

        public static void FriendListDelete(WorldClient pClient, Packet pPacket)
        {
            string sender, target;
            if (!pPacket.TryReadString(out sender, 16) ||
                !pPacket.TryReadString(out target, 16))
            {
                Log.WriteLine(LogLevel.Warn, "Error parsing friend delete request.");
                return;
            }

            if (pClient.Character.DeleteFriend(target))
            {
                WorldClient client = ClientManager.Instance.GetClientByCharname(target);
                if (client != null)
                {
                    using (var pack = new Packet(SH21Type.FriendDeleteSend))
                    {
                        pack.WriteString(sender, 16);
                        client.SendPacket(pack);
                    }
                    Friend friend = pClient.Character.Friends.Find(f => f.Name == target);
                    if(friend != null)
                    pClient.Character.Friends.Remove(friend);
                }

                using (var pack = new Packet(SH21Type.FriendDeleteSend))
                {
                    pack.WriteString(sender, 16);
                    pack.WriteString(target, 16);
                    pack.WriteShort(0x0951);
                   pClient.SendPacket(pack);
                }

            }
            else
            {
                using (var pack = new Packet(SH21Type.FriendInviteResponse))
                {
                    pack.WriteString(target, 16);
                    pack.WriteString(sender, 16);
                    pack.WriteUShort(0x0946);	// Cannot find ${Target}
                    pClient.SendPacket(pack);
                }
            }
        }
开发者ID:,项目名称:,代码行数:45,代码来源:

示例11: SendTitleList

        public static void SendTitleList(ZoneCharacter character)
        {
            using (var packet = new Packet(SH4Type.CharacterTitles))
            {
                packet.WriteInt(0); //current title ID
                packet.WriteShort(0); //title count
                //here comes shit loop (see old Estrella)

                character.Client.SendPacket(packet);
            }
        }
开发者ID:,项目名称:,代码行数:11,代码来源:

示例12: SendQuestListDone

 public static void SendQuestListDone(ZoneCharacter character)
 {
     using (var packet = new Packet(SH4Type.CharacterQuestsDone))
     {
         packet.WriteInt(character.ID);
         packet.WriteShort(0); //quest count
         character.Client.SendPacket(packet);
     }
 }
开发者ID:,项目名称:,代码行数:9,代码来源:

示例13: WriteGuildInfo

        public void WriteGuildInfo(Packet Packet)
        {
            Packet.WriteInt(ID);
            Packet.WriteInt(ID); // academy id?
            Packet.WriteString(Name, 16);

            Packet.Fill(24, 0x00); //unk
            Packet.WriteUShort(38);
            Packet.WriteInt(100);
            Packet.Fill(233, 0x00);//unk
            Packet.WriteUShort(11779);
            Packet.WriteShort(20082);
            Packet.WriteInt(31);
            Packet.WriteInt(55);
            Packet.WriteInt(18);//unk
            Packet.WriteInt(15);
            Packet.WriteInt(8);//unk
            Packet.WriteInt(111);//unk
            Packet.WriteInt(4);
            Packet.Fill(136, 0);//buff or string
            Packet.WriteUShort(1824);
            Packet.WriteUShort(20152);
            Packet.WriteInt(16);
            Packet.WriteInt(28);
            Packet.WriteInt(MessageCreateTime.Minute);//createDetails Guild Minutes Date
            Packet.WriteInt(MessageCreateTime.Hour); //create Details Guild Hours Date
            Packet.WriteInt(MessageCreateTime.Day);//create details Guild Day Date
            Packet.WriteInt(MessageCreateTime.Month);//create details Month
            Packet.WriteInt(MessageCreateTime.Year - 1900);//creae details year 1900- 2012
            Packet.WriteInt(10);//unk
            Packet.WriteUShort(2);
            Packet.Fill(6, 0);//unk
            if(MessageCreater.Character.Name == null)
            {
            Packet.WriteString("", 16);
            }
            else
            {
                Packet.WriteString(MessageCreater.Character.Name, 16);
            }
            Packet.WriteString(Message, 512);//details message
        }
开发者ID:,项目名称:,代码行数:42,代码来源:

示例14: 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,代码来源:


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