mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-03 02:28:39 +00:00
Log unimplemented ticket version
This commit is contained in:
parent
4c95c2bea6
commit
f26cfaa7fc
1 changed files with 14 additions and 3 deletions
|
@ -33,13 +33,14 @@ public class NPTicket
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static NPTicket? CreateFromBytes(byte[] data)
|
public static NPTicket? CreateFromBytes(byte[] data)
|
||||||
{
|
{
|
||||||
|
NPTicket npTicket = new();
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
if (data[0] == 'u' && ServerStatics.IsUnitTesting)
|
if (data[0] == 'u' && ServerStatics.IsUnitTesting)
|
||||||
{
|
{
|
||||||
string dataStr = Encoding.UTF8.GetString(data);
|
string dataStr = Encoding.UTF8.GetString(data);
|
||||||
if (dataStr.StartsWith("unitTestTicket"))
|
if (dataStr.StartsWith("unitTestTicket"))
|
||||||
{
|
{
|
||||||
NPTicket npTicket = new()
|
npTicket = new NPTicket
|
||||||
{
|
{
|
||||||
IssuerId = 0,
|
IssuerId = 0,
|
||||||
ticketVersion = new Version(0, 0),
|
ticketVersion = new Version(0, 0),
|
||||||
|
@ -57,7 +58,6 @@ public class NPTicket
|
||||||
#endif
|
#endif
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
NPTicket npTicket = new();
|
|
||||||
using MemoryStream ms = new(data);
|
using MemoryStream ms = new(data);
|
||||||
using TicketReader reader = new(ms);
|
using TicketReader reader = new(ms);
|
||||||
|
|
||||||
|
@ -133,13 +133,24 @@ public class NPTicket
|
||||||
|
|
||||||
return npTicket;
|
return npTicket;
|
||||||
}
|
}
|
||||||
|
catch(NotImplementedException)
|
||||||
|
{
|
||||||
|
Logger.Log($"The ticket version {npTicket.ticketVersion} is not implemented yet.", LoggerLevelLogin.Instance);
|
||||||
|
Logger.Log
|
||||||
|
(
|
||||||
|
"Please let us know that this is a ticket version that is actually used on our issue tracker at https://github.com/LBPUnion/project-lighthouse/issues !",
|
||||||
|
LoggerLevelLogin.Instance
|
||||||
|
);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
Logger.Log("Failed to read npTicket!", LoggerLevelLogin.Instance);
|
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("Either this is spam data, or the more likely that this is a bug.", LoggerLevelLogin.Instance);
|
||||||
Logger.Log
|
Logger.Log
|
||||||
(
|
(
|
||||||
"Please report the following exception to our issue tracker at https://github.com/LBPUnion/project-lighthouse/issues",
|
"Please report the following exception to our issue tracker at https://github.com/LBPUnion/project-lighthouse/issues!",
|
||||||
LoggerLevelLogin.Instance
|
LoggerLevelLogin.Instance
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue