Fix typo + debug logging leftover code

This commit is contained in:
q13x 2022-12-21 01:44:27 -08:00
parent bdb05709a3
commit 7fbbe3fdf3
2 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ export const config: Config = {
l2: "lol" l2: "lol"
}, },
server: { server: {
host: "locahost", host: "localhost",
port: 25565 port: 25565
}, },
security: { // provide path to key & cert if you want to enable encryption/secure websockets security: { // provide path to key & cert if you want to enable encryption/secure websockets

View File

@ -129,6 +129,8 @@ export function loginServer(ip: string, port: number, client: ProxiedPlayer) {
}) })
mcClient.on('raw', p => { mcClient.on('raw', p => {
// block the login success packet to fix the bug that prints the UUID in chat on join // block the login success packet to fix the bug that prints the UUID in chat on join
if (p[0] == 0x03 && mcClient.state == mc.states.LOGIN)
return
if (p[0] == 0x02 && blockedSuccessLogin) { if (p[0] == 0x02 && blockedSuccessLogin) {
client.ws.send(p) client.ws.send(p)
} else if (p[0] == 0x02) { } else if (p[0] == 0x02) {
@ -248,12 +250,10 @@ export async function doHandshake(client: ProxiedPlayer, initialPacket: Buffer)
const skinSqrt = decodeVarInt(skin.subarray(Iid[1] + skinVerLen[1] + skinP.skinVerLen)), dimensions = Number(skinSqrt[0]) * Number(skinSqrt[0]) * 3 const skinSqrt = decodeVarInt(skin.subarray(Iid[1] + skinVerLen[1] + skinP.skinVerLen)), dimensions = Number(skinSqrt[0]) * Number(skinSqrt[0]) * 3
skinP.skinDimens = dimensions skinP.skinDimens = dimensions
skinP.skin = skin.subarray(Iid[1] + skinVerLen[1] + skinP.skinVerLen + skinSqrt[1] + 16) skinP.skin = skin.subarray(Iid[1] + skinVerLen[1] + skinP.skinVerLen + skinSqrt[1] + 16)
console.log(skinP.skin.length)
if (skinP.skin.length > 16385) { if (skinP.skin.length > 16385) {
disconnect(client, ChatColor.RED + "Invalid skin received!") disconnect(client, ChatColor.RED + "Invalid skin received!")
return return
} }
console.log(skinP.skin[skinP.skin.length - 1])
} }
client.skin = { client.skin = {
type: skinP.type, type: skinP.type,