示例#1
0
 public override void Write(hsStream s, hsResMgr mgr)
 {
     if (s.Version.IsMystOnline)
         mgr.WriteKey(s, fpKey);
     else
         mgr.WriteUoid(s, fpKey);
 }
示例#2
0
        public override void Write(hsStream s, hsResMgr mgr)
        {
            base.Write(s, mgr);

            s.WriteInt((int)fCommand);
            s.WriteStdString(fString);
        }
示例#3
0
        public override void Read(hsStream s, hsResMgr mgr)
        {
            base.Read(s, mgr);

            fSecsRunning = s.ReadDouble();
            fSession = (SessionTypes)s.ReadByte();
        }
示例#4
0
        public override void Write(hsStream s, hsResMgr mgr)
        {
            base.Write(s, mgr);

            s.WriteDouble(fSecsRunning);
            s.WriteByte((byte)fSession);
        }
示例#5
0
        public override void Read(hsStream s, hsResMgr mgr)
        {
            base.Read(s, mgr);

            fCommand = (Cmd)s.ReadInt();
            fString = s.ReadStdString();
        }
示例#6
0
        public override void Read(hsStream s, hsResMgr mgr)
        {
            base.Read(s, mgr);

            fSynchFlags = (Flags)s.ReadInt();
            if (s.Version.IsPlasma21)
                fSynchFlags &= (Flags)~0x8;

            if (s.Version.IsPlasma21 && (((int)fSynchFlags & 0x06) != 0) ||
               (s.Version.IsPlasma20 && ExcludeStates)) {
                short count = s.ReadShort();
                for (short i = 0; i < count; i++)
                    fExcludeStates.Add((States)Enum.Parse(typeof(States), s.ReadStdString()));
            }

            //Plasma 2.1+ ends here...
            if (s.Version.IsPlasma21) {
                fSynchFlags = 0; // Synch Flags are pretty useless in Plasma21
                return;
            } else if (s.Version.IsPlasma20) {
                if (VolatileStates) {
                    short count = s.ReadShort();
                    for (short i = 0; i < count; i++)
                        fVolatileStates.Add((States)Enum.Parse(typeof(States), s.ReadStdString()));
                }
            }
        }
示例#7
0
        public override void Write(hsStream s, hsResMgr mgr)
        {
            base.Write(s, mgr);

            s.WriteBool(fDeliveryTime.HasValue);
            if (fDeliveryTime.HasValue)
                plUnifiedTime.Write(s, fDeliveryTime.Value);
        }
示例#8
0
        public override void Read(hsStream s, hsResMgr mgr)
        {
            base.Read(s, mgr);

            fIsInitialState = s.ReadBool();
            fPersistOnServer = s.ReadBool();
            fIsAvatarState = s.ReadBool();
        }
示例#9
0
        public override void Write(hsStream s, hsResMgr mgr)
        {
            base.Write(s, mgr);

            s.WriteBool(fIsInitialState);
            s.WriteBool(fPersistOnServer);
            s.WriteBool(fIsAvatarState);
        }
示例#10
0
 public override void Read(hsStream s, hsResMgr mgr)
 {
     plKey key = null;
     if (s.Version.IsMystOnline)
         key = mgr.ReadKey(s);
     else
         key = mgr.ReadUoid(s);
     fpKey = key;
 }
示例#11
0
        public override void Read(hsStream s, hsResMgr mgr)
        {
            base.Read(s, mgr);

            fObjectHelper = mgr.ReadUoid(s); // Yes, ReadUoid. Not ReadKey.
            fIsPlayer = s.ReadBool();
            fIsLoading = s.ReadBool();
            fIsInitialState = s.ReadBool();
        }
