本文整理汇总了C#中PacketReader.ReadUnicodeString方法的典型用法代码示例。如果您正苦于以下问题:C# PacketReader.ReadUnicodeString方法的具体用法?C# PacketReader.ReadUnicodeString怎么用?C# PacketReader.ReadUnicodeString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketReader
的用法示例。
在下文中一共展示了PacketReader.ReadUnicodeString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UnicodeSpeechRequest
public UnicodeSpeechRequest(byte[] data)
: base(data)
{
PacketReader reader = new PacketReader(data);
byte id = reader.ReadByte();
ushort blockSize = reader.ReadUInt16();
byte type = reader.ReadByte();
this.type = (byte)(type & 0x0F);
color = reader.ReadUInt16();
font = reader.ReadUInt16();
language = reader.ReadAnsiString(4);
if ((type & 0xC0) != 0)
{
int numKeywords = (Data[12] << 4) + (Data[13] >> 4);
reader.Skip(((numKeywords * 12 + 12) + 7) / 8);
text = reader.ReadAnsiString(Lenght - reader.Offset);
}
else
{
text = reader.ReadUnicodeString(Lenght - reader.Offset);
}
}
示例2: Read
public static void Read( PacketReader p )
{
Serial ser = p.ReadUInt32();
ushort zero = p.ReadUInt16();
int hash = p.ReadInt32();
object old = m_Entries[ser];
if ( old is ObjectPropertyList )
{
if ( ((ObjectPropertyList)old).ServerHash+0x40000000 == hash )
return;
}
ArrayList props = new ArrayList();
while ( true )
{
int num = p.ReadInt32();
if ( num == 0 || num == -1 )
break;
short argLen = p.ReadInt16();
string args = String.Empty;
if ( argLen > 0 )
args = p.ReadUnicodeString( argLen >> 1 );
props.Add( new ObjectProperty( num, args ) );
}
ObjectPropertyList list;
m_Entries[ser] = list = new ObjectPropertyList( ser, hash, props );
if ( old is ObjectPropertyList )
list.Add( ((ObjectPropertyList)old).MyProps );
}