public override void Write(hsStream s, hsResMgr mgr) { if (s.Version.IsMystOnline) mgr.WriteKey(s, fpKey); else mgr.WriteUoid(s, fpKey); }
public override void Write(hsStream s, hsResMgr mgr) { base.Write(s, mgr); s.WriteInt((int)fCommand); s.WriteStdString(fString); }
public override void Read(hsStream s, hsResMgr mgr) { base.Read(s, mgr); fSecsRunning = s.ReadDouble(); fSession = (SessionTypes)s.ReadByte(); }
public override void Write(hsStream s, hsResMgr mgr) { base.Write(s, mgr); s.WriteDouble(fSecsRunning); s.WriteByte((byte)fSession); }
public override void Read(hsStream s, hsResMgr mgr) { base.Read(s, mgr); fCommand = (Cmd)s.ReadInt(); fString = s.ReadStdString(); }
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())); } } }
public override void Write(hsStream s, hsResMgr mgr) { base.Write(s, mgr); s.WriteBool(fDeliveryTime.HasValue); if (fDeliveryTime.HasValue) plUnifiedTime.Write(s, fDeliveryTime.Value); }
public override void Read(hsStream s, hsResMgr mgr) { base.Read(s, mgr); fIsInitialState = s.ReadBool(); fPersistOnServer = s.ReadBool(); fIsAvatarState = s.ReadBool(); }
public override void Write(hsStream s, hsResMgr mgr) { base.Write(s, mgr); s.WriteBool(fIsInitialState); s.WriteBool(fPersistOnServer); s.WriteBool(fIsAvatarState); }
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; }
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(); }
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); }
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); } }
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); } }
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)); }
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); }
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()); }
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; }
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; }
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)); }
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); }
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); }
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; }
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); }
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(); }
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; }
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()); }
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)); }