fix avatar proudskill.addprop exception

This commit is contained in:
akatatsu27 2022-10-27 21:20:46 +03:00
parent ca0f419dfc
commit 645fa0bd2a
2 changed files with 7 additions and 4 deletions

View File

@ -77,13 +77,13 @@ namespace Weedwacker.GameServer
var typ = AppDomain.CurrentDomain.GetAssemblies().
SingleOrDefault(assembly => assembly.GetName().Name == "Shared").GetTypes().First(t => t.Name == $"{Enum.GetName(typeof(OpCode), opcode)}"); //get the type using the packet name
var descriptor = (MessageDescriptor)typ.GetProperty("Descriptor", BindingFlags.Public | BindingFlags.Static).GetValue(null, null); // get the static property Descriptor
var packet = descriptor.Parser.ParseFrom(payload); // parse the byte array to Person
var packet = descriptor.Parser.ParseFrom(payload);
var formatter = Google.Protobuf.JsonFormatter.Default;
var asJson = formatter.Format(packet);
Logger.DebugWriteLine($"{sendOrRecv}: {Enum.GetName(typeof(OpCode), opcode)}({opcode})\r\n{asJson}");
if (GameServer.Configuration.Server.KeepLog)
{
File.WriteAllText($"{GameServer.Configuration.Server.LogLocation}\\{LogIndex++}{packet.GetType().Name}.json", JValue.Parse(asJson).ToString(Formatting.Indented));
File.WriteAllText($"{GameServer.Configuration.Server.LogLocation}\\{LogIndex++}_{packet.GetType().Name}.json", JValue.Parse(asJson).ToString(Formatting.Indented));
}
}
#endif

View File

@ -513,11 +513,14 @@ namespace Weedwacker.GameServer.Systems.Avatar
foreach (ProudSkillData proudSkill in GetCurSkillDepot().InherentProudSkillOpens)
{
// Add properties from this proud skill to our avatar
if (proudSkill.addProps != null)
{
foreach (FightPropData prop in proudSkill.addProps)
{
FightProp[prop.propType] = FightProp.GetValueOrDefault(prop.propType) + prop.value;
}
}
}
// Set % stats
FightProp[FightProperty.FIGHT_PROP_MAX_HP] =