本文整理汇总了C#中PacketReader.Skip方法的典型用法代码示例。如果您正苦于以下问题:C# PacketReader.Skip方法的具体用法?C# PacketReader.Skip怎么用?C# PacketReader.Skip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketReader
的用法示例。
在下文中一共展示了PacketReader.Skip方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IS_ISM
/// <summary>
/// Creates a new InSim multiplayer packet.
/// </summary>
/// <param name="buffer">A buffer contaning the packet data.</param>
public IS_ISM(byte[] buffer)
: this() {
PacketReader reader = new PacketReader(buffer);
Size = reader.ReadByte();
Type = (PacketType)reader.ReadByte();
ReqI = reader.ReadByte();
reader.Skip(1);
Host = (HostType)reader.ReadByte();
reader.Skip(3);
HName = reader.ReadString(32);
}
示例2: IS_III
/// <summary>
/// Creates a new InSim info packet.
/// </summary>
/// <param name="buffer">A buffer contaning the packet data.</param>
public IS_III(byte[] buffer)
: this() {
PacketReader reader = new PacketReader(buffer);
Size = reader.ReadByte();
Type = (PacketType)reader.ReadByte();
ReqI = reader.ReadByte();
reader.Skip(1);
UCID = reader.ReadByte();
PLID = reader.ReadByte();
reader.Skip(2);
Msg = reader.ReadString(64);
}
示例3: IS_ACR
/// <summary>
/// Creates a new <see cref="IS_ACR"/> object.
/// </summary>
/// <param name="buffer">The packet data.</param>
public IS_ACR(byte[] buffer) {
PacketReader reader = new PacketReader(buffer);
Size = reader.ReadByte();
Type = (PacketType)reader.ReadByte();
ReqI = reader.ReadByte();
reader.Skip(1);
UCID = reader.ReadByte();
Admin = reader.ReadBoolean();
Result = (AdminResult)reader.ReadByte();
reader.Skip(1);
Text = reader.ReadString(64);
}
示例4: IS_FIN
/// <summary>
/// Creates a new finished race notification packet.
/// </summary>
/// <param name="buffer">A buffer contaning the packet data.</param>
public IS_FIN(byte[] buffer)
: this() {
PacketReader reader = new PacketReader(buffer);
Size = reader.ReadByte();
Type = (PacketType)reader.ReadByte();
ReqI = reader.ReadByte();
PLID = reader.ReadByte();
TTime = TimeSpan.FromMilliseconds(reader.ReadUInt32());
BTime = TimeSpan.FromMilliseconds(reader.ReadUInt32());
reader.Skip(1);
NumStops = reader.ReadByte();
Confirm = (ConfirmationFlags)reader.ReadByte();
reader.Skip(1);
LapsDone = reader.ReadUInt16();
Flags = (PlayerFlags)reader.ReadUInt16();
}
示例5: UnicodeSpeechRequest
public UnicodeSpeechRequest(byte[] data)
: base(data)
{
PacketReader reader = new PacketReader(data);
byte id = reader.ReadByte();
ushort blockSize = reader.ReadUInt16();
byte type = reader.ReadByte();
this.type = (byte)(type & 0x0F);
color = reader.ReadUInt16();
font = reader.ReadUInt16();
language = reader.ReadAnsiString(4);
if ((type & 0xC0) != 0)
{
int numKeywords = (Data[12] << 4) + (Data[13] >> 4);
reader.Skip(((numKeywords * 12 + 12) + 7) / 8);
text = reader.ReadAnsiString(Lenght - reader.Offset);
}
else
{
text = reader.ReadUnicodeString(Lenght - reader.Offset);
}
}
示例6: oPCode
public static void oPCode(Decode decode)
{
try
{
Systems sys = (Systems)decode.Packet;
sys.PacketInformation = decode;
PacketReader Reader = new PacketReader(sys.PacketInformation.buffer);
LogDebug.Show("Opcode: {0}", decode.opcode);
Opcode opc = (Opcode)decode.opcode;
switch (opc)
{
case Opcode._MSG_LOGIN:
{
string username_shift = Reader.String(32);
string password_md5 = Reader.String(32);
Reader.Skip(4);
string client_mac = Reader.String(32);
Reader.Skip(32);
uint unk3 = Reader.UInt32();
StringShift shift = new StringShift();
string username = shift.Parser(username_shift);
LogDebug.Show("username: {0}", username);
LogDebug.Show("password_md5: {0}", password_md5);
//LogDebug.Show("Mac: {0}", client_mac);
//LogDebug.Show("unk3: {0}", unk3);
int res = UserLogin(username, password_md5, client_mac);
if (res == 1)
{
sys.client.SendC(ServerListPacket(1));
}
else
{
sys.client.SendC(UserFail(0xF0));
}
}
break;
default:
LogConsole.Show("Default Opcode: {0:X} - {1}", decode.opcode, opc);
//LogDebug.HexDump(sys.PacketInformation.buffer, 16, true);
break;
}
}
catch (Exception)
{
}
}
示例7: IS_SSH
/// <summary>
/// Creates a new screenshot packet.
/// </summary>
/// <param name="buffer">A buffer contaning the packet data.</param>
public IS_SSH(byte[] buffer)
: this() {
PacketReader reader = new PacketReader(buffer);
Size = reader.ReadByte();
Type = (PacketType)reader.ReadByte();
ReqI = reader.ReadByte();
Error = (ScreenshotError)reader.ReadByte();
reader.Skip(4);
BMP = reader.ReadString(32);
}
示例8: IS_VTN
/// <summary>
/// Creates a new vote notify.
/// </summary>
/// <param name="buffer">A buffer contaning the packet data.</param>
public IS_VTN(byte[] buffer)
: this() {
PacketReader reader = new PacketReader(buffer);
Size = reader.ReadByte();
Type = (PacketType)reader.ReadByte();
ReqI = reader.ReadByte();
reader.Skip(1);
UCID = reader.ReadByte();
Action = (VoteAction)reader.ReadByte();
}
示例9: IS_NCI
/// <summary>
/// Creates a new IS_NCI class.
/// </summary>
/// <param name="buffer">The buffer containing the packet data.</param>
public IS_NCI(byte[] buffer):this() {
PacketReader reader = new PacketReader(buffer);
Size = reader.ReadByte();
Type = (PacketType)reader.ReadByte();
ReqI = reader.ReadByte();
UCID = reader.ReadByte();
Language = (LfsLanguage)reader.ReadByte();
reader.Skip(3);
UserID = reader.ReadUInt32();
IPAddress = new IPAddress(reader.ReadUInt32());
}
示例10: IS_HLV
/// <summary>
/// Creates a new <see cref="IS_HLV"/> object.
/// </summary>
/// <param name="buffer">The data to populate the packet with.</param>
public IS_HLV(byte[] buffer) {
PacketReader reader = new PacketReader(buffer);
Size = reader.ReadByte();
Type = (PacketType)reader.ReadByte();
ReqI = reader.ReadByte();
PLID = reader.ReadByte();
HLVC = (HlvcFlags)reader.ReadByte();
reader.Skip(1);
Time = TimeSpan.FromMilliseconds(reader.ReadUInt16() * 10);
C = new CarContOBJ(reader);
}
示例11: IS_PIT
/// <summary>
/// Creates a new pit stop packet.
/// </summary>
/// <param name="buffer">A buffer contaning the packet data.</param>
public IS_PIT(byte[] buffer)
: this() {
PacketReader reader = new PacketReader(buffer);
Size = reader.ReadByte();
Type = (PacketType)reader.ReadByte();
ReqI = reader.ReadByte();
PLID = reader.ReadByte();
LapsDone = reader.ReadUInt16();
Flags = (PlayerFlags)reader.ReadUInt16();
reader.Skip(1);
Penalty = (PenaltyValue)reader.ReadByte();
NumStops = reader.ReadByte();
reader.Skip(1);
Tyres = new Tyres(
(TyreCompound)reader.ReadByte(),
(TyreCompound)reader.ReadByte(),
(TyreCompound)reader.ReadByte(),
(TyreCompound)reader.ReadByte());
Work = (PitWorkFlags)reader.ReadUInt32();
}
示例12: IS_CON
/// <summary>
/// Creates a new instance of the <see cref="IS_CON"/> packet.
/// </summary>
/// <param name="buffer">A buffer containing the packet data.</param>
public IS_CON(byte[] buffer) {
PacketReader reader = new PacketReader(buffer);
Size = reader.ReadByte();
Type = (PacketType)reader.ReadByte();
ReqI = reader.ReadByte();
reader.Skip(1);
SpClose = reader.ReadUInt16();
Time = TimeSpan.FromMilliseconds(reader.ReadUInt16() * 10);
A = new CarContact(reader);
B = new CarContact(reader);
}
示例13: IS_VER
/// <summary>
/// Creates a new version packet.
/// </summary>
/// <param name="buffer">A buffer contaning the packet data.</param>
public IS_VER(byte[] buffer)
: this() {
PacketReader reader = new PacketReader(buffer);
Size = reader.ReadByte();
Type = (PacketType)reader.ReadByte();
ReqI = reader.ReadByte();
reader.Skip(1);
Version = reader.ReadString(8);
Product = reader.ReadString(6);
InSimVer = reader.ReadUInt16();
}
示例14: CarContOBJ
/// <summary>
/// Creates a new <see cref="CarContOBJ"/> object.
/// </summary>
/// <param name="reader">A <see cref="PacketReader"/> contaning the data.</param>
public CarContOBJ(PacketReader reader) {
if (reader == null) {
throw new ArgumentNullException("reader");
}
Direction = reader.ReadByte();
Heading = reader.ReadByte();
Speed = reader.ReadByte();
reader.Skip(1);
X = reader.ReadInt16();
Y = reader.ReadInt16();
}
示例15: IS_AXI
/// <summary>
/// Creates a new AutoX info packet.
/// </summary>
/// <param name="buffer">A buffer contaning the packet data.</param>
public IS_AXI(byte[] buffer)
: this() {
PacketReader reader = new PacketReader(buffer);
Size = reader.ReadByte();
Type = (PacketType)reader.ReadByte();
ReqI = reader.ReadByte();
reader.Skip(1);
AXStart = reader.ReadByte();
NumCP = reader.ReadByte();
NumO = reader.ReadUInt16();
LName = reader.ReadString(32);
}