mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-04 18:46:12 +00:00
Extend friend grouping to the lobby team preview
The preview was calling assignTeams without friend data, so the team layout shown in the lobby could differ from the layout the game actually started with. Wire friends through ClientInfo so the preview matches. Extract the publicId→clientID translation used by both start() and gameInfo() into buildFriendsLookup() to remove the duplicate.
This commit is contained in:
@@ -156,6 +156,7 @@ const ClientInfoSchema = z.object({
|
||||
clientID: z.string(),
|
||||
username: UsernameSchema,
|
||||
clanTag: ClanTagSchema,
|
||||
friends: z.array(z.string()).optional(),
|
||||
});
|
||||
|
||||
export const GameInfoSchema = z.object({
|
||||
@@ -192,6 +193,7 @@ export interface ClientInfo {
|
||||
clientID: ClientID;
|
||||
username: string;
|
||||
clanTag: string | null;
|
||||
friends?: ClientID[];
|
||||
}
|
||||
export enum LogSeverity {
|
||||
Debug = "DEBUG",
|
||||
|
||||
Reference in New Issue
Block a user