本文整理汇总了C#中Server.Network.PacketReader.ReadUnicodeStringLESafe方法的典型用法代码示例。如果您正苦于以下问题:C# PacketReader.ReadUnicodeStringLESafe方法的具体用法?C# PacketReader.ReadUnicodeStringLESafe怎么用?C# PacketReader.ReadUnicodeStringLESafe使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Network.PacketReader
的用法示例。
在下文中一共展示了PacketReader.ReadUnicodeStringLESafe方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnReceive
public static void OnReceive(NetState state, PacketReader pvSrc)
{
pvSrc.ReadByte(); // 1: <4.0.1a, 2>=4.0.1a
HardwareInfo info = new HardwareInfo();
info.m_InstanceID = pvSrc.ReadInt32();
info.m_OSMajor = pvSrc.ReadInt32();
info.m_OSMinor = pvSrc.ReadInt32();
info.m_OSRevision = pvSrc.ReadInt32();
info.m_CpuManufacturer = pvSrc.ReadByte();
info.m_CpuFamily = pvSrc.ReadInt32();
info.m_CpuModel = pvSrc.ReadInt32();
info.m_CpuClockSpeed = pvSrc.ReadInt32();
info.m_CpuQuantity = pvSrc.ReadByte();
info.m_PhysicalMemory = pvSrc.ReadInt32();
info.m_ScreenWidth = pvSrc.ReadInt32();
info.m_ScreenHeight = pvSrc.ReadInt32();
info.m_ScreenDepth = pvSrc.ReadInt32();
info.m_DXMajor = pvSrc.ReadInt16();
info.m_DXMinor = pvSrc.ReadInt16();
info.m_VCDescription = pvSrc.ReadUnicodeStringLESafe(64);
info.m_VCVendorID = pvSrc.ReadInt32();
info.m_VCDeviceID = pvSrc.ReadInt32();
info.m_VCMemory = pvSrc.ReadInt32();
info.m_Distribution = pvSrc.ReadByte();
info.m_ClientsRunning = pvSrc.ReadByte();
info.m_ClientsInstalled = pvSrc.ReadByte();
info.m_PartialInstalled = pvSrc.ReadByte();
info.m_Language = pvSrc.ReadUnicodeStringLESafe(4);
info.m_Unknown = pvSrc.ReadStringSafe(64);
info.m_TimeReceived = DateTime.Now;
Account acct = state.Account as Account;
if (acct != null)
acct.HardwareInfo = info;
}
示例2: UnicodePromptResponse
public static void UnicodePromptResponse( NetState state, PacketReader pvSrc )
{
int serial = pvSrc.ReadInt32();
int prompt = pvSrc.ReadInt32();
int type = pvSrc.ReadInt32();
/*string lang = */pvSrc.ReadString( 4 );
string text = pvSrc.ReadUnicodeStringLESafe();
if ( text.Length > 128 )
return;
Mobile from = state.Mobile;
Prompt p = from.Prompt;
if ( p != null && p.Serial == serial && p.Serial == prompt )
{
from.Prompt = null;
try {
if ( type == 0 )
p.OnCancel( from );
else
p.OnResponse( from, text );
} catch (Exception e) {
log.Fatal(String.Format("Exception disarmed in UnicodePrompt response {0}, type {1}",
state.Mobile, type), e);
}
}
}
示例3: UnicodePromptResponse
public static void UnicodePromptResponse( NetState state, PacketReader pvSrc )
{
int serial = pvSrc.ReadInt32();
int prompt = pvSrc.ReadInt32();
int type = pvSrc.ReadInt32();
string lang = pvSrc.ReadString( 4 );
string text = pvSrc.ReadUnicodeStringLESafe();
if ( text.Length > 128 )
return;
Mobile from = state.Mobile;
Prompt p = from.Prompt;
if ( p != null && p.Serial == serial && p.Serial == prompt )
{
from.Prompt = null;
if ( type == 0 )
p.OnCancel( from );
else
p.OnResponse( from, text );
}
}
示例4: UnicodePromptResponse
public static void UnicodePromptResponse(NetState state, PacketReader pvSrc)
{
Mobile from = state.Mobile;
Prompt p = from.Prompt;
int senderSerial = pvSrc.ReadInt32();
int promptId = pvSrc.ReadInt32();
int type = pvSrc.ReadInt32();
/*string lang = */
pvSrc.ReadString(4);
string text = pvSrc.ReadUnicodeStringLESafe();
if (text.Length > 128)
return;
int promptSerial = (p != null && p.Sender != null) ? p.Sender.Serial.Value : from.Serial.Value;
if (p != null && promptSerial == senderSerial && p.TypeId == promptId)
{
from.Prompt = null;
try
{
if (type == 0)
p.OnCancel(from);
else
p.OnResponse(from, text);
}
catch (Exception e)
{
Console.WriteLine("Exception disarmed in UnicodePrompt response {0}, type {1}: {2}", state.Mobile, type, e);
}
}
}