mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 11:30:43 +00:00
Revert "Fix winner stats spoofing exploit"
This reverts commit 819edb21bb.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { createHash } from "crypto";
|
||||
import ipAnonymize from "ip-anonymize";
|
||||
import { Logger } from "winston";
|
||||
import WebSocket from "ws";
|
||||
@@ -1201,14 +1200,7 @@ export class GameServer {
|
||||
client.reportedWinner = clientMsg.winner;
|
||||
|
||||
// Add client vote
|
||||
const winnerKey = createHash("sha256")
|
||||
.update(
|
||||
JSON.stringify({
|
||||
winner: clientMsg.winner,
|
||||
allPlayersStats: clientMsg.allPlayersStats,
|
||||
}),
|
||||
)
|
||||
.digest("hex");
|
||||
const winnerKey = JSON.stringify(clientMsg.winner);
|
||||
if (!this.winnerVotes.has(winnerKey)) {
|
||||
this.winnerVotes.set(winnerKey, { ips: new Set(), winner: clientMsg });
|
||||
}
|
||||
@@ -1235,12 +1227,6 @@ export class GameServer {
|
||||
`Winner determined by ${potentialWinner.ips.size}/${activeUniqueIPs.size} active IPs`,
|
||||
{
|
||||
winnerKey: winnerKey,
|
||||
numKeys: this.winnerVotes.size,
|
||||
votesByKey: [...this.winnerVotes.entries()].map(([key, v]) => ({
|
||||
key,
|
||||
voteCount: v.ips.size,
|
||||
winner: v.winner.winner,
|
||||
})),
|
||||
},
|
||||
);
|
||||
this.archiveGame();
|
||||
|
||||
Reference in New Issue
Block a user