HHVMCraft icon indicating copy to clipboard operation
HHVMCraft copied to clipboard

Clean up unstable parts of server

Open andrewvy opened this issue 10 years ago • 4 comments

  • [ ] Packet reading of unsupported packets breaking (because of buffer not clearing)
  • [x] Handle disconnect and reconnect of clients.

andrewvy avatar Aug 23 '15 07:08 andrewvy

just following up on the chunk data, i had a quick look at the TrueCraft implementation and it appears the data is compressed with Zlib.

I note in the PHP port gzdeflate() (raw compression) is being used. The PHP documentation is poor, and some encoding level are even undocumented, however one user comment mentions that gzcompress() is the Zlib equivalent compression type.

Will be interesting to follow your progress!

turbo124 avatar Aug 23 '15 09:08 turbo124

I've seen that too, but another user mentioned that gzcompress is the HTTP compression zlib deflate , while gzdeflate is the raw compression zlib deflate..

I'm not quite sure which one to use, so I try switching between the two.

PHP documentation.... ¯_(ツ)_/¯

andrewvy avatar Aug 23 '15 15:08 andrewvy

@turbo124 BOOM. It turns out I was actually sending malformed packets and the data was fine!

Using gzdeflate() resulted in a client error Malformed encoding type! But using gzcompress() definitely worked.

I also didn't realize it was working for a couple hours because I was spawning under the blocks (and facing away), until I implemented the respawning functionality which dropped me onto the blocks and surprised me.

screen shot 2015-08-23 at 11 48 16 am

(as you can see, i got the block data totally wrong but somehow it created a solid platform of cobblestone with fire on top.)

:clap:

andrewvy avatar Aug 23 '15 18:08 andrewvy

nice! Great progress.

turbo124 avatar Aug 23 '15 20:08 turbo124