mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-07 19:21:30 +00:00
fixed string | null
This commit is contained in:
+2
-2
@@ -374,7 +374,7 @@ export const PlayerSchema = z.object({
|
|||||||
clientID: ID,
|
clientID: ID,
|
||||||
username: SafeString,
|
username: SafeString,
|
||||||
flag: SafeString.optional(),
|
flag: SafeString.optional(),
|
||||||
pattern: SafeString.nullable().optional(),
|
pattern: SafeString.nullable(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const GameStartInfoSchema = z.object({
|
export const GameStartInfoSchema = z.object({
|
||||||
@@ -446,7 +446,7 @@ export const ClientJoinMessageSchema = z.object({
|
|||||||
lastTurn: z.number(), // The last turn the client saw.
|
lastTurn: z.number(), // The last turn the client saw.
|
||||||
username: SafeString,
|
username: SafeString,
|
||||||
flag: SafeString.nullable(),
|
flag: SafeString.nullable(),
|
||||||
pattern: SafeString.nullable().optional(),
|
pattern: SafeString.nullable(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const ClientMessageSchema = z.union([
|
export const ClientMessageSchema = z.union([
|
||||||
|
|||||||
@@ -304,7 +304,7 @@ export class PlayerInfo {
|
|||||||
public readonly clan: string | null;
|
public readonly clan: string | null;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public readonly pattern: string | null | undefined,
|
public readonly pattern: string | null,
|
||||||
public readonly flag: string | undefined,
|
public readonly flag: string | undefined,
|
||||||
public readonly name: string,
|
public readonly name: string,
|
||||||
public readonly playerType: PlayerType,
|
public readonly playerType: PlayerType,
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ export interface PlayerUpdate {
|
|||||||
type: GameUpdateType.Player;
|
type: GameUpdateType.Player;
|
||||||
nameViewData?: NameViewData;
|
nameViewData?: NameViewData;
|
||||||
clientID: ClientID | null;
|
clientID: ClientID | null;
|
||||||
pattern: string | undefined | null;
|
pattern: string | null;
|
||||||
flag: string | undefined;
|
flag: string | undefined;
|
||||||
name: string;
|
name: string;
|
||||||
displayName: string;
|
displayName: string;
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ export class PlayerView {
|
|||||||
return this.data.flag;
|
return this.data.flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
pattern(): string | undefined | null {
|
pattern(): string | null {
|
||||||
return this.data.pattern;
|
return this.data.pattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export class PlayerImpl implements Player {
|
|||||||
public _units: Unit[] = [];
|
public _units: Unit[] = [];
|
||||||
public _tiles: Set<TileRef> = new Set();
|
public _tiles: Set<TileRef> = new Set();
|
||||||
|
|
||||||
private _pattern: string | undefined | null;
|
private _pattern: string | null;
|
||||||
private _flag: string | undefined;
|
private _flag: string | undefined;
|
||||||
private _name: string;
|
private _name: string;
|
||||||
private _displayName: string;
|
private _displayName: string;
|
||||||
@@ -180,7 +180,7 @@ export class PlayerImpl implements Player {
|
|||||||
return this._smallID;
|
return this._smallID;
|
||||||
}
|
}
|
||||||
|
|
||||||
pattern(): string | undefined | null {
|
pattern(): string | null {
|
||||||
return this._pattern;
|
return this._pattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,6 @@ export class Client {
|
|||||||
public readonly username: string,
|
public readonly username: string,
|
||||||
public readonly ws: WebSocket,
|
public readonly ws: WebSocket,
|
||||||
public readonly flag: string | null,
|
public readonly flag: string | null,
|
||||||
public readonly pattern: string | undefined | null,
|
public readonly pattern: string | null,
|
||||||
) {}
|
) {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user