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


C# PacketWriter.Finish方法代码示例

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


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

示例1: Create

        /// <summary>
        /// </summary>
        /// <param name="username">
        /// </param>
        /// <returns>
        /// </returns>
        public static byte[] Create(string username)
        {
            PacketWriter writer = new PacketWriter(0x07);
            IEnumerable<DBCharacter> chars = CharacterDao.Instance.GetAllForUser(username);

            byte[] numberOfCharacters = BitConverter.GetBytes(IPAddress.HostToNetworkOrder((Int16)chars.Count()));
            writer.WriteBytes(numberOfCharacters);
            foreach (DBCharacter character in chars)
            {
                writer.WriteUInt32((UInt32)character.Id);
            }

            writer.WriteBytes(numberOfCharacters);
            foreach (DBCharacter character in chars)
            {
                writer.WriteString(character.Name);
            }

            writer.WriteBytes(numberOfCharacters);
            foreach (DBCharacter character in chars)
            {
                writer.WriteUInt32((UInt32)StatDao.Instance.GetById(50000, character.Id, 54).StatValue);
            }

            writer.WriteBytes(numberOfCharacters);
            foreach (DBCharacter character in chars)
            {
                writer.WriteUInt32((uint)CharacterDao.Instance.IsOnline(character.Id));
            }

            return writer.Finish();
        }
开发者ID:gordonc64,项目名称:CellAO-NightPredator,代码行数:38,代码来源:AccountCharacterList.cs

示例2: Create

 /// <summary>
 /// The new.
 /// </summary>
 /// <param name="client">
 /// </param>
 /// <param name="id">
 /// The id.
 /// </param>
 /// <returns>
 /// </returns>
 public static byte[] Create(Client client, uint id)
 {
     PacketWriter writer = new PacketWriter(20);
     writer.WriteUInt32(id);
     writer.WriteString(client.Character.characterName);
     return writer.Finish();
 }
开发者ID:kittin,项目名称:CellAO-NightPredator,代码行数:17,代码来源:PlayerName.cs

示例3: Create

 /// <summary>
 /// The create.
 /// </summary>
 /// <param name="playerid">
 /// </param>
 /// <param name="playername">
 /// </param>
 /// <returns>
 /// </returns>
 public static byte[] Create(uint playerid, string playername)
 {
     PacketWriter writer = new PacketWriter(21);
     writer.WriteUInt32(playerid);
     writer.WriteString(playername);
     return writer.Finish();
 }
开发者ID:kittin,项目名称:CellAO-NightPredator,代码行数:16,代码来源:NameLookupResult.cs

示例4: Create

 /// <summary>
 /// The create.
 /// </summary>
 /// <param name="privategroupid">
 /// </param>
 /// <param name="playerid">
 /// </param>
 /// <returns>
 /// </returns>
 public static byte[] Create(uint privategroupid, uint playerid)
 {
     PacketWriter writer = new PacketWriter(55);
     writer.WriteUInt32(privategroupid);
     writer.WriteUInt32(playerid);
     return writer.Finish();
 }
开发者ID:kittin,项目名称:CellAO-NightPredator,代码行数:16,代码来源:PrivateGroupPlayerJoined.cs

示例5: New

 /// <summary>
 /// The new.
 /// </summary>
 /// <param name="client">
 /// </param>
 /// <param name="id">
 /// The id.
 /// </param>
 /// <returns>
 /// </returns>
 public static byte[] New(Client client, uint id)
 {
     Client tmpClient = (Client)client.Server.ConnectedClients[id];
     PacketWriter writer = new PacketWriter(20);
     writer.WriteUInt32(id);
     writer.WriteString(tmpClient.Character.characterName);
     return writer.Finish();
 }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:18,代码来源:PlayerName.cs

示例6: Create

 // Tell
 /// <summary>
 /// The create.
 /// </summary>
 /// <param name="playerid">
 /// </param>
 /// <param name="message">
 /// </param>
 /// <param name="blob">
 /// </param>
 /// <returns>
 /// </returns>
 public static byte[] Create(uint playerid, string message, string blob)
 {
     PacketWriter writer = new PacketWriter(30);
     writer.WriteUInt32(playerid);
     writer.WriteString(message);
     writer.WriteString(blob);
     return writer.Finish();
 }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:20,代码来源:MsgPrivateGroup.cs

示例7: Create

 /// <summary>
 /// The create.
 /// </summary>
 /// <param name="arg1">
 /// </param>
 /// <param name="msg">
 /// </param>
 /// <param name="blob">
 /// </param>
 /// <returns>
 /// </returns>
 public static byte[] Create(string arg1, string msg, string blob)
 {
     PacketWriter writer = new PacketWriter(35);
     writer.WriteString(arg1);
     writer.WriteString(msg);
     writer.WriteString(blob);
     return writer.Finish();
 }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:19,代码来源:MsgAnonymousVicinity.cs

