mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-03 10:38:40 +00:00
Better npTicket logging
This commit is contained in:
parent
b13dea6306
commit
4c95c2bea6
1 changed files with 25 additions and 3 deletions
|
@ -2,6 +2,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Text.Json;
|
||||||
using Kettu;
|
using Kettu;
|
||||||
using LBPUnion.ProjectLighthouse.Helpers;
|
using LBPUnion.ProjectLighthouse.Helpers;
|
||||||
using LBPUnion.ProjectLighthouse.Helpers.Extensions;
|
using LBPUnion.ProjectLighthouse.Helpers.Extensions;
|
||||||
|
@ -89,8 +90,9 @@ public class NPTicket
|
||||||
reader.ReadTicketString(); // Domain
|
reader.ReadTicketString(); // Domain
|
||||||
|
|
||||||
// Title ID, kinda..
|
// Title ID, kinda..
|
||||||
// Data: "UP9000-BCUS98245_00
|
// Data: UP9000-BCUS98245_00
|
||||||
string titleId = reader.ReadTicketString();
|
// We need to chop this to get the titleId we're looking for
|
||||||
|
string titleId = reader.ReadTicketString(); // Read the string
|
||||||
titleId = titleId.Substring(7); // Trim UP9000-
|
titleId = titleId.Substring(7); // Trim UP9000-
|
||||||
titleId = titleId.Substring(0, titleId.Length - 3); // Trim _00 at the end
|
titleId = titleId.Substring(0, titleId.Length - 3); // Trim _00 at the end
|
||||||
|
|
||||||
|
@ -121,10 +123,30 @@ public class NPTicket
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
Logger.Log("npTicket data:", LoggerLevelLogin.Instance);
|
||||||
|
foreach (string line in JsonSerializer.Serialize(npTicket).Split('\n'))
|
||||||
|
{
|
||||||
|
Logger.Log(line, LoggerLevelLogin.Instance);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return npTicket;
|
return npTicket;
|
||||||
}
|
}
|
||||||
catch
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
|
Logger.Log("Failed to read npTicket!", LoggerLevelLogin.Instance);
|
||||||
|
Logger.Log("Either this is spam data, or the more likely that this is a bug.", LoggerLevelLogin.Instance);
|
||||||
|
Logger.Log
|
||||||
|
(
|
||||||
|
"Please report the following exception to our issue tracker at https://github.com/LBPUnion/project-lighthouse/issues",
|
||||||
|
LoggerLevelLogin.Instance
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach (string line in e.ToDetailedException().Split('\n'))
|
||||||
|
{
|
||||||
|
Logger.Log(line, LoggerLevelLogin.Instance);
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue