feat(reference): add indexed readers and station source
This commit is contained in:
@@ -21,6 +21,7 @@ function zipFixture(options: { duplicateSystems?: boolean; duplicateSystemField?
|
||||
'mapConstellations.jsonl': '{"_key":2,"name":{"en":"Constellation"},"regionID":1}\n',
|
||||
'mapSolarSystems.jsonl': options.duplicateSystemField ? '{"_key":3,"_key":3,"name":{"en":"System"},"constellationID":2,"position":{"x":1,"y":2,"z":3},"securityStatus":0.5}\n' : '{"_key":3,"name":{"en":"System"},"constellationID":2,"position":{"x":1,"y":2,"z":3},"securityStatus":0.5}\n',
|
||||
'mapStargates.jsonl': '{"_key":4,"solarSystemID":3,"destination":{"solarSystemID":3,"stargateID":4}}\n',
|
||||
'npcStations.jsonl': '{"_key":60000001,"solarSystemID":3,"typeID":1,"ownerID":2,"position":{"x":1,"y":2,"z":3}}\n',
|
||||
};
|
||||
const records = Object.entries(rows).map(([name, value]) => ({ name, data: encoder.encode(options.duplicateSystems && name === 'mapSolarSystems.jsonl' ? value + value : value) }));
|
||||
const locals: Uint8Array[] = []; const centrals: Uint8Array[] = []; let offset = 0;
|
||||
@@ -58,6 +59,15 @@ describe('production archive boundaries', () => {
|
||||
await expect(collectTarMembers(chunks(oneZero), 'test', new Set(['meta.json']), new Set(['meta.json']))).rejects.toThrow(/two-block/);
|
||||
});
|
||||
|
||||
test('imports verified NPC station records when the CCP SDE member is present', async () => {
|
||||
const directory = await mkdtemp(join(tmpdir(), 'eden-reference-stations-'));
|
||||
try {
|
||||
const path = join(directory, 'stations.zip'); await writeFile(path, zipFixture());
|
||||
const universe = await ccpUniverse(path);
|
||||
expect(universe.stations).toEqual({ '60000001': { station_id: 60000001, system_id: 3, type_id: 1, owner_id: 2, position: { x: 1, y: 2, z: 3 } } });
|
||||
} finally { await rm(directory, { recursive: true, force: true }); }
|
||||
});
|
||||
|
||||
test('rejects duplicate CCP keys and ZIP CRC/size mismatches', async () => {
|
||||
const directory = await mkdtemp(join(tmpdir(), 'eden-reference-zip-'));
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user