示例#12
0
        public override void Write(hsStream s, hsResMgr mgr)
        {
            base.Write(s, mgr);

            mgr.WriteUoid(s, fObjectHelper);
            s.WriteBool(fIsPlayer);
            s.WriteBool(fIsLoading);
            s.WriteBool(fIsInitialState);
        }
        public override void Read(hsStream s, hsResMgr mgr)
        {
            base.Read(s, mgr);

            fInvisLevel = s.ReadInt();
            fLeavingAge = s.ReadBool();
            fLinkKey = mgr.ReadKey(s);
            fEffects = s.ReadInt();
            fLinkAnimKey = mgr.ReadKey(s);
        }
        public override void Write(hsStream s, hsResMgr mgr)
        {
            base.Write(s, mgr);

            s.WriteInt(fInvisLevel);
            s.WriteBool(fLeavingAge);
            mgr.WriteKey(s, fLinkKey);
            s.WriteInt(fEffects);
            mgr.WriteKey(s, fLinkAnimKey);
        }
示例#15
0
        public override void Read(hsStream s, hsResMgr mgr)
        {
            base.Read(s, mgr);

            fMembers.Capacity = (int)s.ReadShort();
            for (int i = 0; i < fMembers.Capacity; i++) {
                plNetMsgMemberInfoHelper info = new plNetMsgMemberInfoHelper();
                info.Read(s, mgr);
                fMembers.Add(info);
            }
        }
示例#16
0
        public override void Read(hsStream s, hsResMgr mgr)
        {
            base.Read(s, mgr);

            int count = s.ReadInt();
            for (int i = 0; i < count; i++) {
                plNetGroupInfo g = new plNetGroupInfo();
                g.Read(s);
                fGroups.Add(g);
            }
        }
示例#17
0
        public override void Read(hsStream s, hsResMgr mgr)
        {
            base.Read(s, mgr);

            fObjectPool.Capacity = s.ReadInt();
            for (int i = 0; i < fObjectPool.Capacity; i++)
                fObjectPool.Add(mgr.ReadKey(s));

            fGenericPool.Capacity = s.ReadInt();
            for (int i = 0; i < fGenericPool.Capacity; i++)
                fGenericPool.Add(mgr.ReadKey(s));
        }
示例#18
0
        public override void Write(hsStream s, hsResMgr mgr)
        {
            base.Write(s, mgr);

            s.WriteByte(fFlags);
            s.WriteByte(fNumFrames);
            s.WriteStdString(fVoiceData);

            s.WriteByte((byte)fReceivers.Count);
            foreach (uint r in fReceivers)
                s.WriteUInt(r);
        }
示例#19
0
        public override void Read(hsStream s, hsResMgr mgr)
        {
            base.Read(s, mgr);

            fFlags = s.ReadByte();
            fNumFrames = s.ReadByte();
            fVoiceData = s.ReadStdString();

            fReceivers.Capacity = (int)s.ReadByte();
            for (int i = 0; i < fReceivers.Capacity; i++)
                fReceivers.Insert(i, s.ReadUInt());
        }
示例#20
0
        public plMessage GetMessage(hsResMgr mgr)
        {
            hsStream s = fHelper.Stream;
            if (s == null || s.BaseStream.Length == 0)
                return null;

            plCreatable pCre = mgr.ReadCreatable(s);
            s.Close();

            if (pCre is plMessage)
                return (plMessage)pCre;
            else
                return null;
        }
示例#21
0
        public void SetMessage(plMessage msg, hsResMgr mgr)
        {
            hsStream s = new hsStream(new MemoryStream());
            s.Version = mgr.Version;
            if (msg != null)
                mgr.WriteCreatable(s, msg);
            fHelper.Stream = s;
            s.Close();

            // Fill in the flags
            // TODO: CCR -> AllPlayers
            InterAgeRouting = msg.InterAgeRouting;
            UseRelRegions = msg.UseRelRegions;
        }
示例#22
0
        public override void Read(hsStream s, hsResMgr mgr)
        {
            base.Read(s, mgr);

            fType = (NotificationType)s.ReadInt();
            fState = s.ReadFloat();
            if (s.Version < plVersion.EndOfAges)
                fID = s.ReadInt();
            else
                fID = (int)s.ReadByte();

            fEvents.Capacity = s.ReadInt();
            for (int i = 0; i < fEvents.Capacity; i++)
                fEvents.Add(proEventData.Read(s, mgr));
        }
