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


C# PacketWriter.WriteUInt16方法代码示例

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


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

示例1: CreateBuff

        // Still no multi channel handle
        /// <summary>
        /// Create 'ChannelList' buffer
        /// </summary>
        /// <returns></returns>
        public byte[] CreateBuff()
        {
            byte[] block = new byte[0x40]; // Create our null byte array
            PacketWriter PW = new PacketWriter(block); // Initialize the reader

            PW.WriteByteArray(0, EngineUtils.PacketUtils.calcPacket(block.Length, 0x7D6)); // Write the packet header
            PW.WriteString(5, EngineEnum.PacketEnum.PacketCommand.success_0); // Write the success string cmd
            PW.WriteUInt16(29, 1); // I don't know yet what is this
            PW.WriteUInt16(31, 1); // I don't know yet what is this
            PW.WriteString(32, channelname); // Write channel name
            PW.WriteUInt32(44, 5); // I don't know yet what is this - multichannel
            PW.WriteUInt32(48, 6); // I don't know yet what is this - multichannel
            PW.WriteUInt32(52, 7); // I don't know yet what is this - multichannel
            PW.WriteUInt32(56, 9); // I don't know yet what is this - multichannel
            PW.WriteUInt32(60, 10); // I don't know yet what is this - multichannel

            if (channelname.Length > 11) // Channel name can't contains over 11 letters
            {
                Error.Invoke("Channel name is too long");
                return null;
            }

            return block;
        }
开发者ID:geekgame,项目名称:StreetEngine-Emulator,代码行数:29,代码来源:ChannelList.cs

示例2: 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


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