本文整理汇总了C#中Plasma.hsStream.ReadUShort方法的典型用法代码示例。如果您正苦于以下问题:C# hsStream.ReadUShort方法的具体用法?C# hsStream.ReadUShort怎么用?C# hsStream.ReadUShort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plasma.hsStream
的用法示例。
在下文中一共展示了hsStream.ReadUShort方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
public void Read(hsStream s)
{
fType = (ENetProtocol)s.ReadByte();
if (s.ReadUShort() != kHeaderSize)
throw new NotSupportedException();
fBuildID = s.ReadUInt();
fBuildType = (EBuildType)s.ReadUInt();
fBranchID = s.ReadUInt();
fProductUuid = pnHelpers.ReadUuid(s);
}
示例2: Read
public void Read(hsStream s)
{
fType = (ENetProtocol)s.ReadByte();
if (s.ReadUShort() != kHeaderSize)
throw new NotSupportedException();
fBuildID = s.ReadUInt();
fProtocolVer = s.ReadUInt();
if (fProtocolVer < 50)
fProtocolVer = 50; // <= 50 are the old "Build Type" values...
fBranchID = s.ReadUInt();
fProductUuid = pnHelpers.ReadUuid(s);
}
示例3: Read
public override void Read(hsStream s, hsResMgr mgr)
{
base.Read(s, mgr);
fState = s.ReadUShort();
}
示例4: IRead
protected override void IRead(hsStream s, hsResMgr mgr)
{
fID = s.ReadUInt();
fSerial = s.ReadUShort();
}
示例5: Read
/// <summary>
/// Reads in a Version-specific type and returns an internal type identifier
/// </summary>
/// <param name="s">The stream to read from</param>
/// <returns>Internal unique type identifier</returns>
public static plCreatableID Read(hsStream s)
{
if (fTypeMaps == null)
IBuildTypeMaps();
ushort data = s.ReadUShort();
plCreatableID type = plCreatableID.NULL;
//Note: We must adjust < PotS IDs...
if (s.Version < plVersion.PathOfTheShell)
if (data > (ushort)UruTypes.plAvatarSpawnNotifyMsg)
data++;
//End type adjustment
foreach (KeyValuePair<plTypeBounds, Type> kvp in fTypeMaps) {
if (kvp.Key.UpperBoundary >= s.Version && s.Version >= kvp.Key.LowerBoundary) {
string value = Enum.GetName(kvp.Value, data);
type = (plCreatableID)Enum.Parse(typeof(plCreatableID), value);
}
}
return type;
}
示例6: Read
public void Read(hsStream s)
{
// Magically figure out what version we have...
uint prpVer = s.ReadUInt();
switch (prpVer) {
case 1:
case 2:
case 3:
case 4:
case 5:
s.Version = new plVersion(2, 0, 0, 0);
break;
case 6:
s.Version = plVersion.MystOnline;
break;
default:
// Must be some sort of Myst 5 variant...
s.Rewind();
prpVer = (uint)s.ReadUShort();
switch (prpVer) {
case 6:
s.Version = plVersion.EndOfAges;
break;
case 9:
s.Version = plVersion.HexIsle;
break;
default:
throw new plVersionException(prpVer);
}
break;
}
if (s.Version.IsPlasma21)
IReadClassVersions(s);
fLocation.Read(s);
fAge = s.ReadSafeString();
if (s.Version.IsPreMystOnline) fChapter = s.ReadSafeString();
else if (s.Version.IsMystOnline) fChapter = "District";
fPage = s.ReadSafeString();
// Some more versioning stuff for Uru...
if (s.Version.IsMystOnline)
s.Version = new plVersion(2, 0, s.ReadUShort(), 0);
else if (s.Version.IsPreMystOnline)
s.Version = new plVersion(2, 0, s.ReadUShort(), s.ReadUShort());
if (prpVer < 6) {
if (prpVer < 5) // IndexChecksum -- deprecated...
s.ReadUInt();
if (prpVer >= 2)
fReleaseVersion = s.ReadInt();
if (prpVer >= 3)
fFlags = (Flags)s.ReadInt();
}
if (prpVer >= 4)
fChecksum = s.ReadUInt();
if (prpVer >= 5) {
fDataStart = s.ReadUInt();
fIndexStart = s.ReadUInt();
} else {
//prm/prx???
fDataStart = 0;
fIndexStart = s.ReadByte();
}
// Garbage
if (s.Version.IsMystOnline)
IReadClassVersions(s);
}
示例7: IReadClassVersions
private void IReadClassVersions(hsStream s)
{
// TODO: Save this data? For now, throw it away.
ushort nTypes = s.ReadUShort();
for (ushort i = 0; i < nTypes; i++) {
plCreatableID type = plManagedType.Read(s);
ushort vers = s.ReadUShort();
if (vers != 0)
plDebugLog.GetLog("ResManager").Warn(
String.Format("\t* ClassVersion: {0}, {1}",
plManagedType.ClassName(type), vers));
}
}
示例8: Read
public override void Read(hsStream s, hsResMgr mgr)
{
fFlags = (Flags)s.ReadShort();
if (HasAccount)
fAcctUUID = new Guid(s.ReadBytes(16));
if (HasPlayerID)
fPlayerID = s.ReadUInt();
if (HasPlayerName)
fPlayerName = s.ReadStdString();
if (HasCCRLevel)
fCCRLevel = s.ReadByte();
if (HasProtectedLogin)
fProtectedLogin = s.ReadBool();
if (HasBuildType)
fBuildType = s.ReadByte();
if (HasSrcAddr)
fSrcAddr = s.ReadUInt();
if (HasSrcPort)
fSrcPort = s.ReadUShort();
if (HasReserved)
fReserved = s.ReadUShort();
if (HasClientKey)
fClientKey = s.ReadStdString();
}