Skip to content

Commit

Permalink
fix: mock server impl for new functions
Browse files Browse the repository at this point in the history
  • Loading branch information
niekcandaele committed Dec 15, 2024
1 parent 8584e11 commit 31cbc2b
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion packages/app-mock-gameserver/src/lib/gameserver/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ import { errors, logger } from '@takaro/util';
import { Redis } from '@takaro/db';

import { getSocketServer } from '../socket/index.js';
import { IPlayerReferenceDTO, IGameServer, IMessageOptsDTO, CommandOutput, BanDTO, IItemDTO } from '@takaro/gameserver';
import {
IPlayerReferenceDTO,
IGameServer,
IMessageOptsDTO,
CommandOutput,
BanDTO,
IItemDTO,
MapInfoDTO,
} from '@takaro/gameserver';
import {
EventLogLine,
GameEvents,
Expand Down Expand Up @@ -394,6 +402,21 @@ export class MockGameserver implements IMockGameServer {
async shutdown() {
await this.sendLog('Shutting down');
}

async getMapInfo() {
return new MapInfoDTO({
enabled: false,
mapBlockSize: 100,
maxZoom: 5,
mapSizeX: 1000,
mapSizeY: 1000,
mapSizeZ: 1000,
});
}

async getMapTile(_x: number, _y: number, _z: number) {
return Buffer.from('mock-tile');
}
}

const cachedMockServer: Map<string, MockGameserver> = new Map();
Expand Down

0 comments on commit 31cbc2b

Please sign in to comment.