Ejemplo n.º 1
0
        public override void Read(hsStream s, hsResMgr mgr)
        {
            base.Read(s, mgr);

            fIsPlayer = s.ReadBool();
            fSpawnPoint = mgr.ReadKey(s);

            if (s.ReadBool()) {
                plCreatable pCre = mgr.ReadCreatable(s);
                if (pCre is plAvTask)
                    fInitialTask = (plAvTask)pCre;
                else if (pCre != null)
                    plDebugLog.GetLog("ResManager").Warn(
                        String.Format("plLoadAvatarMsg: InitialTask should be a plAvTask, but we got a '{0}'",
                        plFactory.ClassName(pCre)));
            }

            if (s.Version.IsMystOnline)
                fUserStr = s.ReadSafeString();
        }
Ejemplo n.º 2
0
        public void Read(hsStream s)
        {
            ContentsFlags contents = (ContentsFlags)s.ReadByte();
            fLocation.Read(s);
            if ((contents & ContentsFlags.kHasLoadMask) != 0)
                if (!s.Version.IsPlasma21) fLoadMask.Read(s);
            fClassType = plManagedType.Read(s);
            if (s.Version.IsUruLive || s.Version.IsPlasma21)
                fObjectID = s.ReadUInt();
            fObjectName = s.ReadSafeString();
            if (s.Version.IsPlasma20) {
                if ((contents & ContentsFlags.kHasCloneIDs) != 0) {
                    fCloneID = s.ReadUInt();
                    fClonePlayerID = s.ReadUInt();
                }
            }

            if ((contents & (ContentsFlags.kHasLoadMask | ContentsFlags.kHasLoadMask2)) != 0)
                if (s.Version.IsPlasma21)
                    fLoadMask.Read(s);
        }
Ejemplo n.º 3
0
 protected override void IRead(hsStream s, hsResMgr mgr)
 {
     fName = s.ReadSafeString();
     fDataType = (DataType)s.ReadInt();
     fNumber = s.ReadFloat();
     fKey = mgr.ReadKey(s);
 }
Ejemplo n.º 4
0
        public virtual void Read(hsStream s)
        {
            if (s.ReadByte() != kIoVersion)
                throw new NotSupportedException("Bad VarDescriptor IO Version");

            fName = s.ReadSafeString();
            string displayOptions = s.ReadStdString(); // TODO
            fCount = s.ReadInt();
            fType = (plAtomicType)s.ReadByte();
            Default = s.ReadSafeString();
            fFlags = (Flags)s.ReadInt();
        }
Ejemplo n.º 5
0
        public override void Read(hsStream s)
        {
            base.Read(s);

            fDescName = s.ReadSafeString();
            fVersion = (int)s.ReadShort();
        }
Ejemplo n.º 6
0
        public void Read(hsStream s)
        {
            if (s.ReadByte() != kIoVersion)
                throw new NotSupportedException("Bad StateDescriptor IO Version");

            fName = s.ReadSafeString();
            fVersion = (int)s.ReadShort();

            short count = s.ReadShort();
            fVariables.Capacity = count; // Optimization
            for (short i = 0; i < count; i++) {
                plVarDescriptor var = null;

                bool isSD = s.ReadBool();
                if (isSD)
                    var = new plSDVarDescriptor();
                else
                    var = new plSimpleVarDescriptor();
                var.Read(s);
                fVariables.Add(var);
            }
        }
Ejemplo n.º 7
0
        public virtual void Read(hsStream s)
        {
            if (s.ReadByte() != kIoVersion)
                throw new NotSupportedException("Bad VarDescriptor IO Version");

            fName = s.ReadSafeString();
            string displayOptions = s.ReadStdString(); // TODO
            fCount = s.ReadInt();
            fType = (plAtomicType)s.ReadByte();
            Default = s.ReadSafeString();
            fFlags = (Flags)s.ReadInt();

            // Derived class in Cyan's code, but this is cleaner
            if (IsStateDesc) {
                fDescName = s.ReadSafeString();
                fVersion = (int)s.ReadShort();
            } else {
                fAtomicCount = (int)s.ReadShort();
                fAtomicType = (plAtomicType)s.ReadByte();
            }
        }
Ejemplo n.º 8
0
        public void Read(hsStream s)
        {
            if (s.ReadByte() != kIoVersion)
                throw new NotSupportedException("Bad StateDescriptor IO Version");

            fName = s.ReadSafeString();
            fVersion = (int)s.ReadShort();

            short count = s.ReadShort();
            fVariables.Capacity = count; // Optimization
            for (short i = 0; i < count; i++) {
                plVarDescriptor var = new plVarDescriptor(s.ReadBool()
                    ? plAtomicType.kStateDescriptor : plAtomicType.kNone);
                var.Read(s);
                fVariables.Add(var);
            }
        }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
        public override void Read(hsStream s, hsResMgr mgr)
        {
            base.Read(s, mgr);

            fCommand = (Cmd)s.ReadByte();
            fUser = s.ReadSafeString();
            fPlayerID = s.ReadUInt();
            fString = s.ReadSafeWString();
            fFlags = (Flags)s.ReadInt();
            fDelay = s.ReadFloat();
            fValue = s.ReadInt();
        }