mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-16 08:53:25 +00:00
Merge branch 'v26'
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Config } from "../configuration/Config";
|
||||
import { AllPlayersStats, ClientID } from "../Schemas";
|
||||
import { getClanTag } from "../Util";
|
||||
import { GameMap, TileRef } from "./GameMap";
|
||||
import {
|
||||
GameUpdate,
|
||||
@@ -407,13 +408,7 @@ export class PlayerInfo {
|
||||
public readonly id: PlayerID,
|
||||
public readonly nation?: Nation | null,
|
||||
) {
|
||||
// Compute clan from name
|
||||
if (!name.includes("[") || !name.includes("]")) {
|
||||
this.clan = null;
|
||||
} else {
|
||||
const clanMatch = name.match(/\[([a-zA-Z0-9]{2,5})\]/);
|
||||
this.clan = clanMatch ? clanMatch[1].toUpperCase() : null;
|
||||
}
|
||||
this.clan = getClanTag(name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user