本文整理汇总了C#中PacketWriter.Skip方法的典型用法代码示例。如果您正苦于以下问题:C# PacketWriter.Skip方法的具体用法?C# PacketWriter.Skip怎么用?C# PacketWriter.Skip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketWriter
的用法示例。
在下文中一共展示了PacketWriter.Skip方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBuffer
/// <summary>
/// Gets the packet data.
/// </summary>
/// <returns>An array contaning the packet data.</returns>
public byte[] GetBuffer() {
PacketWriter writer = new PacketWriter(Size);
writer.Write(Size);
writer.Write((byte)Type);
writer.Write(ReqI);
writer.Skip(1);
writer.Write(UCID);
writer.Skip(3);
writer.Write((uint)Cars);
return writer.GetBuffer();
}
示例2: GetBuffer
/// <summary>
/// Returns the packet data as an array of bytes.
/// </summary>
/// <returns>The packet data.</returns>
public byte[] GetBuffer() {
PacketWriter writer = new PacketWriter(Size);
writer.Write(Size);
writer.Write((byte)Type);
writer.Write(ReqI);
writer.Skip(1);
writer.Write((ushort)UDPPort);
writer.Write((ushort)Flags);
writer.Skip(1);
writer.Write(Prefix);
writer.Write((ushort)Interval);
writer.Write(Admin, 16);
writer.Write(IName, 16);
return writer.GetBuffer();
}
示例3: GetBuffer
/// <summary>
/// Returns the packet data.
/// </summary>
/// <returns>The packet data.</returns>
public byte[] GetBuffer() {
PacketWriter writer = new PacketWriter(Size);
writer.Write(Size);
writer.Write((byte)Type);
writer.Write(ReqI);
writer.Skip(1);
writer.Write(Msg, 96);
return writer.GetBuffer();
}
示例4: GetBuffer
/// <summary>
/// Returns the packet data.
/// </summary>
/// <returns>The packet data.</returns>
public byte[] GetBuffer() {
PacketWriter writer = new PacketWriter(Size);
writer.Write(Size);
writer.Write((byte)Type);
writer.Write(ReqI);
writer.Write((byte)Error);
writer.Skip(4);
writer.Write(BMP, 32);
return writer.GetBuffer();
}
示例5: GetBuffer
/// <summary>
/// Returns the packet data.
/// </summary>
/// <returns>The packet data.</returns>
public byte[] GetBuffer() {
PacketWriter writer = new PacketWriter(Size);
writer.Write(Size);
writer.Write((byte)Type);
writer.Write(ReqI);
writer.Skip(1);
writer.Write((ushort)Flag);
writer.Write(OffOn);
return writer.GetBuffer();
}
示例6: GetBuffer
/// <summary>
/// Returns the packet data.
/// </summary>
/// <returns>The packet data.</returns>
public byte[] GetBuffer() {
PacketWriter writer = new PacketWriter(Size);
writer.Write(Size);
writer.Write((byte)Type);
writer.Write(ReqI);
writer.Skip(1);
writer.Write(ViewPLID);
writer.Write((byte)InGameCam);
return writer.GetBuffer();
}
示例7: GetBuffer
/// <summary>
/// Returns the packet data.
/// </summary>
/// <returns>The packet data.</returns>
public byte[] GetBuffer() {
PacketWriter writer = new PacketWriter(Size);
writer.Write((byte)Size);
writer.Write((byte)Type);
writer.Write((byte)ReqI);
writer.Skip(1);
writer.Write(HName, 32);
writer.Write(Admin, 16);
writer.Write(Spec, 16);
return writer.GetBuffer();
}
示例8: GetBuffer
/// <summary>
/// Returns the packet data.
/// </summary>
/// <returns>The packet data.</returns>
public byte[] GetBuffer() {
PacketWriter writer = new PacketWriter(Size);
writer.Write(Size);
writer.Write((byte)Type);
writer.Write(ReqI);
writer.Skip(1);
writer.Write(Bits16);
writer.Write(RR);
writer.Write(Width);
writer.Write(Height);
return writer.GetBuffer();
}
示例9: GetBuffer
/// <summary>
/// Gets the packet buffer.
/// </summary>
/// <returns>An array containing the packet data.</returns>
public byte[] GetBuffer() {
PacketWriter writer = new PacketWriter(Size);
writer.Write(Size);
writer.Write((byte)Type);
writer.Write(ReqI);
writer.Skip(1);
foreach (CarHCP info in Info) {
info.GetBuffer(writer);
}
return writer.GetBuffer();
}
示例10: GetBuffer
/// <summary>
/// Returns the packet data.
/// </summary>
/// <returns>The packet data.</returns>
public byte[] GetBuffer() {
// Encode string first so we can figure out the packet size.
byte[] buffer = new byte[128];
int length = LfsEncoding.GetBytes(Msg, buffer, 0, 128);
// Get the packet size (MTC needs trailing zero).
Size = (byte)(8 + Math.Min(length + (4 - (length % 4)), 128));
PacketWriter writer = new PacketWriter(Size);
writer.Write((byte)Size);
writer.Write((byte)Type);
writer.Write(ReqI);
writer.Write((byte)Sound);
writer.Write(UCID);
writer.Write(PLID);
writer.Skip(2);
writer.Write(buffer, length);
return writer.GetBuffer();
}
示例11: GetBuffer
/// <summary>
/// Returns the packet data.
/// </summary>
/// <returns>The packet data.</returns>
public byte[] GetBuffer() {
PacketWriter writer = new PacketWriter(Size);
writer.Write(Size);
writer.Write((byte)Type);
writer.Write(ReqI);
writer.Skip(1);
writer.Write(Pos.X);
writer.Write(Pos.Y);
writer.Write(Pos.Z);
writer.Write((ushort)H);
writer.Write((ushort)P);
writer.Write((ushort)R);
writer.Write(ViewPLID);
writer.Write((byte)InGameCam);
writer.Write(FOV);
writer.Write((ushort)Time.TotalMilliseconds);
writer.Write((ushort)Flags);
return writer.GetBuffer();
}
示例12: GetBuffer
/// <summary>
/// Gets the packet data.
/// </summary>
/// <returns>An array containing the packet data.</returns>
public byte[] GetBuffer() {
if (Info.Count > 30) {
throw new InvalidOperationException(StringResources.IsAxmInfoErrorMessage);
}
Size = (byte)(8 + (Info.Count * 8));
PacketWriter writer = new PacketWriter(Size);
writer.Write(Size);
writer.Write((byte)Type);
writer.Write(ReqI);
writer.Write((byte)Info.Count);
writer.Write(UCID);
writer.Write((byte)PMOAction);
writer.Write(PMOFlags);
writer.Skip(1);
foreach (ObjectInfo info in Info) {
info.GetBuffer(writer);
}
return writer.GetBuffer();
}
示例13: GetBuffer
/// <summary>
/// Gets the packet data.
/// </summary>
/// <returns>The packet data.</returns>
public byte[] GetBuffer() {
PacketWriter writer = new PacketWriter(Size);
writer.Write(Size);
writer.Write((byte)Type);
writer.Write(ReqI);
writer.Write((byte)Error);
writer.Write((byte)MPR);
writer.Write(Paused);
writer.Write((byte)Options);
writer.Skip(1);
// Convert back to hundredths.
writer.Write((uint)CTime.TotalMilliseconds / 10);
writer.Write((uint)TTime.TotalMilliseconds / 10);
writer.Write(RName, 64);
return writer.GetBuffer();
}