Add content moderation and release validation tools
This commit is contained in:
1 parent
a9d572fff0
commit
7c2e82fc15
63 files changed
+5508
-38
No files matched your search
@@ -0,0 +1,17 @@
|
||||
// Keeps a protocol-only client synchronized like a stationary game client.
|
||||
function addMovement(client, version) {
|
||||
let timer;
|
||||
const usesFlags = Number(version.split(".")[2] || 0) >= 2;
|
||||
client.on("position", packet => {
|
||||
if (Number.isInteger(packet.teleportId)) {
|
||||
client.write("teleport_confirm", { teleportId: packet.teleportId });
|
||||
}
|
||||
if (!timer) {
|
||||
const ground = usesFlags ? { flags: { onGround: true, hasHorizontalCollision: false } } : { onGround: true };
|
||||
timer = setInterval(() => client.write("flying", ground), 150);
|
||||
}
|
||||
});
|
||||
client.on("end", () => clearInterval(timer));
|
||||
}
|
||||
|
||||
module.exports = { addMovement };
|
||||
Reference in new issue
Block a user