示例8: Create

 /// <summary>
 /// The create.
 /// </summary>
 /// <param name="playerid">
 /// </param>
 /// <param name="online">
 /// </param>
 /// <param name="status">
 /// </param>
 /// <returns>
 /// </returns>
 public static byte[] Create(uint playerid, uint online, byte[] status)
 {
     PacketWriter writer = new PacketWriter(40);
     writer.WriteUInt32(playerid);
     writer.WriteUInt32(online);
     writer.WriteBytes(status);
     return writer.Finish();
 }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:19,代码来源:BuddyOnlineStatus.cs

示例9: Create

 /// <summary>
 /// The create.
 /// </summary>
 /// <param name="channelid">
 /// </param>
 /// <param name="channelname">
 /// </param>
 /// <param name="flags">
 /// </param>
 /// <param name="otherdata">
 /// </param>
 /// <returns>
 /// </returns>
 public static byte[] Create(ulong channelid, string channelname, uint flags, byte[] otherdata)
 {
     PacketWriter writer = new PacketWriter(60);
     writer.Write5of8(channelid);
     writer.WriteString(channelname);
     writer.WriteUInt32(flags);
     writer.WriteBytes(otherdata);
     return writer.Finish();
 }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:22,代码来源:ChannelJoin.cs

示例10: Create

 /// <summary>
 /// The create.
 /// </summary>
 /// <param name="playerid">
 /// </param>
 /// <param name="windowid">
 /// </param>
 /// <param name="messageid">
 /// </param>
 /// <param name="msgargs">
 /// </param>
 /// <returns>
 /// </returns>
 public static byte[] Create(uint playerid, uint windowid, uint messageid, string msgargs)
 {
     PacketWriter writer = new PacketWriter(37);
     writer.WriteUInt32(playerid);
     writer.WriteUInt32(windowid);
     writer.WriteUInt32(messageid);
     writer.WriteString(msgargs);
     return writer.Finish();
 }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:22,代码来源:MsgPredefined.cs

示例11: Create

 /// <summary>
 /// The create.
 /// </summary>
 /// <param name="channel">
 /// </param>
 /// <param name="playerid">
 /// </param>
 /// <param name="message">
 /// </param>
 /// <param name="blob">
 /// </param>
 /// <returns>
 /// </returns>
 public static byte[] Create(ChannelBase channel, uint playerid, string message, string blob)
 {
     PacketWriter writer = new PacketWriter(65);
     writer.WriteByte((byte)channel.channelType);
     writer.WriteUInt32(channel.ChannelId);
     writer.WriteUInt32(playerid);
     writer.WriteString(message);
     writer.WriteString(blob);
     return writer.Finish();
 }
开发者ID:kittin,项目名称:CellAO-NightPredator,代码行数:23,代码来源:ChannelMessage.cs

示例12: Create

        /// <summary>
        /// The create.
        /// </summary>
        /// <param name="playerid">
        /// </param>
        /// <param name="message">
        /// </param>
        /// <param name="chatType">
        /// The chat Type.
        /// </param>
        /// <returns>
        /// </returns>
        public static byte[] Create(uint playerid, string message, byte chatType)
        {
            PacketWriter writer = new PacketWriter(34);
            writer.WriteUInt32(playerid);
            writer.WriteString(message);

            // Blob start
            // This blob is actually byte array,
            // but we have only one byte to send with it
            // so I didn't add array stuff
            // and made it always one byte.
            writer.WriteUInt16(1);
            writer.WriteByte(chatType);

            // Blob ends
            return writer.Finish();
        }
开发者ID:gordonc64,项目名称:CellAO-NightPredator,代码行数:29,代码来源:MsgVicinity.cs

示例13: Create

 /// <summary>
 /// The create.
 /// </summary>
 /// <param name="playerid">
 /// </param>
 /// <returns>
 /// </returns>
 public static byte[] Create(uint playerid)
 {
     PacketWriter writer = new PacketWriter(41);
     writer.WriteUInt32(playerid);
     return writer.Finish();
 }
开发者ID:gordonc64,项目名称:CellAO-NightPredator,代码行数:13,代码来源:BuddyRemoved.cs

示例14: Create

 /// <summary>
 /// The create.
 /// </summary>
 /// <param name="channelid">
 /// </param>
 /// <returns>
 /// </returns>
 public static byte[] Create(byte[] channelid)
 {
     PacketWriter writer = new PacketWriter(61);
     writer.WriteBytes(channelid);
     return writer.Finish();
 }
开发者ID:gordonc64,项目名称:CellAO-NightPredator,代码行数:13,代码来源:ChannelLeave.cs

示例15: Create

 /// <summary>
 /// The create.
 /// </summary>
 /// <returns>
 /// </returns>
 public static byte[] Create()
 {
     PacketWriter writer = new PacketWriter(6);
     return writer.Finish();
 }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:10,代码来源:LoginError.cs


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