updated protos, hardcoded gacha

This commit is contained in:
raphaeIl
2025-05-27 15:04:26 -04:00
parent 289a4d661d
commit a6a9c98b9d
46 changed files with 19007 additions and 9293 deletions

View File

@@ -61,13 +61,21 @@ namespace Novaria.Common.Core
object parserInstance = parserProperty.GetValue(null);
MethodInfo parseFromMethod = parserInstance.GetType().GetMethod("ParseFrom", new[] { typeof(byte[]) });
IMessage parsedMessage = (IMessage)parseFromMethod.Invoke(parserInstance, new object[] { packet.msgBody });
if (parsedMessage == null)
IMessage parsedMessage = null;
try
{
parsedMessage = (IMessage)parseFromMethod.Invoke(parserInstance, new object[] { packet.msgBody });
} catch (Exception ex)
{
throw new InvalidOperationException("Failed to parse message.");
Log.Error($"Failed to parse message of type {targetType.Name}: {ex.Message}");
}
//if (parsedMessage == null)
//{
// throw new InvalidOperationException("Failed to parse message.");
//}
return parsedMessage;
}