Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable MultiAccountProtection :( #1862

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions agot-bg-game-server/src/server/GlobalServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,22 +511,29 @@ export default class GlobalServer {

user.updateConnectionStatus();

if (this.socketIds.has(client)) {
const socketId = this.socketIds.get(client);
if (this.multiAccountingProtection.has(user.entireGame.id)) {
const userConnectionInfos = this.multiAccountingProtection.get(user.entireGame.id);
if (userConnectionInfos.has(socketId)) {
const date = new Date();
date.setHours(date.getHours() + 16);
userConnectionInfos.get(socketId).invalidatesAt = date;
}
//this.addIpToMultiAccountProtectionMap(client, user);
}
}

private addIpToMultiAccountProtectionMap(client: WebSocket, user: User): void {
if (this.socketIds.has(client)) {
const socketId = this.socketIds.get(client);
if (this.multiAccountingProtection.has(user.entireGame.id)) {
const userConnectionInfos = this.multiAccountingProtection.get(user.entireGame.id);
if (userConnectionInfos.has(socketId)) {
const date = new Date();
date.setHours(date.getHours() + 16);
userConnectionInfos.get(socketId).invalidatesAt = date;
}
this.socketIds.delete(client);
}
this.socketIds.delete(client);
}
}

getOtherUsersFromSameNetworkInSameGame(entireGame: EntireGame, userData: StoredUserData, socketId: string, clientIp: string): string[] {
return [];

// TODO
if (!this.multiAccountingProtection.has(entireGame.id)) {
this.multiAccountingProtection.set(entireGame.id, new BetterMap());
}
Expand Down Expand Up @@ -611,6 +618,7 @@ export default class GlobalServer {
});

// Invalidate outdated Ip entries:
/*
this.multiAccountingProtection.keys.forEach(entireGameId => {
const userConnectionInfos = this.multiAccountingProtection.get(entireGameId);
userConnectionInfos.keys.forEach(socketId => {
Expand All @@ -624,6 +632,7 @@ export default class GlobalServer {
this.multiAccountingProtection.delete(entireGameId);
}
});
*/
}
}
}
Loading