-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
99 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using NPTicket.Reader; | ||
|
||
namespace NPTicket.Types.Parsers; | ||
|
||
internal static class TicketParser21 | ||
{ | ||
internal static void ParseTicket(Ticket ticket, TicketReader reader) | ||
{ | ||
ticket.SerialId = reader.ReadTicketStringData(TicketDataType.Binary); | ||
|
||
ticket.IssuerId = reader.ReadTicketUInt32Data(); | ||
|
||
ticket.IssuedDate = reader.ReadTicketTimestampData(); | ||
ticket.ExpiryDate = reader.ReadTicketTimestampData(); | ||
|
||
ticket.UserId = reader.ReadTicketUInt64Data(); | ||
ticket.Username = reader.ReadTicketStringData(); | ||
|
||
ticket.Country = reader.ReadTicketStringData(TicketDataType.Binary); // No I am not going to brazil | ||
ticket.Domain = reader.ReadTicketStringData(); | ||
|
||
ticket.ServiceId = reader.ReadTicketStringData(TicketDataType.Binary); | ||
ticket.TitleId = Ticket.ServiceIdRegex.Matches(ticket.ServiceId)[0].ToString(); | ||
|
||
ticket.Status = reader.ReadUInt32(); | ||
|
||
// Skip padding section in ticket | ||
reader.SkipTicketEmptyData(3); | ||
|
||
TicketDataSection footer = reader.ReadTicketSectionHeader(); | ||
if (footer.Type != TicketDataSectionType.Footer) | ||
{ | ||
throw new FormatException($"Expected last section to be {nameof(TicketDataSectionType.Footer)}, " + | ||
$"was really {footer.Type} ({(int)footer.Type})"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using NPTicket.Reader; | ||
|
||
namespace NPTicket.Types.Parsers; | ||
|
||
internal static class TicketParser30 | ||
{ | ||
internal static void ParseTicket(Ticket ticket, TicketReader reader) | ||
{ | ||
|
||
} | ||
} |