1
0
Fork 0

[node] fixed and optimized contracting

This commit is contained in:
Julien Dessaux 2024-05-17 22:01:29 +02:00
parent 6504e44ffa
commit ccbfd9deb9
Signed by: adyxax
GPG key ID: F92E51B86E07177E
5 changed files with 61 additions and 44 deletions

View file

@ -5,7 +5,7 @@ import {
} from '../lib/api.ts';
import { Agent, initAgent, setAgent } from '../lib/agent.ts';
import { Contract } from '../lib/contracts.ts';
import { Ship } from '../lib/ships.ts';
import { initShips, Ship } from '../lib/ships.ts';
import * as libContracts from '../lib/contracts.ts';
const symbol = process.env.NODE_ENV === 'test' ? 'ADYXAX-0' : 'ADYXAX-JS';
@ -28,6 +28,7 @@ export async function init(): Promise<void> {
case 4111: // 4111 means the agent symbol has already been claimed so no server reset happened
// TODO await agents.agents();
await initAgent();
await initShips();
return;
default:
throw json;
@ -36,4 +37,5 @@ export async function init(): Promise<void> {
db.reset();
dbTokens.addToken(json.data.token);
setAgent(json.data.agent);
await initShips();
}