本文整理汇总了C#中RealmPacketIn.ReadBytes方法的典型用法代码示例。如果您正苦于以下问题:C# RealmPacketIn.ReadBytes方法的具体用法?C# RealmPacketIn.ReadBytes怎么用?C# RealmPacketIn.ReadBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RealmPacketIn
的用法示例。
在下文中一共展示了RealmPacketIn.ReadBytes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleUpdateAccountData
public static void HandleUpdateAccountData(IRealmClient client, RealmPacketIn packet)
{
if (client.Account == null)
{
return;
}
var type = packet.ReadUInt32();
var time = packet.ReadUInt32();
var compressedSize = packet.ReadUInt32();
/*if (compressedSize > 65535)
{
s_log.Warn("{0} sent a too large data update: " + compressedSize, client.Account);
client.Disconnect();
return;
}*/
client.Account.AccountData.SetAccountData(type, time, packet.ReadBytes(packet.RemainingLength), compressedSize);
}
示例2: AuthSessionRequest
public static void AuthSessionRequest(IRealmClient client, RealmPacketIn packet)
{
if (client.ActiveCharacter != null || client.Account != null)
{
// Already logged in
SendAuthSessionErrorReply(client, LoginErrorCode.AUTH_ALREADY_ONLINE);
client.Disconnect();
}
else if (!client.IsEncrypted)
{
var builtNumberClient = packet.ReadUInt32();
var new302 = packet.ReadUInt32(); // NEW 0.0.2.8970
var accName = packet.ReadCString();
var unk322 = packet.ReadUInt32();
client.ClientSeed = packet.ReadUInt32();
var unk1 = packet.ReadUInt32(); // 3.3.5a
var unk2 = packet.ReadUInt32(); // 3.3.5a
var unk3 = packet.ReadUInt32(); // 3.3.5a
var unk4 = packet.ReadUInt64();
client.ClientDigest = packet.ReadBigInteger(20);
#if DEBUG
log.Debug("builtNumberClient:{0} new302:{1} accName:{2} unk322:{3} client.ClientSeed:{4} unk4:{5} ClientDigest:{6}",
builtNumberClient,
new302, accName, unk322, client.ClientSeed, unk4, client.ClientDigest);
#endif
var decompressedDataLength = packet.ReadInt32();
var compressedData = packet.ReadBytes(packet.RemainingLength);
client.Addons = new byte[decompressedDataLength];
Compression.DecompressZLib(compressedData, client.Addons);
var acctLoadTask = Message.Obtain(() => RealmAccount.InitializeAccount(client, accName));
client.Server.AddMessage(acctLoadTask);
}
}
示例3: HandleUpdateTicketPacket
public static void HandleUpdateTicketPacket(IRealmClient client, RealmPacketIn packet)
{
var ticket = client.ActiveCharacter.Ticket;
if (ticket != null)
{
packet.ReadBytes(1);
ticket.Message = packet.ReadCString();
SendUpdateResponse(client, TicketInfoResponse.Saved);
}
else
{
SendUpdateResponse(client, TicketInfoResponse.Fail);
}
}