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


C# Network.Write方法代码示例

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


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

示例1: OnSend

        /// <summary>
        /// Sends the specified writer.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="version">The version.</param>
        /// <remarks></remarks>
        protected override void OnSend(Network.BigEndianStream writer, int version)
        {
            if (writer == null)
                throw new ArgumentNullException("writer");
            writer.Write(Code);

            writer.Write(PlayerID);
        }
开发者ID:splitice,项目名称:Pdelvo.Minecraft,代码行数:14,代码来源:DespawnPlayer.cs

示例2: OnSend

        /// <summary>
        /// Sends the specified writer.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="version">The version.</param>
        /// <remarks></remarks>
        protected override void OnSend(Network.BigEndianStream writer, int version)
        {
            if (writer == null)
                throw new ArgumentNullException("writer");
            writer.Write(Code);

            writer.Write(MessageColor);
            writer.WriteClassicString(TextMessage);
        }
开发者ID:splitice,项目名称:Pdelvo.Minecraft,代码行数:15,代码来源:Message.cs

示例3: OnSend

        /// <summary>
        /// Sends the specified writer.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="version">The version.</param>
        /// <remarks></remarks>
        protected override void OnSend(Network.BigEndianStream writer, int version)
        {
            if (writer == null)
                throw new ArgumentNullException("writer");
            writer.Write(Code);

            writer.Write(ProtocolVersion);
            writer.WriteClassicString(Servername);
            writer.WriteClassicString(ServerMotD);
            writer.Write(Usertype);
        }
开发者ID:splitice,项目名称:Pdelvo.Minecraft,代码行数:17,代码来源:ServerIdentification.cs

示例4: OnSend

        /// <summary>
        /// Sends the specified writer.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="version">The version.</param>
        /// <remarks></remarks>
        protected override void OnSend(Network.BigEndianStream writer, int version)
        {
            if (writer == null)
                throw new ArgumentNullException("writer");
            writer.Write(Code);

            var data = ChunkData.ToArray();

            writer.Write((short)data.Length);
            writer.Write(data);
            writer.Write(PercentComplete);
        }
开发者ID:splitice,项目名称:Pdelvo.Minecraft,代码行数:18,代码来源:LevelDataChunk.cs

示例5: OnSend

        /// <summary>
        /// Sends the specified writer.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="version">The version.</param>
        /// <remarks></remarks>
        protected override void OnSend(Network.BigEndianStream writer, int version)
        {
            if (writer == null)
                throw new ArgumentNullException("writer");
            writer.Write(Code);

            writer.Write(PlayerID);
            writer.WriteClassicString(PlayerName);
            writer.Write(PositionX);
            writer.Write(PositionY);
            writer.Write(PositionZ);
            writer.Write(Yaw);
            writer.Write(Pitch);
        }
开发者ID:splitice,项目名称:Pdelvo.Minecraft,代码行数:20,代码来源:SpawnPlayer.cs

示例6: OnSend

 /// <summary>
 /// Sends the specified writer.
 /// </summary>
 /// <param name="writer">The writer.</param>
 /// <param name="version">The version.</param>
 /// <remarks></remarks>
 protected override void OnSend(Network.BigEndianStream writer, int version)
 {
     if (writer == null)
         throw new ArgumentNullException("writer");
     writer.Write(Code);
     writer.Write(PositionX);
     writer.Write(PositionY);
     writer.Write(PositionZ);
     writer.Write(Mode);
     writer.Write(BlockType);
 }
开发者ID:splitice,项目名称:Pdelvo.Minecraft,代码行数:17,代码来源:SetBlock.cs

示例7: Write

 public void Write(Network.NetOutgoingMessage nom, object Value)
 {
     nom.Write((Single)Value);
 }
开发者ID:CloneDeath,项目名称:Xanatos,代码行数:4,代码来源:SingleSerializer.cs

示例8: Write

 public void Write(Network.NetOutgoingMessage nom, object Value)
 {
     byte[] val = Value as Byte[];
     nom.Write((Int32)val.Length);
     nom.Write((Byte[])val);
 }
开发者ID:CloneDeath,项目名称:Xanatos,代码行数:6,代码来源:ByteArraySerializer.cs

示例9: Write

 public void Write(Network.NetOutgoingMessage nom, object Value)
 {
     nom.Write((IPEndPoint)Value);
 }
开发者ID:CloneDeath,项目名称:Xanatos,代码行数:4,代码来源:IPEndPointSerializer.cs

示例10: ToStream

		public int ToStream(Network.PacketWriter Writer) {
			int pos = (int)Writer.BaseStream.Position;
			Writer.Write((uint)WorldID.ID);
			Writer.Write((int)Status.ExpBase);
			Writer.Write((int)Status.Zeny);
			Writer.Write((int)Status.ExpJob); // jobExp
			Writer.Write((int)Status.LevelJob); // jobLevel

			Writer.Write((int)0); // probably opt1
			Writer.Write((int)0); // probably opt2
			Writer.Write((int)Status.Option); // option
			Writer.Write((int)Status.Karma); // karma
			Writer.Write((int)Status.Manner); // manner
			Writer.Write((short)Status.StatusPoints); // statuspoints

			// if PACKETVER > 20081217
			Writer.Write((int)Status.HP);
			Writer.Write((int)Status.HPMax);
			// else
			// hp & maxHP => short!
			// endif
			Writer.Write((short)Status.SP); // sp
			Writer.Write((short)Status.SPMax); // maxSP
			Writer.Write((short)Global.DEFAULT_WALK_SPEED); // DEFAULT_WALK_SPEED
			Writer.Write((short)Status.Class); // class
			Writer.Write((short)Status.HairStyle); // hairStyle
			short opt = (short)((Status.Option & EStatusOption.Riding) > 0 ? Status.Weapon : 0);
			Writer.Write((short)opt); // When the weapon is sent and your option is riding, the client crashes on login!?
			Writer.Write((short)Status.LevelBase); // baseLevel
			Writer.Write((short)Status.SkillPoints); // skillpoints
			Writer.Write((short)Status.HeadBottom); // headBottom
			Writer.Write((short)Status.Shield); // shield
			Writer.Write((short)Status.HeadTop); // headTop
			Writer.Write((short)Status.HeadMid); // headMid
			Writer.Write((short)Status.HairColor); // hairColor
			Writer.Write((short)Status.ClothColor); // clothColor
			Writer.Write(Status.Name, 24); // name
			Writer.Write((byte)Status.Str); // str
			Writer.Write((byte)Status.Agi); // agi
			Writer.Write((byte)Status.Vit); // vit
			Writer.Write((byte)Status.Int); // int
			Writer.Write((byte)Status.Dex); // dex
			Writer.Write((byte)Status.Luk); // luk
			Writer.Write((short)Status.Slot); // slot

			// if PACKETVER >= 20061023
			Writer.Write((short)Status.Rename); // rename
			// endif
			// if (PACKETVER >= 20100720 && PACKETVER <= 20100727) || PACKETVER >= 20100803
			//mapindex_getmapname_ext(mapindex_id2name(p->last_point.map), (char*)WBUFP(buf, 108));
			//offset += MAP_NAME_LENGTH_EXT;
			// endif

			// if PACKETVER >= 20100803
			//WBUFL(buf, 124) = TOL(p->delete_date);
			//offset += 4;
			// endif

			int length = ((int)Writer.BaseStream.Position - pos);
			return length;
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:61,代码来源:Character.cs


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