-
+
+
OpenFront (ALPHA)
+
+
+
+
+
+
diff --git a/src/core/configuration/Config.ts b/src/core/configuration/Config.ts
index 3b5d94270..27b22cda6 100644
--- a/src/core/configuration/Config.ts
+++ b/src/core/configuration/Config.ts
@@ -4,12 +4,13 @@ import {devConfig} from "./DevConfig";
import {defaultConfig} from "./DefaultConfig";
export function getConfig(): Config {
- if (process.env.GAME_ENV == 'prod') {
- console.log('Using prod config')
- return defaultConfig
- } else {
+ // TODO: 'prod' not found in prod env
+ if (process.env.GAME_ENV == 'dev') {
console.log('Using dev config')
return devConfig
+ } else {
+ console.log('Using prod config')
+ return defaultConfig
}
}
diff --git a/src/global.d.ts b/src/global.d.ts
index 947f19163..648a061c2 100644
--- a/src/global.d.ts
+++ b/src/global.d.ts
@@ -1,4 +1,17 @@
declare module '*.png' {
const content: string;
export default content;
-}
\ No newline at end of file
+}
+declare module '*.jpg' {
+ const value: string;
+ export default value;
+}
+
+declare module '*.jpeg' {
+ const value: string;
+ export default value;
+}
+declare module '*.svg' {
+ const value: string;
+ export default value;
+}
diff --git a/src/server/Lobby.ts b/src/server/Lobby.ts
new file mode 100644
index 000000000..cf0256e59
--- /dev/null
+++ b/src/server/Lobby.ts
@@ -0,0 +1,21 @@
+import {ClientID} from "../core/Schemas";
+import {Client} from "./Client";
+
+export class Lobby {
+
+ public clients: Map
= new Map()
+ private startGameTs: number
+
+
+ constructor(public readonly id: string, durationMs: number) {
+ this.startGameTs = Date.now() + durationMs
+ }
+
+ public addClient(client: Client) {
+ this.clients.set(client.id, client)
+ }
+
+ public isExpired(now: number): boolean {
+ return now > this.startGameTs
+ }
+}
\ No newline at end of file
diff --git a/webpack.config.js b/webpack.config.js
index da807a51c..585d0b230 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -28,6 +28,10 @@ export default (env, argv) => {
generator: {
filename: 'images/[hash][ext][query]'
}
+ },
+ {
+ test: /\.svg$/,
+ type: 'asset/inline',
}
],
},