dockerized
This commit is contained in:
parent
2b54efb604
commit
d322442022
8
Dockerfile
Normal file
8
Dockerfile
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
FROM node:22-alpine
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm i
|
||||||
|
COPY . .
|
||||||
|
RUN npm run build
|
||||||
|
EXPOSE 3000
|
||||||
|
CMD ["node", "dist/server/index.js"]
|
@ -7,7 +7,7 @@ import { Socket } from "socket.io";
|
|||||||
import { InteractionService } from "./InteractionService";
|
import { InteractionService } from "./InteractionService";
|
||||||
import { ClientEvents } from "../../game/constants";
|
import { ClientEvents } from "../../game/constants";
|
||||||
|
|
||||||
export class SocketIoService extends ServiceBase{
|
export class SocketIoService extends ServiceBase {
|
||||||
io: Server
|
io: Server
|
||||||
private static clients: Map<string, any> = new Map();
|
private static clients: Map<string, any> = new Map();
|
||||||
private interactionService: InteractionService = new InteractionService();
|
private interactionService: InteractionService = new InteractionService();
|
||||||
|
56
src/test.ts
56
src/test.ts
@ -1,56 +0,0 @@
|
|||||||
import { PlayerAI } from "./game/entities/player/PlayerAI";
|
|
||||||
import { PlayerHuman } from "./game/entities/player/PlayerHuman";
|
|
||||||
import {LoggingService} from "./common/LoggingService";
|
|
||||||
import { MatchSession } from "./game/MatchSession";
|
|
||||||
|
|
||||||
console.log('process.arg :>> ', process.argv);
|
|
||||||
|
|
||||||
// const game = new DominoesGame([
|
|
||||||
// new PlayerAI("1", "Player 1"),
|
|
||||||
// new PlayerAI("2", "Player 2"),
|
|
||||||
// new PlayerAI("3", "Player 3"),
|
|
||||||
// new PlayerAI("4", "Player 4"),
|
|
||||||
// ]);
|
|
||||||
// const logger = new LoggingService();
|
|
||||||
|
|
||||||
// async function wait(ms: number) {s
|
|
||||||
// return new Promise(resolve => setTimeout(resolve, ms));
|
|
||||||
// }
|
|
||||||
|
|
||||||
async function playSolo(seed?: string) {
|
|
||||||
const session = new MatchSession(new PlayerHuman( "Jose"), "Test Game");
|
|
||||||
console.log(`Session (${session.id}) created by: ${session.creator.name}`);
|
|
||||||
setTimeout(() => session.addPlayerToSession(new PlayerAI("AI 2")), 1000);
|
|
||||||
setTimeout(() => session.addPlayerToSession(new PlayerAI("AI 3")), 2000);
|
|
||||||
setTimeout(() => session.addPlayerToSession(new PlayerAI("AI 4")), 3000);
|
|
||||||
session.start(seed);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function playHumans(seed?: string) {
|
|
||||||
const session = new MatchSession(new PlayerHuman("Jose"), "Test Game");
|
|
||||||
session.addPlayerToSession(new PlayerHuman("Pepe"));
|
|
||||||
session.addPlayerToSession(new PlayerHuman("Juan"));
|
|
||||||
session.addPlayerToSession(new PlayerHuman("Luis"));
|
|
||||||
session.start(seed);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function playAIs(seed?: string) {
|
|
||||||
const session = new MatchSession(new PlayerAI("AI 1"), "Test Game");
|
|
||||||
session.addPlayerToSession(new PlayerAI("AI 2"));
|
|
||||||
session.addPlayerToSession(new PlayerAI("AI 3"));
|
|
||||||
session.addPlayerToSession(new PlayerAI("AI 4"));
|
|
||||||
session.start(seed);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function playTeams(seed?: string) {
|
|
||||||
const session = new MatchSession(new PlayerHuman("Jose"), "Test Game");
|
|
||||||
session.addPlayerToSession(new PlayerAI("AI 1"));
|
|
||||||
session.addPlayerToSession(new PlayerHuman("Juan"));
|
|
||||||
session.addPlayerToSession(new PlayerAI("AI 2"));
|
|
||||||
session.start(seed);
|
|
||||||
}
|
|
||||||
|
|
||||||
const blockedSeed = '1719236688462-ytwrwzfzoi-01aad98f';
|
|
||||||
const seed2 = '1719237652000-09vddd3hsth7-adbc1842';
|
|
||||||
|
|
||||||
playSolo('1719248315701-itmcciws3oi-e5dd2024');
|
|
Loading…
x
Reference in New Issue
Block a user