Initial commit

This commit is contained in:
2026-08-24 22:20:36 +02:00
commit 62f7b1278a
251 changed files with 16670 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
const game = require("../Game/Game");
const { players } = game;
const SpyResultPacket = require("../Packets/SpyResult");
module.exports = function (ws, message, player) {
const spyID = message.getUint32(1);
const spiedPlayer = players[spyID];
let spiedPlayerLocation = {};
if (!spiedPlayer) {
spiedPlayerLocation = {
mapID: 255,
x: 0,
y: 0
};
} else if (spiedPlayer.isAlive) {
spiedPlayerLocation = {
mapID: spiedPlayer.map.id,
x: spiedPlayer.position.x,
y: spiedPlayer.position.y
};
} else {
spiedPlayerLocation = {
mapID: 0,
x: 0,
y: 0
};
};
const packet = SpyResultPacket(spiedPlayerLocation);
ws.send(packet, true, true);
};