Fix PlayerEvent being completely broken

Fix the name being passed as the type when deserialising the event, the
stats being missing, and incorrect parameters passed to plugins.
This commit is contained in:
Hornwitser committed 2023-11-28 14:28:22 +01:00
1 parent b9c3458cc2
commit e3e5867d60
5 files changed
+30 -20

No files matched your search

+2 -1
View File
@@ -289,11 +289,12 @@ export default class HostConnection extends BaseConnection {
user.recalculatePlayerStats();
this._controller.userUpdated(user);
let instance = this._controller.instances!.get(instanceId);
let instance = this._controller.instances!.get(instanceId)!;
await lib.invokeHook(this._controller.plugins, "onPlayerEvent", instance, {
type: event.type,
name: event.name,
reason: event.reason,
stats: event.stats,
});
}
}