Moved keepalive code out of GameCallbacks and into its own function inside GameControler

This commit is contained in:
Dev 2023-07-15 10:57:39 +01:00
parent c1e7c70c65
commit 2b6980358c
2 changed files with 15 additions and 5 deletions

View File

@ -109,11 +109,7 @@ class GameCallbacks
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
public gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameKeepAliveResponse> public gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameKeepAliveResponse>
{ {
return this.httpResponse.getBody({ return this.httpResponse.getBody(this.gameController.getKeepAlive(sessionID));
msg: "OK",
// eslint-disable-next-line @typescript-eslint/naming-convention
utc_time: new Date().getTime() / 1000
});
} }
/** /**

View File

@ -12,6 +12,7 @@ import { BodyPartHealth } from "../models/eft/common/tables/IBotBase";
import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse";
import { ICurrentGroupResponse } from "../models/eft/game/ICurrentGroupResponse"; import { ICurrentGroupResponse } from "../models/eft/game/ICurrentGroupResponse";
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse";
import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IServerDetails } from "../models/eft/game/IServerDetails";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { ConfigTypes } from "../models/enums/ConfigTypes"; import { ConfigTypes } from "../models/enums/ConfigTypes";
@ -232,6 +233,19 @@ export class GameController
}; };
} }
/**
* Handle client/game/keepalive
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getKeepAlive(sessionId: string): IGameKeepAliveResponse
{
return {
msg: "OK",
// eslint-disable-next-line @typescript-eslint/naming-convention
utc_time: new Date().getTime() / 1000
};
}
/** /**
* BSG have two values for shotgun dispersion, we make sure both have the same value * BSG have two values for shotgun dispersion, we make sure both have the same value
*/ */