本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例7: Write
public void Write(Network.NetOutgoingMessage nom, object Value)
{
nom.Write((Single)Value);
}
示例8: Write
public void Write(Network.NetOutgoingMessage nom, object Value)
{
byte[] val = Value as Byte[];
nom.Write((Int32)val.Length);
nom.Write((Byte[])val);
}
示例9: Write
public void Write(Network.NetOutgoingMessage nom, object Value)
{
nom.Write((IPEndPoint)Value);
}
示例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;
}