Stats

2
Projects
10
Devlogs
20
Votes
1
Ships

Coding Time

All Time: 55h 12m
Today: 0h 0m

Member Since

June 16, 2025

Badges

1
🚢
Maiden Voyage
you shipped your first project! the journey begins...

Projects

2
🚀
2 devlogs • about 1 month ago
NotEnoughSpectators
8 devlogs • about 2 months ago

Activity

Eason
Eason worked on AgentDuels
2h 1m • about 1 month ago

I created a packet codec struct that acts as a helper for serializing/deserializing packets into bytes along with adding the packet ID and optionally encrypting the packet data. I also realized that the game server wasn't actually proxying data, but acting as a loopback due to a logic mistake, so I corrected it. I also made the game server generate a match ID and send it to the clients when a channel is being established.

Update attachment
Eason
Eason worked on AgentDuels
4h 30m • about 1 month ago

New project! I finished setting up the project (initializing workspaces, crates, and their dependencies). I also created the structs and macros for the networking protocol and created a server binary with an empty Actix Web HTTP server and a custom TCP server I made that establishes a bidirectional connection between every two clients. To top it off, I created a simple client that just exchanges a handshake packet and prints out the other client's protocol version.

Update attachment
Eason
Eason created a project
36d ago

AgentDuels

A game where you code agents to fight for you!

2 devlogs 0 followers

I didn't realize you needed a raw README link and had to ask for help. While I was waiting, I added code to handle all equipment updates (main hand, off hand, armour). Now, you can see what the host player is holding and wearing. I also made the mod not broadcast certain packets such as respawn and gamemode change packets, so that the spectator doesn't get disturbed by random teleportations and gamemode switches. Anyways, I'll update the demo release and finally ship the project :)

Ok this time I'll actually ship it. I decided that the mod was still too buggy (though you probably haven't noticed because I hid the problems when recording). I ended up fixing the major bug that kept giving me IllegalReferenceCountExceptions, so now the mod is much more stable. I also added teleportation handling, so the host player position doesn't get unsynced anymore. For a last touch, I added a compass that teleports the spectator to the host player's location, just in case their lost or far from the host.
I updated my README and put the final Jar file in a release on Github for demoing. This is it for the devlogs I guess. I'll still continue working on the mod afterwards though - gotta make the 1.8 port!

I fixed the race condition in my packet update code by using the Fabric event API instead of checking for differences in the packet list.
Then, I did a quick cleanup of my code, removing all the unneeded parts. I think half of the code in the codebase was obsolete at that point!
After, I made it so that the host player gets spawned in and has its position updated by hooking on to the movement packets that the host sends to the server. I also made hand swings reflect on the spectator side.
Aside from those things I did smaller things like making server transitions smoother through respawn packets and resending certain packets. I also fixed some bugs. I'll ship the project now, since it's basically done.

It finally works!! As it turns out, my byte packet sniffer was also picking up serverbound packets. Also, I forgot to copy the byte buffer before passing it to the packet codec, and that's why the data was messed up for the decoder. Anyways, now I can successfully join the spectator server and see everything! I added a thread for sending keepalive packets and any new packets the host has received, so updates reflect on the fake server too. There are still some bugs I need to sort out, but I think I need to clean up my code first.

I think I'm making good progress now. After spending more time trying to deal with Minecraft's networking code, I decided that it was too inextricably tied together to productively modify. So, instead of using copies of Minecraft's network handlers, I just created my own custom one. Now I can clearly send and receive packets, and deal with state changes (because I have everything done myself, and also everything is in one handler instead of multiple). I built up the handshaking, status, and login parts pretty quickly, but took some time with the configuration, since I needed to forward the packets received by the host client. I fixed a few major bugs with my packet sniffer, but for some reason its still getting rejected by the spectator clients. In the end, I found out that the packet codec in the configuration phase wasn't annoyingly linked to other parts of the codebase, and ended up capturing complete, deserialized packets and reserialized them before sending them to the client. That finally got me through the configuration phase. But now I'm stuck at the play phase. I can't do the same fix in this phase, since the packet codec is linked to Minecraft registries which aren't always available (also they can't find certain elements? I don't fully understand the errors I was getting). So, I'm back at trying to fix my raw byte sniffer. I'm guessing that the problem right now is that my sniffer doesn't know when packets start and end, and that creates problems when a packet is deserialized from two chunks of bytes. I tried running the decoder class' codec within my sniffer, but I think there might be an internal buffer that is being shared, because that ended up breaking the decoder. I'm digging deeper into the codec code right now, but the Java here is way beyond me. Half the time I can't even find where the actual functionality of a method is being implemented. I'll call it a day for now and try harder tomorrow.

