Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

WIP: Mod loading #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions mods/debug_mod/mod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mod:
name: Debug Mod
author: kiobu
entrypoint: src/init.ts
8 changes: 8 additions & 0 deletions mods/debug_mod/src/init.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Mod } from 'src/core/mods/mod.types';

export class MyMod extends Mod {
constructor() {
super();
console.log('Hello world.');
}
}
164 changes: 138 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"compression": "^1.7.4",
"fs-extra": "^10.0.0",
"hbs": "^4.1.2",
"js-yaml": "^4.1.0",
"pkg": "^5.4.0",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
Expand Down
3 changes: 2 additions & 1 deletion src/core/core.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import { Module } from '@nestjs/common';
import { SystemModule } from './system/system.module';
import { CommonModule } from './common/common.module';
import { GameModules } from 'src/game/game.modules';
import { ModsModule } from './mods/mods.module';

/*
* The module that contains all game data.
*/

@Module({
imports: [SystemModule, CommonModule, GameModules],
imports: [SystemModule, CommonModule, GameModules, ModsModule],
})
export class CoreModule {}
4 changes: 2 additions & 2 deletions src/core/database/database.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
LocationsShard,
ProfilesShard,
} from './shards/shard.types';
import { IO } from '../common/util/io/io.service';

@Injectable()
export class DatabaseService {
Expand All @@ -18,11 +17,12 @@ export class DatabaseService {
public globals: Record<string, any>;

constructor() {
this.logger.debug('Loading database...');
this.itemsShard = new ItemsShard();
this.locationsShard = new LocationsShard();
this.profilesShard = new ProfilesShard();
this.globals = new GlobalsShard();

this.logger.debug('Loaded database');
this.logger.debug('Loaded database.');
}
}
Loading