Remove collection of player locale (#508)

This commit is contained in:
Cooldude2606 authored and GitHub committed 2026-10-16 13:55:06 +01:00
1 parent 8d7d5ff10f
commit a7e66ccdd4
17 files changed
+7 -163

No files matched your search

-34
View File
@@ -134,8 +134,6 @@ export class PlayerRecord {
public id: string,
/** Shown to everyone when the player joins */
public joinMessage?: string,
/** The language of their game, such as "en" or "pt-BR" */
public locale?: string,
/** Toolbar state from Gui.toolbar.get_state, json compressed with helpers.encode_string */
public toolbar?: string,
public updatedAtMs: number = 0,
@@ -145,7 +143,6 @@ export class PlayerRecord {
static jsonSchema = Type.Object({
id: Type.String(),
join_message: Type.Optional(Type.String()),
locale: Type.Optional(Type.String()),
toolbar: Type.Optional(Type.String()),
updated_at_ms: Type.Optional(Type.Number()),
is_deleted: Type.Optional(Type.Boolean()),
@@ -156,9 +153,6 @@ export class PlayerRecord {
if (this.joinMessage) {
json.join_message = this.joinMessage;
}
if (this.locale) {
json.locale = this.locale;
}
if (this.toolbar) {
json.toolbar = this.toolbar;
}
@@ -175,7 +169,6 @@ export class PlayerRecord {
return new this(
json.id,
json.join_message,
json.locale,
json.toolbar,
json.updated_at_ms ?? 0,
json.is_deleted ?? false,
@@ -257,33 +250,6 @@ export class JoinMessageSetRequest {
}
}
/** The language a player's game uses, sent when they join and when they change it. */
export class PlayerLocaleEvent {
declare ["constructor"]: typeof PlayerLocaleEvent;
static plugin = "exp_scenario" as const;
static type = "event" as const;
static src = "instance" as const;
static dst = "controller" as const;
constructor(
public playerName: string,
public locale: string,
) {}
static jsonSchema = Type.Object({
player_name: Type.String(),
locale: Type.String(),
});
toJSON() {
return { player_name: this.playerName, locale: this.locale };
}
static fromJSON(json: Static<typeof this.jsonSchema>) {
return new this(json.player_name, json.locale);
}
}
/** The toolbar of a player, sent when they leave. */
export class PlayerToolbarEvent {
declare ["constructor"]: typeof PlayerToolbarEvent;