assets.bodies name resolution fails for creatures with no parameterless constructor (MissingMethodException) #40
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Split out of #39 ("Related findings"), which asked for this to be its own issue.
Summary
During an Asset Bridge catalogue /
assets.bodiesimport, body→name resolution throwsMissingMethodExceptionfor every creature type whose only public constructor is the[Constructable]one (args) — there is no parameterless constructor to invoke.Observed on the live Linux/Mono shard, same import as #39:
…and the same for
Navrey,TribeChieftan,TribeShaman,TribeWarrior. There arealmost certainly more types in this class than the five that happened to be touched by
that one import.
Root cause
overlay/Scripts/Custom/Bridge/BridgeBodies.cs:215resolves a name to its body id byinstantiating the mobile and reading
creature.Body.BodyID:Activator.CreateInstance(type)with no args needs a public parameterless constructor.Many ServUO creatures declare only
public GreatApe() : base(...)marked[Constructable](plus the protected
(Serial)deserialization ctor), so there is no parameterless ctor andthe call throws. The surrounding
try/catchalready logs the line and setsstatus = "failed"(so the import does not crash), but these creatures get no body→name mapping —their names never resolve through this path.
This is unrelated to GDI+ (#39) and independent of platform — it would throw on Windows too;
it simply surfaced during the same Linux import.
Possible directions (to be scoped before building)
[Constructable]constructor using sensible/default arguments, or theconstructor with the fewest parameters, instead of requiring a parameterless one.
FormatterServices.GetUninitializedObject(type)to get an instance without running aconstructor, then read
Body— butBodyis usually assigned in the constructor, so anuninitialized object may report body 0. Needs verification per type.
approach
uofiddler-client-extractionnotes for the atlas).Each has trade-offs (side effects of running a real constructor vs. an uninitialized object
that never sets
Body); pick one with design approval. Low urgency — the failure is alreadycaught and logged, it only costs name resolution for the affected creatures.