本文整理汇总了C#中Reader.ReadInt32方法的典型用法代码示例。如果您正苦于以下问题:C# Reader.ReadInt32方法的具体用法?C# Reader.ReadInt32怎么用?C# Reader.ReadInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reader
的用法示例。
在下文中一共展示了Reader.ReadInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
SessionId = reader.ReadInt32();
Protocol = reader.ReadInt32();
EncKey = reader.ReadBytes(128);
//got the encoded key in enckey
// step 4 : xor last 0x40 bytes with first 0x40 bytes
for (int i = 0; i < 0x40; i++)
EncKey[0x40 + i] = (byte)(EncKey[0x40 + i] ^ EncKey[i]);
// step 3 : xor bytes 0x0d-0x10 with bytes 0x34-0x38
for (int i = 0; i < 4; i++)
EncKey[0x0d + i] = (byte)(EncKey[0x0d + i] ^ EncKey[0x34 + i]);
// step 2 : xor first 0x40 bytes with last 0x40 bytes
for (int i = 0; i < 0x40; i++)
EncKey[i] = (byte)(EncKey[i] ^ EncKey[0x40 + i]);
// step 1 : 0x4d-0x50 <-> 0x00-0x04
for (int i = 0; i < 4; i++)
{
byte temp = EncKey[i];
EncKey[i] = EncKey[0x4d + i];
EncKey[0x4d + i] = temp;
}
}
示例2: Deserialise
public void Deserialise(Reader In)
{
Bookings = new List<Booking>(In.ReadInt32());
for (int x = 0; x < Bookings.Capacity; x++)
Bookings.Add(DataModel.DeserialiseExternal<Booking>(In));
Departments = new List<Department>(In.ReadInt32());
for (int x = 0; x < Departments.Capacity; x++)
Departments.Add(DataModel.DeserialiseExternal<Department>(In));
Periods = new List<TimeSlot>(In.ReadInt32());
for (int x = 0; x < Periods.Capacity; x++)
Periods.Add(DataModel.DeserialiseExternal<TimeSlot>(In));
Rooms = new List<Room>(In.ReadInt32());
for (int x = 0; x < Rooms.Capacity; x++)
Rooms.Add(DataModel.DeserialiseExternal<Room>(In));
Users = new List<User>(In.ReadInt32());
for (int x = 0; x < Users.Capacity; x++)
Users.Add(DataModel.DeserialiseExternal<User>(In));
Subjects = new List<Subject>(In.ReadInt32());
for (int x = 0; x < Subjects.Capacity; x++)
Subjects.Add(DataModel.DeserialiseExternal<Subject>(In));
Classes = new List<Class>(In.ReadInt32());
for (int x = 0; x < Classes.Capacity; x++)
Classes.Add(DataModel.DeserialiseExternal<Class>(In));
}
示例3: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
ObjectId = reader.ReadInt32();
reader.ReadInt32();
}
示例4: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
ObjectId = reader.ReadInt32();
Action = (Lineage.SocialAction)reader.ReadInt32();
}
示例5: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
CrestId = reader.ReadInt32();
Content = reader.ReadBytes(reader.ReadInt32());
}
示例6: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
ObjectId = reader.ReadInt32();
Type = (Lineage.Channel)reader.ReadInt32();
Author = reader.ReadString(Encoding.Unicode);
Message = reader.ReadString(Encoding.Unicode);
}
示例7: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
ObjectId = reader.ReadInt32();
Position = new Library.Point(
reader.ReadInt32(),
reader.ReadInt32(),
reader.ReadInt32()
);
}
示例8: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
ObjectId = reader.ReadInt32();
Attributes = new KeyValuePair<Int32, Int32>[reader.ReadInt32()];
for (int i = 0; i < Attributes.Length; i++)
Attributes[i] = new KeyValuePair<Int32, Int32>(
reader.ReadInt32(),
reader.ReadInt32()
);
}
示例9: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
MessageId = reader.ReadInt32();
int count = reader.ReadInt32();
Arguments = new KeyValuePair<type, object>[count];
for (int i = 0; i < count; i++)
{
var key = (type)reader.ReadInt32();
object value = null;
switch (key)
{
case type.Text:
value = reader.ReadString(Encoding.Unicode);
break;
case type.Number:
value = reader.ReadInt32();
break;
case type.NpcName:
value = reader.ReadInt32();
break;
case type.ItemName:
value = reader.ReadInt32();
break;
case type.SkillName:
value = reader.ReadInt32();
reader.ReadInt32(); //there are 4 more bytes after this... the skill level by chance?
break;
}
Arguments[i] = new KeyValuePair<type, object>(key, value);
}
}
示例10: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
AttackerId = reader.ReadInt32();
Hit hit = new Hit()
{
TargetId = reader.ReadInt32(),
Damage = reader.ReadInt32(),
Flags = reader.ReadByte()
};
Position = new Library.Point(
reader.ReadInt32(),
reader.ReadInt32(),
reader.ReadInt32()
);
int count = reader.ReadInt16();
Hits = new Hit[count + 1];
Hits[0] = hit;
for (int i = 1; i < Hits.Length; i++)
Hits[i] = new Hit()
{
TargetId = reader.ReadInt32(),
Damage = reader.ReadInt32(),
Flags = reader.ReadByte()
};
}
示例11: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
int Count = reader.ReadInt32();
List = new List<SkillItem>(Count);
for (int i = 0; i < Count; i++)
List.Add(new SkillItem()
{
Active = !(reader.ReadInt32() != 0),
Level = reader.ReadInt32(),
Id = reader.ReadInt32()
});
}
示例12: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
int Count = reader.ReadByte();
reader.ReadByte(); // ?
List = new List<Model.GameServer>(Count);
for (int i = 0; i < Count; i++)
List.Add(new Model.GameServer()
{
Id = reader.ReadByte(),
Address = string.Format("{0}.{1}.{2}.{3}", // ToDo: replace to native
reader.ReadByte().ToString(),
reader.ReadByte().ToString(),
reader.ReadByte().ToString(),
reader.ReadByte().ToString()),
Port = reader.ReadInt32(),
Age = reader.ReadByte(),
PvP = reader.ReadByte() != 0,
Online = reader.ReadInt16(),
Maximum = reader.ReadInt16(),
State = reader.ReadByte() != 0,
Poop = string.Format("{0}-{1}-{2}-{3}-{4}", // ToDo: What is?
reader.ReadByte().ToString("X2"),
reader.ReadByte().ToString("X2"),
reader.ReadByte().ToString("X2"),
reader.ReadByte().ToString("X2"),
reader.ReadByte().ToString("X2"))
});
}
示例13: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
LeaderName = reader.ReadString(Encoding.Unicode);
PartyLoot = (Lineage.PartyLoot)reader.ReadInt32();
}
示例14: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
Members = new Member[reader.ReadInt32()];
for (int i = 0; i < Members.Length; i++)
Members[i] = new Member()
{
ObjectId = reader.ReadInt32(),
Position = new Library.Point(
reader.ReadInt32(),
reader.ReadInt32(),
reader.ReadInt32()
)
};
}
示例15: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
MessageId = reader.ReadInt32();
Content = reader.ReadString(Encoding.Unicode);
}