mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 15:10:43 +00:00
debug
This commit is contained in:
@@ -39,7 +39,8 @@ const TEAM_WEIGHTS: { config: TeamCountConfig; weight: number }[] = [
|
||||
export class MapPlaylist {
|
||||
private recentMaps: GameMapType[] = [];
|
||||
private modeSequenceIndex = 0;
|
||||
private readonly maxRecentMaps = 5;
|
||||
// TODO: Adjust based on feedback
|
||||
private readonly maxRecentMaps = 0; // e.g., 5
|
||||
private readonly modeSequence: GameMode[];
|
||||
|
||||
constructor(private disableTeams: boolean = false) {
|
||||
|
||||
@@ -80,6 +80,8 @@ const publicLobbyMapSet = new Set(publicLobbyMaps);
|
||||
const mapVotesByUser = new Map<string, Set<GameMapType>>();
|
||||
const mapVoteConnectionsByUser = new Map<string, Set<WebSocket>>();
|
||||
const mapVoteUserByConnection = new Map<WebSocket, string>();
|
||||
// TODO: Adjust based on feedback
|
||||
const MAP_VOTE_WEIGHT = 10000000000; // for debug purposes, make votes very impactful 'w'
|
||||
|
||||
const MapVoteMessageSchema = z.object({
|
||||
type: z.literal("map_vote"),
|
||||
@@ -180,7 +182,7 @@ function collectMapVoteWeights(): Map<GameMapType, number> {
|
||||
const weights = new Map<GameMapType, number>();
|
||||
for (const maps of mapVotesByUser.values()) {
|
||||
for (const map of maps) {
|
||||
weights.set(map, (weights.get(map) ?? 0) + 1);
|
||||
weights.set(map, (weights.get(map) ?? 0) + MAP_VOTE_WEIGHT);
|
||||
}
|
||||
}
|
||||
return weights;
|
||||
|
||||
Reference in New Issue
Block a user