本文整理匯總了C#中Plasma.hsStream.WriteShort方法的典型用法代碼示例。如果您正苦於以下問題:C# hsStream.WriteShort方法的具體用法?C# hsStream.WriteShort怎麽用?C# hsStream.WriteShort使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Plasma.hsStream
的用法示例。
在下文中一共展示了hsStream.WriteShort方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: VariableLengthWrite
internal static void VariableLengthWrite(hsStream s, int size, int value)
{
if (size < 0x100)
s.WriteByte((byte)value);
else if (size < 0x10000)
s.WriteShort((short)value);
else
s.WriteInt(value);
}
示例2: WriteString
public static void WriteString(hsStream s, string data, int maxSize)
{
if (data == null) {
s.WriteShort(0);
return;
}
byte[] buf;
if (data.Length > maxSize)
buf = Encoding.Unicode.GetBytes(data.Remove(maxSize));
else
buf = Encoding.Unicode.GetBytes(data);
s.WriteShort((short)(buf.Length / 2));
s.WriteBytes(buf);
}
示例3: Read
public override void Read(hsStream s)
{
base.Read(s);
s.WriteShort((short)fAtomicCount);
s.WriteByte((byte)fAtomicType);
}
示例4: Write
public void Write(hsStream s)
{
s.WriteUInt(UnParse(s.Version));
if (s.Version.IsPlasma21)
s.WriteByte((byte)fFlags);
else
s.WriteShort((short)fFlags);
}
示例5: Write
public override void Write(hsStream s, hsResMgr mgr)
{
s.WriteShort((short)fFlags);
if (HasAccount)
s.WriteBytes(fAcctUUID.ToByteArray());
if (HasPlayerID)
s.WriteUInt(fPlayerID);
if (HasPlayerName)
s.WriteStdString(fPlayerName);
if (HasCCRLevel)
s.WriteByte(fCCRLevel);
if (HasProtectedLogin)
s.WriteBool(fProtectedLogin);
if (HasBuildType)
s.WriteByte(fBuildType);
if (HasSrcAddr)
s.WriteUInt(fSrcAddr);
if (HasSrcPort)
s.WriteUShort(fSrcPort);
if (HasReserved)
s.WriteUShort(fReserved);
if (HasClientKey)
s.WriteStdString(fClientKey);
}