本文整理汇总了C#中Estrella.FiestaLib.Networking.Packet.TryReadBytes方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.TryReadBytes方法的具体用法?C# Packet.TryReadBytes怎么用?C# Packet.TryReadBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Estrella.FiestaLib.Networking.Packet
的用法示例。
在下文中一共展示了Packet.TryReadBytes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveQuickBarStateRequest
public static void SaveQuickBarStateRequest(WorldClient client, Packet packet)
{
byte[] data;
if (!packet.TryReadBytes(24, out data))
{
Log.WriteLine(LogLevel.Warn, "Unable to read 24 bytes from stream for save");
return;
}
// Save it.
client.Character.SetQuickBarStateData(data);
}
示例2: SaveClientSettingsRequest
public static void SaveClientSettingsRequest(WorldClient client, Packet packet)
{
byte[] data;
if (!packet.TryReadBytes(392, out data))
{
Log.WriteLine(LogLevel.Warn, "Unable to read 392 bytes from stream for save");
return;
}
// Save it.
client.Character.SetClientSettingsData(data);
}
示例3: SaveQuickBarRequest
public static void SaveQuickBarRequest(WorldClient client, Packet packet)
{
// Load up 1 KB of data (well, try to)
byte[] data;
if (!packet.TryReadBytes(1024, out data))
{
Log.WriteLine(LogLevel.Warn, "Unable to read 1024 bytes from stream for save");
return;
}
// Save it.
client.Character.SetQuickBarData(data);
}
示例4: SaveGameSettingsRequest
public static void SaveGameSettingsRequest(WorldClient client, Packet packet)
{
// Load up 64 B of data (well, try to)
byte[] data;
if (!packet.TryReadBytes(64, out data))
{
Log.WriteLine(LogLevel.Warn, "Unable to read 64 bytes from stream for save");
return;
}
// Save it.
client.Character.SetGameSettingsData(data);
}