mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 23:33:12 +09:00
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:
1 parent
b9c3458cc2
commit
e3e5867d60
5 files changed
+30
-20
No files matched your search
@@ -853,10 +853,10 @@ export class InstancePlayerUpdateEvent {
|
||||
static dst = "controller" as const;
|
||||
|
||||
constructor(
|
||||
public type: string,
|
||||
public type: "join" | "leave" | "import",
|
||||
public name: string,
|
||||
public stats: PlayerStats,
|
||||
public reason?: string,
|
||||
public stats?: PlayerStats,
|
||||
) { }
|
||||
|
||||
static jsonSchema = Type.Object({
|
||||
@@ -867,6 +867,6 @@ export class InstancePlayerUpdateEvent {
|
||||
});
|
||||
|
||||
static fromJSON(json: Static<typeof this.jsonSchema>) {
|
||||
return new this(json.name, json.name, json.reason, PlayerStats.fromJSON(json.stats));
|
||||
return new this(json.type, json.name, PlayerStats.fromJSON(json.stats), json.reason);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user