mirror of
https://github.com/raphaeIl/Novaria.git
synced 2025-12-17 17:04:47 +01:00
updated protos, hardcoded gacha
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user