本文整理汇总了C#中PacketReader.ReadString方法的典型用法代码示例。如果您正苦于以下问题:C# PacketReader.ReadString方法的具体用法?C# PacketReader.ReadString怎么用?C# PacketReader.ReadString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketReader
的用法示例。
在下文中一共展示了PacketReader.ReadString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadPacket
public void ReadPacket(PacketReader reader)
{
RankList = new List<MemberInfo>();
var count = reader.ReadInt32();
for (int i = 0; i < count; i++)
{
var memberInfo = new MemberInfo();
memberInfo.Unknown1 = reader.ReadInt64();
memberInfo.Name = reader.ReadString();
memberInfo.Rank = reader.ReadInt32();
memberInfo.Trophies = reader.ReadInt32();
memberInfo.Unknown2 = reader.ReadInt32();
memberInfo.Level = reader.ReadInt32();
memberInfo.AttacksWon = reader.ReadInt32();
memberInfo.AttacksLost = reader.ReadInt32();
memberInfo.DefencesWon = reader.ReadInt32();
memberInfo.DefencesLost = reader.ReadInt32();
memberInfo.Unknown3 = reader.ReadInt32();
memberInfo.CountryCode = reader.ReadString();
memberInfo.Unknown4 = reader.ReadInt64();
memberInfo.Unknown5 = reader.ReadInt64();
if (reader.ReadBoolean())
{
memberInfo.Clan = new Clan();
memberInfo.Clan.ID = reader.ReadInt64();
memberInfo.Clan.Name = reader.ReadString();
memberInfo.Clan.Badge = reader.ReadInt32();
}
RankList.Add(memberInfo);
}
}
示例2: ReadPacket
public void ReadPacket(PacketReader reader)
{
Unknown1 = reader.ReadInt32();
var count = reader.ReadInt32();
Friends = new List<Friend>();
for (int i = 0; i < count; i++)
{
Friend friend = new Friend();
friend.UserID1 = reader.ReadInt64();
friend.UserID2 = reader.ReadInt64();
friend.Username = reader.ReadString();
friend.FacebookID = reader.ReadString();
friend.Unknown3 = reader.ReadString();
friend.Unknown4 = reader.ReadInt32();
friend.Level = reader.ReadInt32();
friend.Unknown6 = reader.ReadInt32();
friend.Trophies = reader.ReadInt32();
friend.HasClan = reader.ReadBoolean();
if (friend.HasClan)
{
friend.ClanID = reader.ReadInt64();
friend.ClanUnknown1 = reader.ReadInt32();
friend.ClanName = reader.ReadString();
friend.ClanRole = reader.ReadInt32();
friend.ClanLevel = reader.ReadInt32();
}
Friends.Add(friend);
}
}
示例3: ReadPacket
public void ReadPacket(PacketReader reader)
{
LeagueMemberList = new List<LeagueMember>();
SeasonEndsSeconds = reader.ReadInt32();
var count = reader.ReadInt32();
for (int i = 0; i < count; i++)
{
LeagueMember leagueMember = new LeagueMember();
leagueMember.UserID = reader.ReadInt64();
leagueMember.Username = reader.ReadString();
leagueMember.Rank = reader.ReadInt32();
leagueMember.Trophies = reader.ReadInt32();
leagueMember.LastRank = reader.ReadInt32();
leagueMember.Unknown3 = reader.ReadInt32();
leagueMember.AttacksWon = reader.ReadInt32();
leagueMember.Unknown5 = reader.ReadInt32();
leagueMember.DefensesWon = reader.ReadInt32();
leagueMember.Unknown7 = reader.ReadInt32();
leagueMember.Unknown8 = reader.ReadInt32();
leagueMember.Unknown9 = reader.ReadInt32();
leagueMember.Unknown10 = reader.ReadInt32();
leagueMember.Unknown11 = reader.ReadInt32();
leagueMember.HasClan = reader.ReadBoolean();
if (leagueMember.HasClan)
{
leagueMember.ClanID = reader.ReadInt64();
leagueMember.ClanName = reader.ReadString();
leagueMember.Unknown12 = reader.ReadInt32();
}
leagueMember.Unknown13 = reader.ReadInt32();
leagueMember.Unknown14 = reader.ReadInt32();
LeagueMemberList.Add(leagueMember);
}
}
示例4: ReadPacket
public void ReadPacket(PacketReader reader)
{
MessageType = reader.ReadInt32();
Unknown1 = reader.ReadInt32();
ServerTick = reader.ReadUInt32();
Unknown2 = (byte)reader.ReadByte();
switch (MessageType) // not sure about this
{
case 1:
break;
case 2:
UserID = reader.ReadInt64();
UserID2 = reader.ReadInt64();
Username = reader.ReadString();
Unknown3 = reader.ReadInt32();
Unknown4 = reader.ReadInt32();
MemberStatus = (MemberStatusId)reader.ReadInt32();
MessageTime = TimeSpan.FromSeconds(reader.ReadInt32());
Message = reader.ReadString();
break;
default:
break;
}
}
示例5: ReadPacket
public void ReadPacket(PacketReader reader)
{
SearchString = reader.ReadString();
ClansSearchInfo = new ClanSearchInfo[reader.ReadInt32()];
for (int i = 0; i < ClansSearchInfo.Length; i++)
{
ClanSearchInfo info = new ClanSearchInfo();
info.ID = reader.ReadInt64();
info.Name = reader.ReadString();
info.Unknown1 = reader.ReadInt32();
info.Type = reader.ReadInt32();
info.MemberCount = reader.ReadInt32();
info.Trophies = reader.ReadInt32();
info.Unknown2 = reader.ReadInt32();
info.WarsWon = reader.ReadInt32();
info.WarsLost = reader.ReadInt32();
info.WarsDraw = reader.ReadInt32();
info.Badge = reader.ReadInt32();
info.Unknown3 = reader.ReadInt32();
info.Unknown4 = reader.ReadInt32();
info.EP = reader.ReadInt32();
info.Level = reader.ReadInt32();
ClansSearchInfo[i] = info;
}
}
示例6: Read
public override void Read(PacketReader r)
{
Tier = r.ReadInt32();
Goal = r.ReadString();
Description = r.ReadString();
Image = r.ReadString();
}
示例7: Read
public override void Read(PacketReader r)
{
AccountId = r.ReadString();
CharId = r.ReadInt32();
KilledBy = r.ReadString();
ZombieType = r.ReadInt32();
ZombieId = r.ReadInt32();
}
示例8: Read
public override void Read(PacketReader r)
{
AccountId = r.ReadString();
CharId = r.ReadInt32();
Killer = r.ReadString();
obf0 = r.ReadInt32();
obf1 = r.ReadInt32();
}
示例9: Read
public override void Read(PacketReader r)
{
Name = r.ReadString();
ObjectId = r.ReadInt32();
NumStars = r.ReadInt32();
BubbleTime = r.ReadByte();
Recipient = r.ReadString();
Text = r.ReadString();
CleanText = r.ReadString();
}
示例10: HInfo
/// <summary>
/// Creates a new <see cref="HInfo"/> sub-packet.
/// </summary>
/// <param name="reader">A <see cref="PacketReader"/> contaning the packet object.</param>
public HInfo(PacketReader reader) {
if (reader == null) {
throw new ArgumentNullException("reader");
}
HName = reader.ReadString(32);
Track = reader.ReadString(6);
Flags = (HostFlags)reader.ReadByte();
NumConns = reader.ReadByte();
}
示例11: IS_CPR
/// <summary>
/// Creates a new connection player rename packet.
/// </summary>
/// <param name="buffer">A buffer contaning the packet data.</param>
public IS_CPR(byte[] buffer)
: this() {
PacketReader reader = new PacketReader(buffer);
Size = reader.ReadByte();
Type = (PacketType)reader.ReadByte();
ReqI = reader.ReadByte();
UCID = reader.ReadByte();
PName = reader.ReadString(24);
Plate = reader.ReadString(8);
}
示例12: ReadPacket
public void ReadPacket(PacketReader reader)
{
ClanID = reader.ReadInt64();
ClanName = reader.ReadString();
Unknown1 = reader.ReadInt32();
Unknown2 = reader.ReadInt32();
MembersCount = reader.ReadInt32();
TotalPoints = reader.ReadInt32();
RequiedTrophies = reader.ReadInt32();
WarsWon = reader.ReadInt32();
Unknown3 = reader.ReadInt32();
Unknown4 = reader.ReadInt32();
Unknown5 = reader.ReadInt32();
Unknown6 = reader.ReadInt32();
Unknown7 = reader.ReadInt32();
ClanPerksPoints = reader.ReadInt32();
Level = reader.ReadInt32();
Description = reader.ReadString();
Unknown8 = reader.ReadInt32();
Unknown9 = reader.ReadInt32();
LegacyMembersCount = reader.ReadByte();
// It appears this is some legacy data, only some clans don't have this data.
// It seemed to trend towards old clans, newer clans didn't have an issue.
if (LegacyMembersCount != MembersCount)
{
Unknown10 = reader.ReadInt32();
Unknown11 = reader.ReadInt32();
}
Members = new List<AllianceMemberInfo>();
for (int i = 0; i < MembersCount; i++)
{
var allianceMember = new AllianceMemberInfo();
allianceMember.UserID = reader.ReadInt64();
allianceMember.Name = reader.ReadString();
allianceMember.Role = reader.ReadInt32();
allianceMember.Level = reader.ReadInt32();
allianceMember.League = reader.ReadInt32();
allianceMember.Trophies = reader.ReadInt32();
allianceMember.TroopsDonated = reader.ReadInt32();
allianceMember.TroopsReceived = reader.ReadInt32();
allianceMember.Rank = reader.ReadInt32();
allianceMember.PreviousRank = reader.ReadInt32();
allianceMember.NewMember = reader.ReadByte();
allianceMember.Unknown1 = reader.ReadByte();
allianceMember.Unknown2 = reader.ReadInt32();
allianceMember.Unknown3 = reader.ReadInt32();
allianceMember.Unknown4 = reader.ReadInt32();
allianceMember.Unknown5 = reader.ReadInt32();
Members.Add(allianceMember);
}
}
示例13: OnLoginRequest
public void OnLoginRequest(ref PacketReader _pReader, PacketType pt, ref ClientManager _client)
{
//[int('protoVersion'),
//str16('username'),
//long(/*seed*/),
//int(/*mode*/),
//byte(/*world*/),
//byte(),
//ubyte(/*height*/),
//ubyte(/*maxPlayers*/)]
int version = _pReader.ReadInt();
string username = _pReader.ReadString();
string empty_string = _pReader.ReadString();
_pReader.ReadInt();
_pReader.ReadInt();
_pReader.ReadByte();
_pReader.ReadByte();
_pReader.ReadByte();
/*
Protocol Version int 20 1.2.5's protocol version is 29
Username string TkTech The name of the user attempting to login, max length of 16
Not used string (empty string)
Not used int 0
Not used int 0
Not used byte 0
Not used unsigned byte 0
Not used unsigned byte 0
*/
#region Login Handler Packet
LoginHandlerPacket p = new LoginHandlerPacket(pt);
p.EntityID = _client.id;
p.NotUsed = "";
p.LevelType = (string)Config.Configuration["LevelType"];
p.ServerMode = (int)Config.Configuration["ServerMode"];
p.Dimension = 0;
p.Difficulty = 1;
p.WorldHeight = 0;
p.MaxPlayers = (byte)(int)Config.Configuration["MaxPlayers"];
p.BuildPacket();
_client.SendPacket(p, _client.id, ref _client, false, false);
try
{
int i = 0;
for (; i < base.ModuleAddons.Count; i++)
{
base.ModuleAddons.ElementAt(i).Value(pt, ModuleAddons.ElementAt(i).Key, ref _pReader, (PacketHandler)p, ref _client);
}
}
catch (Exception e)
{
Console.WriteLine("ERROR: " + e.Message + " Source:" + e.Source + " Method:" + e.TargetSite + " Data:" + e.Data);
}
#endregion Login Handler Packet
}
示例14: ReadPacket
public void ReadPacket(PacketReader reader)
{
UserID = reader.ReadInt64();
UserID1 = reader.ReadInt64();
UserToken = reader.ReadString();
FacebookID = reader.ReadString();
GameCenterID = reader.ReadString();
MajorVersion = reader.ReadInt32();
MinorVersion = reader.ReadInt32();
RevisionVersion = reader.ReadInt32();
ServerEnvironment = reader.ReadString();
LoginCount = reader.ReadInt32();
PlayTime = TimeSpan.FromSeconds(reader.ReadInt32());
Unknown1 = reader.ReadInt32();
FacebookAppID = reader.ReadString();
DateLastPlayed = DateTimeConverter.FromJavaTimestamp(double.Parse(reader.ReadString()));
DateJoined = DateTimeConverter.FromJavaTimestamp(double.Parse(reader.ReadString()));
Unknown2 = reader.ReadInt32();
GooglePlusID = reader.ReadString();
CountryCode = reader.ReadString();
}
示例15: 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();
}