- It is hard to read, because it is missing semicolons and braces.
- Indentation as a syntactical element is just silly. This takes away freedom from the developer and makes the code less readable without any benefit.
- Indentation-dependant scopes make multiple statements on one line look horrible.
- Doc comments
- They use triple quotes which doesn't make sense for a comment.
- They go under what they are documenting, which looks wrong and is very unusual.
WebSocket is a protocol over http. You should read: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API for more info on WebSocket.
Krunker uses msgpack for decoding and encoding packets. Msgpack is also smaller and sometimes faster depending on the implementation you use/make.
Like I said earlier, Krunker uses msgpack for decoding and encoding packets. A ping packet would like this: ["po"]
which you send when you get a ["pi"]
packet, and the ping result packet you receive is ["pir", ]
. For fetching a profile, you can use ["r", "profile", , null]
. The result packet would be like ["0", "profile", , , , , ...etc]
. For finding packets, you can download https://krunker.io/social.html using a command like cURL, formatting the file and lo