Remove T5 bank and database modules and standardize script names
This commit is contained in:
@@ -42,7 +42,7 @@ function functions(source) {
|
||||
}
|
||||
|
||||
function engine(game) {
|
||||
const source = readFileSync(new URL(`${game}/${game === 't6' ? 'tws_t6_leaderboard' : 'tws_leaderboard'}.gsc`, root), 'utf8');
|
||||
const source = readFileSync(new URL(`${game}/tws_${game}_leaderboard.gsc`, root), 'utf8');
|
||||
const all = functions(source);
|
||||
const excluded = new Set(['lb_worker', 'lb_welcome', 'lb_get', 'lb_collect', 'lb_log', 'lb_show_hud', 'lb_hud_help_visible', 'lb_hud_end_game', 'lb_hud_destroy']);
|
||||
const table = [];
|
||||
@@ -89,7 +89,7 @@ for (const game of ['t5', 't6']) {
|
||||
const { context: c, source, all, dvars, responses, queries } = engine(game);
|
||||
const option = mapOption(game);
|
||||
check(`${game} exactly one connect listener across modules`, () => {
|
||||
const common = readFileSync(new URL(game === 't5' ? 't5/tws_common.gsc' : 't6/tws_t6_common.gsc', root), 'utf8');
|
||||
const common = readFileSync(new URL(`${game}/tws_${game}_common.gsc`, root), 'utf8');
|
||||
assert.equal((common.match(/waittill\("connected"/g) ?? []).length, 1);
|
||||
assert(!source.includes('waittill("connected"'));
|
||||
assert(!all.get('lb_welcome').includes('spawned_player'));
|
||||
@@ -212,11 +212,11 @@ for (const game of ['t5', 't6']) {
|
||||
assert.equal(responses.length, 0, `${game} unused responses`);
|
||||
}
|
||||
check('paired data helpers stay identical', () => {
|
||||
const t5 = functions(readFileSync(new URL('t5/tws_leaderboard.gsc', root), 'utf8'));
|
||||
const t5 = functions(readFileSync(new URL('t5/tws_t5_leaderboard.gsc', root), 'utf8'));
|
||||
const t6 = functions(readFileSync(new URL('t6/tws_t6_leaderboard.gsc', root), 'utf8'));
|
||||
for (const [name, fn] of t5) {
|
||||
if (!['lb_selection', 'lb_welcome', 'lb_get', 'lb_log'].includes(name)) {
|
||||
const normalized = t6.get(name).replaceAll('scripts\\zm\\tws_t6_common::', 'scripts\\sp\\tws_common::');
|
||||
const normalized = t6.get(name).replaceAll('scripts\\zm\\tws_t6_common::', 'scripts\\sp\\tws_t5_common::');
|
||||
assert.equal(normalized, fn, name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user