mirror of
https://github.com/Anime-Game-Servers/Weedwacker.git
synced 2024-10-07 09:54:46 +00:00
fix avatar proudskill.addprop exception
This commit is contained in:
parent
ca0f419dfc
commit
645fa0bd2a
@ -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
|
||||
|
@ -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] =
|
||||
|
Loading…
Reference in New Issue
Block a user