Support game-wide autoscaling rules with per-map targets
This commit is contained in:
@@ -3,7 +3,7 @@ import { getServer } from '../fleet/servers.js';
|
||||
import { mapIdentity } from './snapshot.js';
|
||||
|
||||
export function scalingOwner(game: string, mapSlug: string): string | null {
|
||||
return (db().prepare('SELECT id FROM autoscaling_policies WHERE game=? AND map_slug=? AND owns_map=1').get(game, mapSlug) as { id: string } | undefined)?.id ?? null;
|
||||
return (db().prepare("SELECT id FROM autoscaling_policies WHERE game=? AND (map_slug=? OR map_slug='*' OR ?='*') AND owns_map=1").get(game, mapSlug, mapSlug) as { id: string } | undefined)?.id ?? null;
|
||||
}
|
||||
export function scalingOwnershipBlocker(server: string): string | null {
|
||||
const identity = mapIdentity(getServer(server) ?? { name: server });
|
||||
|
||||
Reference in New Issue
Block a user