Limit corrupted battle save payloads
This commit is contained in:
@@ -39,9 +39,13 @@ try {
|
||||
['invalid rosterTab', { rosterTab: 'neutral' }],
|
||||
['invalid actedUnitIds', { actedUnitIds: 'liu-bei' }],
|
||||
['unknown acted unit id', { actedUnitIds: ['ghost-unit'] }],
|
||||
['duplicate acted unit id', { actedUnitIds: ['liu-bei', 'liu-bei'] }],
|
||||
['invalid battleLog', { battleLog: 'hit' }],
|
||||
['too many battle log entries', { battleLog: Array.from({ length: 11 }, (_, index) => `Log ${index}`) }],
|
||||
['too long battle log entry', { battleLog: ['x'.repeat(97)] }],
|
||||
['invalid attackIntents', { attackIntents: [{ attackerId: 'liu-bei' }] }],
|
||||
['unknown attack intent unit id', { attackIntents: [{ attackerId: 'liu-bei', targetId: 'ghost-unit' }] }],
|
||||
['duplicate attack intent attacker id', { attackIntents: [{ attackerId: 'liu-bei', targetId: 'rebel-1' }, { attackerId: 'liu-bei', targetId: 'rebel-1' }] }],
|
||||
['invalid units array', { units: {} }],
|
||||
['invalid unit hp', { units: patchUnit(0, { hp: 99, maxHp: 30 }) }],
|
||||
['invalid unit x', { units: patchUnit(0, { x: 12 }) }],
|
||||
@@ -55,8 +59,10 @@ try {
|
||||
['unknown item stock item id', { itemStocks: { 'liu-bei': { phantomItem: 1 } } }],
|
||||
['invalid buff turns', { battleBuffs: [{ ...validState.battleBuffs[0], turns: 0 }] }],
|
||||
['unknown buff unit id', { battleBuffs: [{ ...validState.battleBuffs[0], unitId: 'ghost-unit' }] }],
|
||||
['duplicate buff unit id', { battleBuffs: [validState.battleBuffs[0], { ...validState.battleBuffs[0] }] }],
|
||||
['invalid status kind', { battleStatuses: [{ ...validState.battleStatuses[0], kind: 'poison' }] }],
|
||||
['unknown status unit id', { battleStatuses: [{ ...validState.battleStatuses[0], unitId: 'ghost-unit' }] }],
|
||||
['duplicate status unit kind', { battleStatuses: [validState.battleStatuses[0], { ...validState.battleStatuses[0] }] }],
|
||||
['invalid stats shape', { battleStats: { 'liu-bei': { damageDealt: 10 } } }],
|
||||
['unknown stats unit id', { battleStats: { 'ghost-unit': validState.battleStats['liu-bei'] } }],
|
||||
['invalid enemy usable keys', { enemyUsableUseKeys: [1] }],
|
||||
@@ -64,6 +70,7 @@ try {
|
||||
['wrong battle enemy usable key', { enemyUsableUseKeys: ['other-battle:rebel-1:roar'] }],
|
||||
['unknown enemy usable unit id', { enemyUsableUseKeys: ['first-battle-zhuo-commandery:ghost-unit:roar'] }],
|
||||
['unknown enemy usable id', { enemyUsableUseKeys: ['first-battle-zhuo-commandery:rebel-1:phantom'] }],
|
||||
['duplicate enemy usable key', { enemyUsableUseKeys: ['first-battle-zhuo-commandery:rebel-1:roar', 'first-battle-zhuo-commandery:rebel-1:roar'] }],
|
||||
['invalid triggered events', { triggeredBattleEvents: [1] }]
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user