Example #1
0
 public static void WriteRGBA8(hsStream s, Color c)
 {
     s.WriteByte(c.R);
     s.WriteByte(c.G);
     s.WriteByte(c.B);
     s.WriteByte(c.A);
 }
Example #2
0
        protected void IWriteNetCliEncrypt(hsStream s, byte[] seed)
        {
            if (seed.Length != 7)
                throw new ArgumentException("seed should be an array of exactly 7 bytes");

            s.WriteByte(plNetCore.kNetCliEncrypt);
            s.WriteByte(9);
            s.WriteBytes(seed);
        }
Example #3
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);
        }
Example #4
0
        public override void Write(hsStream s, hsResMgr mgr)
        {
            base.Write(s, mgr);

            s.WriteDouble(fSecsRunning);
            s.WriteByte((byte)fSession);
        }
Example #5
0
 public void Write(hsStream s)
 {
     s.WriteByte((byte)fType);
     s.WriteUShort(kHeaderSize);
     s.WriteUInt(fBuildID);
     s.WriteUInt((uint)fBuildType);
     s.WriteUInt(fBranchID);
     pnHelpers.WriteUuid(s, fProductUuid);
 }
Example #6
0
        public void Write(hsStream s)
        {
            ContentsFlags contents = IGetContentFlags(s.Version);
            s.WriteByte((byte)contents);
            fLocation.Write(s);
            if (s.Version.IsPlasma20)
                if ((contents & ContentsFlags.kHasLoadMask) != 0)
                    fLoadMask.Write(s);
            plManagedType.Write(s, fClassType);
            if (s.Version.IsUruLive || s.Version.IsPlasma21)
                s.WriteUInt(fObjectID.Value);
            s.WriteSafeString(fObjectName);
            if (s.Version.IsPlasma20)
                if ((contents & ContentsFlags.kHasCloneIDs) != 0) {
                    s.WriteUInt(fCloneID);
                    s.WriteUInt(fClonePlayerID);
                }

            if (s.Version.IsPlasma21)
                if ((contents & (ContentsFlags.kHasLoadMask | ContentsFlags.kHasLoadMask2)) != 0)
                    fLoadMask.Write(s);
        }
Example #7
0
 public void Write(hsStream s)
 {
     byte mask = (byte)((fQuality[1] & 0x0F) | (fQuality[0] << 4));
     s.WriteByte(mask);
 }
Example #8
0
 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);
 }
Example #9
0
 public void Write(hsStream s)
 {
     s.WriteUInt(UnParse(s.Version));
     if (s.Version.IsPlasma21)
         s.WriteByte((byte)fFlags);
     else
         s.WriteShort((short)fFlags);
 }
Example #10
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);
        }
Example #11
0
        public override void Read(hsStream s)
        {
            base.Read(s);

            s.WriteShort((short)fAtomicCount);
            s.WriteByte((byte)fAtomicType);
        }
Example #12
0
        public override void Write(hsStream s, hsResMgr mgr)
        {
            base.Write(s, mgr);

            s.WriteByte((byte)fPlayerIDs.Count);
            foreach (uint playerID in fPlayerIDs)
                s.WriteUInt(playerID);
        }
Example #13
0
        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);
        }
Example #14
0
 public void Write(hsStream s)
 {
     s.WriteUInt(fParent);
     s.WriteUInt(fChild);
     s.WriteUInt(fSaver);
     s.WriteByte(0);
 }
Example #15
0
        public override void Write(hsStream s, hsResMgr mgr)
        {
            base.Write(s, mgr);

            // We're not going to compress the stream...
            // Hope this is okay!
            s.WriteInt(fBuffer.Length);
            s.WriteByte((byte)Compression.kNone);
            s.WriteInt(fBuffer.Length);
            s.WriteBytes(fBuffer);
        }
Example #16
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());
        }
Example #17
0
        public override void Write(hsStream s, hsResMgr mgr)
        {
            base.Write(s, mgr);

            s.WriteByte((byte)fCommand);
            s.WriteSafeString(fUser);
            s.WriteUInt(fPlayerID);
            s.WriteSafeWString(fString);
            s.WriteInt((int)fFlags);
            s.WriteFloat(fDelay);
            s.WriteInt(fValue);
        }