Hacker News new | past | comments | ask | show | jobs | submit login

Impressive, where did you find the information for your TCP server and why choose that as a project?



The folks on #mcdevs on Freenode had done the hard work for me, they had reverse-engineered and documented the Minecraft Classic protocol. It's a very simple binary TCP protocol with only 16 packet types.

And why as a project? Well, I saw the protocol was simple enough, and it seemed like a fun thing to do since I liked playing Minecraft Classic. There were already loads of other Classic servers, but I wanted to make my own so I could do things my way and add silly features. Yes, there's plugins, but sometimes I like reinventing the wheel.

I added some features, for example, "Zombies", imitating those in Minecraft Survival/Indev/Infdev/Alpha/Beta/Release. I sent packets as if another player had spawned, and I set up a minecraft account with the right skin, so that when a player with the same name as that account was spawned, they would look like a zombie. The AI was very, very stupid. It would always turn at right-angles, making them easy to trap. Still, it was fun. Also, at the time I did not understand recursion, so the "physics" for things like spreading water didn't work properly.

The code I ended up writing, in C using WinSock and zlib was... horrible. Ridiculous levels of nesting, and almost everything was in the main function. This was a result of getting it working before getting it right. However, I never really refactored it much, and it became an unmaintainable mess. At various times I have refactored it a bit, as recently as a year ago, and it's the refactoring-in-progress version you can find on my GitHub page.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: