本文整理汇总了C#中Reader.ReadByte方法的典型用法代码示例。如果您正苦于以下问题:C# Reader.ReadByte方法的具体用法?C# Reader.ReadByte怎么用?C# Reader.ReadByte使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reader
的用法示例。
在下文中一共展示了Reader.ReadByte方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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()
};
}
示例2: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
Reason = (ReasonType)reader.ReadByte();
}
示例3: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
reader.ReadByte(); // 1?
Key = reader.ReadBytes(8);
}
示例4: 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;
}
}
示例5: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
LeaderId = reader.ReadInt32();
Loot = (Lineage.PartyLoot)reader.ReadInt32();
Members = new Member[reader.ReadInt32()];
for(int i = 0; i < Members.Length; i++)
{
Members[i] = new Member()
{
ObjectId = reader.ReadInt32(),
Name = reader.ReadString(Encoding.Unicode),
Cp = reader.ReadInt32(),
MaxCp = reader.ReadInt32(),
Hp = reader.ReadInt32(),
MaxHp = reader.ReadInt32(),
Mp = reader.ReadInt32(),
MaxMp = reader.ReadInt32(),
Level = reader.ReadInt32(),
Class = reader.ReadInt32()
};
reader.ReadInt32();
reader.ReadInt32();
}
}
示例6: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
ClanId = reader.ReadInt32();
ClanName = reader.ReadString(Encoding.Unicode);
LeaderName = reader.ReadString(Encoding.Unicode);
ClanCrestId = reader.ReadInt32();
ClanLevel = reader.ReadInt32();
HasCastle = reader.ReadInt32() != 0;
HasClanhall = reader.ReadInt32() != 0;
reader.ReadInt32();
CharLevel = reader.ReadInt32();
reader.ReadInt32();
reader.ReadInt32();
AllyId = reader.ReadInt32();
AllyName = reader.ReadString(Encoding.Unicode);
AllyCrestId = reader.ReadInt32();
InWar = reader.ReadInt32() != 0;
int count = reader.ReadInt32();
Members = new ClanMember[count];
for (int i = 0; i < count; i++)
{
ClanMember Member = new ClanMember();
Member.Name = reader.ReadString(Encoding.Unicode);
Member.Level = reader.ReadInt32();
Member.ClassId = reader.ReadInt32();
reader.ReadInt32();
reader.ReadInt32();
Member.ObjectId = reader.ReadInt32();
Members[i] = Member;
}
}
示例7: 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);
}
}
示例8: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
ObjectId = reader.ReadInt32();
}
示例9: 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();
}
示例10: 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();
}
示例11: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
Reason = (reason)reader.ReadInt32();
Message = reader.ReadString(Encoding.Unicode);
}
示例12: 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);
}
示例13: 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());
}
示例14: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
ObjectId = reader.ReadInt32();
AllyName = reader.ReadString(Encoding.Unicode);
}
示例15: 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);
}