Example #1
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 #2
0
 public override void Write(hsStream s, hsResMgr mgr)
 {
     base.Write(s, mgr);
     s.WriteUShort(fState);
 }
Example #3
0
 /// <summary>
 /// Writes a UTF-16 string with an int32 size
 /// </summary>
 /// <param name="s">Stream to write to</param>
 /// <param name="data">String to write to the stream</param>
 public static void WriteString(hsStream s, string data)
 {
     byte[] str = Encoding.Unicode.GetBytes(data);
     s.WriteInt(str.Length + 2);
     s.WriteBytes(str);
     s.WriteUShort((ushort)0);
 }
Example #4
0
 protected override void IWrite(hsStream s, hsResMgr mgr)
 {
     s.WriteUInt(fID);
     s.WriteUShort(fSerial);
 }
Example #5
0
        public static void Write(hsStream s, plCreatableID data)
        {
            if (fTypeMaps == null)
                IBuildTypeMaps();

            plCreatableID type = (plCreatableID)data;
            ushort end = (ushort)plCreatableID.NULL;

            foreach (KeyValuePair<plTypeBounds, Type> kvp in fTypeMaps) {
                if (kvp.Key.UpperBoundary >= s.Version && s.Version >= kvp.Key.LowerBoundary) {
                    string value = Enum.GetName(typeof(plCreatableID), type);
                    end = (ushort)Enum.Parse(kvp.Value, value);
                }
            }

            //Note: We must adjust < PotS IDs...
            if (s.Version < plVersion.PathOfTheShell)
                if (end > (ushort)UruTypes.plAvatarSpawnNotifyMsg)
                    end--;
            //End type adjustment

            s.WriteUShort(end);
        }
Example #6
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);
        }