Skip to content

Commit

Permalink
fix(game/server): add missing standalone bridge instance
Browse files Browse the repository at this point in the history
  • Loading branch information
itschip committed Jan 6, 2024
1 parent 0b23d2c commit 8a74740
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions apps/game/server/bridge/framework-strategy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { mainLogger } from '../sv_logger';
import { ESXFramework } from './esx/esx-server';
import { QBCoreFramework } from './qb/qbcore-server';
import { QBXFramework } from './qbx/qbx-server';
import { Standalone } from './standalone/standalone-server';

export interface Strategy {
onStart(): void;
Expand All @@ -22,10 +24,10 @@ export class FrameworkStrategy {
this.strategy = new ESXFramework();
break;
case 'standalone':
this.strategy = null;
this.strategy = new Standalone();
break;
default:
this.strategy = null;
this.strategy = new Standalone();
break;
}
}
Expand All @@ -39,11 +41,15 @@ export class FrameworkStrategy {
}
}

const framework = GetConvar('npwd:framework', 'standalone') as 'qbcore' | 'qbx' | 'esx' | 'standalone';
const framework = GetConvar('npwd:framework', 'standalone') as
| 'qbcore'
| 'qbx'
| 'esx'
| 'standalone';

const strategy = new FrameworkStrategy(framework);

if (strategy) {
strategy.init();
strategy.onStart();
}
}
4 changes: 2 additions & 2 deletions apps/game/server/bridge/standalone/standalone-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ export class Standalone implements Strategy {
}

onStart(): void {
return;
return;
}
}
}

0 comments on commit 8a74740

Please sign in to comment.