示例#23
0
        public override void Write(hsStream s, hsResMgr mgr)
        {
            base.Write(s, mgr);

            s.WriteInt((int)fType);
            s.WriteFloat(fState);
            if (s.Version < plVersion.EndOfAges)
                s.WriteInt(fID);
            else
                s.WriteByte((byte)fID);

            s.WriteInt(fEvents.Count);
            foreach (proEventData ped in fEvents)
                ped.Write(s, mgr);
        }
示例#24
0
        public override void Write(hsStream s, hsResMgr mgr)
        {
            base.Write(s, mgr);

            s.WriteBool(fIsPlayer);
            mgr.WriteKey(s, fSpawnPoint);

            // Cyan is really quite stupid sometimes...
            if (fInitialTask == null)
                s.WriteBool(false);
            else {
                s.WriteBool(true);
                mgr.WriteCreatable(s, fInitialTask);
            }

            if (s.Version.IsMystOnline)
                s.WriteSafeString(fUserStr);
        }
示例#25
0
        public plStateDataRecord ParseStateRecord(byte[] record, hsResMgr mgr)
        {
            MemoryStream ms = new MemoryStream(record);
            hsStream s = new hsStream(ms);
            s.Version = mgr.Version;

            plStateDataRecord result = new plStateDataRecord(this);
            try {
                result.ReadStreamHeader(s, mgr);
                result.Read(s, mgr);
            } catch (Exception e) {
                throw new plSDLException("Failed to parse StateDataRecord", e);
            } finally {
                s.Close();
                ms.Close();
            }

            return result;
        }
示例#26
0
        public override void Read(hsStream s, hsResMgr mgr)
        {
            base.Read(s, mgr);

            fDrawInterface = mgr.ReadKey(s);
            fSimulationInterface = mgr.ReadKey(s);
            fCoordInterface = mgr.ReadKey(s);
            fAudioInterface = mgr.ReadKey(s);

            fInterfaces.Capacity = s.ReadInt();
            for (int i = 0; i < fInterfaces.Capacity; i++)
                fInterfaces.Add(mgr.ReadKey(s));

            fModifiers.Capacity = s.ReadInt();
            for (int i = 0; i < fModifiers.Capacity; i++)
                fModifiers.Add(mgr.ReadKey(s));

            fSceneNode = mgr.ReadKey(s);
        }
示例#27
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();
        }
示例#28
0
        public byte[] DumpStateRecord(plStateDataRecord record, hsResMgr mgr)
        {
            MemoryStream ms = new MemoryStream();
            hsStream s = new hsStream(ms);
            s.Version = mgr.Version;

            byte[] buf = null;
            try {
                record.WriteStreamHeader(s, mgr);
                record.Write(s, mgr);
            } catch (Exception e) {
                throw new plSDLException("Failed to dump StateDataRecord", e);
            } finally {
                buf = ms.ToArray();
                s.Close();
                ms.Close();
            }

            return buf;
        }
示例#29
0
        public override void Write(hsStream s, hsResMgr mgr)
        {
            s.WriteInt((int)fFlags);

            if (HasVersion) {
                s.WriteByte(fVerMajor);
                s.WriteByte(fVerMinor);
            }

            if (HasTimeSent)
                plUnifiedTime.Write(s, fTimeSent);
            if (HasContext)
                s.WriteUInt(fContext);
            if (HasTransID)
                s.WriteUInt(fTransID);
            if (HasPlayerID)
                s.WriteUInt(fPlayerID);
            if (HasAccount)
                s.WriteBytes(fAcctUUID.ToByteArray());
        }
示例#30
0
        public override void Read(hsStream s, hsResMgr mgr)
        {
            fFlags = (BitVectorFlags)s.ReadInt();

            if (HasVersion) {
                fVerMajor = s.ReadByte();
                fVerMinor = s.ReadByte();
            }

            if (HasTimeSent)
                fTimeSent = plUnifiedTime.Read(s);
            if (HasContext)
                fContext = s.ReadUInt();
            if (HasTransID)
                fTransID = s.ReadUInt();
            if (HasPlayerID)
                fPlayerID = s.ReadUInt();
            if (HasAccount)
                fAcctUUID = new Guid(s.ReadBytes(16));
        }