Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async start() {
this.emit('info', `Server version ${require('screeps').version}`);
if (!this.connected) {
await this.connect();
}
this.emit('info', 'Starting engine processes.');
this.startProcess('engine_runner', path.resolve(path.dirname(require.resolve('@screeps/engine')), 'runner.js'), {
DRIVER_MODULE: '@screeps/driver',
MODFILE: path.resolve(this.opts.path, DB_FILE),
STORAGE_PORT: this.opts.port,
});
this.startProcess('engine_processor', path.resolve(path.dirname(require.resolve('@screeps/engine')), 'processor.js'), {
DRIVER_MODULE: '@screeps/driver',
MODFILE: path.resolve(this.opts.path, DB_FILE),
STORAGE_PORT: this.opts.port,
});
return this;
}