By the way, I figured out the cause for that NullPointException I was getting in the last devlog. Turns out it was happening because I had a null value as a placeholder for my server metadata, and that caused the encoder to error out. That was embarrassing 😅.

Also, part of the reason my sniffer's data was incorrect was because it was picking up serverbound data. I have no idea why that is. My sniffer should be running on inbound messages, not outbound ones!!

So in conclusion, my fake server now can respond to pings and status requests, and can handle clients properly all the way until the PLAY stage.

Update attachment

Today was really tough. After spending another hour or so trying to fix the errors, I found out that for some reason directly joining the server instead of pinging for its status doesn't cause the error. So, I went to work trying to send the raw packet data through my Netty channel. Since during the setup of the Netty server there were a lot of things in the channel pipeline that messed up my raw bytes, I had to strip out most of the handlers inside the pipeline. I eventually got the raw bytes through (This took way too long). I then began piping the captured packets to the client through the channel, but I was met with another roadblock. This time the spectating client errors out with a DecoderException, stating that it failed to decode the Login (Play) packet.

On a separate note I've reworked the SpectatorServer and ClientChannelMixin so that the packet sniffer doesn't activate for my emulated server (I don't know why I didn't realize I needed to do this earlier)

Update attachment

I saw a lot of people explaining their project in their first devlog so I'll start this one with an explanation. As the project description says, I'm creating a Minecraft mod that allows you to broadcast your singleplayer/multiplayer gameplay as a fake Minecraft server that allows people to join and spectate you as if they were watching a ReplayMod replay (they can't actually interact with anything). To do this, I'm capturing all the packets the host client receives from the server they're on (I'm starting with multiplayer first, singleplayer might be a bit different) and then storing and sending them to the spectator clients through a barebones Netty server.

Anyways, I spent a lot of time today rewriting Minecraft's networking code to work without a MinecraftServer object so that I can use it in my own Netty server. I think I'm basically done, but I've hit a roadblock with an EncoderException and NullPointerException that appears whenever I send a packet to the client. From looking at the logs, I suspect that the error comes from a problem with the Packet registry. I'm guessing the MinecraftServer class has a filled registry that I'm missing, but there's a lot of code to read over and some of it is a bit beyond me (I haven't used Java in quite a while). I'll try a bit longer to figure out what's happening and then call it a day.

Update attachment

I made a packet sniffer that stores the raw packet data of clientbound CONFIGURATION and PLAY packets into an ArrayList of ByteBufs after figuring out how to intercept clientbound packets before they are deserialized into Packet classes and how to find the current network phase.

I'm not 100% sure the intercepted data is what I want because I haven't verified the data yet (I'm too lazy to store the data and manually analyze each byte).

My plan is to set up a barebones TCP server (maybe with Netty so I can use Mojang's encryption and compression code) that does a handshake with connecting Minecraft clients and then dumps the captured packet data to the client, avoiding having to interpret and reserialize every type of packet.

Update attachment
Eason
Eason created a project
54d ago

NotEnoughSpectators

A Minecraft mod that allows you to invite anybody to watch your gameplay in an immersive way similar to watching as a spectator in the world

NotEnoughSpectators
8 devlogs 2 followers Shipped
Eason
Eason joined Summer of Making
56d ago

This was widely regarded as a great move by everyone.