Exemple #1
0
            public MsgHdrRecord(byte[] raw, int idx) : this()
            {
                MsgNum     = FidonetHelpers.GetUShort(raw, idx);
                PrevReply  = FidonetHelpers.GetUShort(raw, idx + 2);
                NextReply  = FidonetHelpers.GetUShort(raw, idx + 4);
                TimesRead  = FidonetHelpers.GetUShort(raw, idx + 6);
                StartBlock = FidonetHelpers.GetUShort(raw, idx + 8);
                NumBlocks  = FidonetHelpers.GetUShort(raw, idx + 10);
                DestNet    = FidonetHelpers.GetUShort(raw, idx + 12);
                DestNode   = FidonetHelpers.GetUShort(raw, idx + 14);
                OrigNet    = FidonetHelpers.GetUShort(raw, idx + 16);
                OrigNode   = FidonetHelpers.GetUShort(raw, idx + 18);
                DestZone   = raw[idx + 20];
                OrigZone   = raw[idx + 21];
                Cost       = FidonetHelpers.GetUShort(raw, idx + 22);
                MsgAttr    = raw[idx + 24];
                NetAttr    = raw[idx + 25];
                Board      = raw[idx + 26];
                string time = FidonetHelpers.GetPascalString(raw, idx + 0x1b);
                string date = FidonetHelpers.GetPascalString(raw, idx + 0x21);

                if (!DateTime.TryParseExact($"{date} {time}", "MM-dd-yy HH:mm",
                                            CultureInfo.InvariantCulture, DateTimeStyles.None,
                                            out Timestamp))
                {
                    Timestamp = DateTime.MinValue;
                }
                WhoTo   = FidonetHelpers.GetPascalString(raw, idx + 0x2a);
                WhoFrom = FidonetHelpers.GetPascalString(raw, idx + 0x4e);
                Subject = FidonetHelpers.GetPascalString(raw, idx + 0x72);
            }
Exemple #2
0
 /// <summary>
 /// Builds record from raw data
 /// </summary>
 /// <param name="raw"></param>
 /// <param name="idx"></param>
 public MsgIdxRecord(byte[] raw, int idx)
 {
     msgnum = FidonetHelpers.GetUShort(raw, idx);
     board  = raw[idx + 2];
 }