本文整理汇总了C#中Reader.ReadString方法的典型用法代码示例。如果您正苦于以下问题:C# Reader.ReadString方法的具体用法?C# Reader.ReadString怎么用?C# Reader.ReadString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reader
的用法示例。
在下文中一共展示了Reader.ReadString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
}
示例2: 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);
AllyName = reader.ReadString(Encoding.Unicode);
}
示例3: 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);
}
示例4: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
reader.ReadInt32();
Sender = reader.ReadString(Encoding.Unicode);
Receiver = reader.ReadString(Encoding.Unicode);
Message = reader.ReadString(Encoding.Unicode);
}
示例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
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);
}
}
示例7: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
ObjectId = reader.ReadInt32();
MemberName = reader.ReadString(Encoding.Unicode);
}
示例8: 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);
}
示例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();
NpcId = reader.ReadInt32();
IsAttackable = reader.ReadInt32() != 0;
Position = new Library.Point(
reader.ReadInt32(),
reader.ReadInt32(),
reader.ReadInt32());
Heading = reader.ReadInt32();
reader.ReadInt32();
MAtkSpd = reader.ReadInt32();
PAtkSpd = reader.ReadInt32();
RunSpd = reader.ReadInt32();
WalkSpd = reader.ReadInt32();
SwimRunSpd = reader.ReadInt32();
SwimWalkSpd = reader.ReadInt32();
FlRunSpd = reader.ReadInt32();
FlWalkSpd = reader.ReadInt32();
FlyRunSpd = reader.ReadInt32();
FlyWalkSpd = reader.ReadInt32();
MoveSpdMult = reader.ReadDouble();
AtkSpdMult = reader.ReadDouble();
CollisionRadius = reader.ReadDouble();
CollisionHeight = reader.ReadDouble();
RightHand = reader.ReadInt32();
BothHand = reader.ReadInt32();
LeftHand = reader.ReadInt32();
IsShowName = reader.ReadByte() != 0;
IsRunning = reader.ReadByte() != 0;
IsInCombat = reader.ReadByte() != 0;
IsAlikeDead = reader.ReadByte() != 0;
IsSummoned = reader.ReadByte() != 0;
Name = reader.ReadString(Encoding.Unicode);
Title = reader.ReadString(Encoding.Unicode);
}
示例11: Parse
public override void Parse(byte[] buffer)
{
Reader reader = new Reader(new MemoryStream(buffer));
reader.ReadByte(); // Id
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();
}
示例12: Deserialise
public override void Deserialise(Reader Reader)
{
Username = Reader.ReadString();
ComputerName = Reader.ReadString();
}
示例13: Deserialise
protected override void Deserialise(Reader In)
{
// Deserialise base class then this class
base.Deserialise(In);
Title = In.ReadString();
Department = new Department() { Id = In.ReadInt32() };
Classes = Enumerable.Repeat(new Class(), In.ReadInt32()).ToList();
Classes.ForEach(c => c.Id = In.ReadInt32());
Email = In.ReadString();
Bookings = Enumerable.Repeat(new Booking(), In.ReadInt32()).ToList();
Bookings.ForEach(b => b.Id = In.ReadInt32());
}
示例14: ReadHeader
public PackageHeader ReadHeader(Reader reader)
{
PackageHeader header = new PackageHeader();
header.magic = reader.ReadBytes(0x04);
Array.Reverse(header.magic);
reader.Position = 0x07;
header.pkg_type = reader.ReadByte();
reader.Position = 0x08;
header.pkg_info_offset = reader.ReadUInt32();
reader.Position = 0x0C;
header.pkg_info_count = reader.ReadUInt32();
reader.Position = 0x10;
header.header_size = reader.ReadUInt32();
reader.Position = 0x14;
header.item_count = reader.ReadUInt32();
reader.Position = 0x18;
header.total_size = reader.ReadUInt64();
reader.Position = 0x20;
header.data_offset = reader.ReadUInt64();
reader.Position = 0x28;
header.data_size = reader.ReadUInt64();
reader.Position = 0x30;
header.contentid = reader.ReadString(0x24);
reader.Position = 0x60;
header.digest = reader.ReadBytes(0x10);
Array.Reverse(header.digest);
reader.Position = 0x70;
header.pkg_data_riv = reader.ReadBytes(0x10);
Array.Reverse(header.pkg_data_riv);
reader.Position = 0x80;
header.header_cmac_hash = reader.ReadBytes(0x10);
Array.Reverse(header.header_cmac_hash);
reader.Position = 0x90;
header.header_npdrm_signature = reader.ReadBytes(0x28);
Array.Reverse(header.header_npdrm_signature);
reader.Position = 0xB8;
header.header_sha1_hash = reader.ReadBytes(0x08);
Array.Reverse(header.header_sha1_hash);
return header;
}
示例15: ScanSlots
private void ScanSlots()
{
int[] offsets =
{
0xE35800,
0xE35830,
0xE35850
};
Slots = new List<Slot>();
using (var reader = new Reader(buffer, true))
{
var constructor = new StringBuilder();
for (int i = 0; i < 30; i++)
{
SetStatus("Scanning Slot#" + (i + 1).ToString(CultureInfo.InvariantCulture));
//Pre-scan for name entries to map 'empty' slots. This accomodates foreign languages.
reader.Position = 0xE35850 + (128 * i);
if (reader.ReadInt8() == 0) continue;
constructor.Append("Slot#" + (i + 1));
//Get Locale, Time & Name
for (int o = 0; o < 3; o++)
{
constructor.Append(", ");
reader.Position = offsets[o] + (128 * i);
constructor.Append(reader.ReadString(StringType.Ascii, 16).Replace("\0", ""));
// .Trim(Convert.ToChar("\0")));
}
////Build List
//SaveSlot.Items.Add(constructor.ToString());
Slots.Add(new Slot
{
SlotString = constructor.ToString(),
StartingOffset = 0x44 + (0x79400 * (i + 1)),
SlotID = i
});
constructor.Clear();
}
//TODO Add flag for failed load, reset editor state.
if (Slots.Count == 0)
{
//If no slots are used, editing is pointless since there's nothing to work with.
MessageBox.Show(
"This save appears to be empty!\nIf this save does contain a used slot, an error has occurred.\nEither way, aborting load operation.",
"Error!", MessageBoxButton.OK,
MessageBoxImage.Exclamation);
return;
}
//Load first valid slot
SaveSlot.Items.Clear();
foreach (Slot slot in Slots)
{
var item = new ComboBoxItem { Tag = slot.SlotID, Content = slot.SlotString };
SaveSlot.Items.Add(item);
}
SaveSlot.Items.Refresh();
SaveSlot.SelectedIndex = 0;
SaveSlot.SelectionChanged += SetIndex;
LoadSlot();
}
}