clitherproject / slither.io-protocol Goto Github PK
View Code? Open in Web Editor NEWThe Documented Slither.io Protocol
The Documented Slither.io Protocol
Hi,
I just thought that maybe it would be a nice idea to make a list of all custom server/client implementations.
Any opinions on that?
Hey,
I saw you had some questions on Reddit, I'm not sure if this will help but atleast I tried.
Variable c
is the byte array.
(c[b] << 8 | c[b + 1]) / 100
for example is a 2 bytes number with 3 decimal places.
grd = c[b] << 16 | c[b + 1] << 8 | c[b + 2];
= the game radius, this is a 3 byte number.
Server side, you just need to do the opposite.
https://gist.github.com/joery1337/6eae1e90f47be9d4431e12fbec3fed3e, line 4462
Are Sectors meant to be at certain places or can these be put at random positions
I was looking at the SaveVictoryMessage and I couldn't help but notice that there was no byte sent for the players username. Is there something missing?
How do the first 2 byte's of each message work? Can I just set them to 0 or is there a special number I need to give them?
Hello. What can you say about this packet?
0000 00 00 46 06 3b 6b 2f 42 1a 06 3b 20 2f 30 1a 07 ..F.;k/B..; /0..
0010 3b 92 30 09 20 07 3b 94 2f b4 13 ;.0. .;./..
In your protocol explanation you say that "F" packet should be 2+1+1+2+2+1 = 9 length, but there is 27, not 9. What should I do with remaining 18 bytes?
#As case G,g does not actually log
Anyone has already decompiled the air app on android ?
as your finding packets maybe we can make slither bots together
Simply what the title says. I want to know how to get the head.x and y so that I can get the Pos of the snake
Protocol version 10 is out, there are basically no big changes expect one:
connecting is way harder.
Before v10:
Now:
These are just my guesses, I could be completely wrong.
I'm currently trying to reverse-engineer the new way. If anyone has any information that might be useful, please share it.
"Serverbound" means messages heading to the server.
In your spec, the first section you label "Serverbound". This is incorrect, as these are messages from the server to the client.
Does anyone know what the number for the kwebbelkop skin is
hello,
head positions are also received in MoveSnake (of own snake)?
or in which is it received ?
greats,
david
i found a project from @RowanHarley for a slither.io server but what the problem is when you load it the snake go really fast and if you take a look at the /src/messages/movement.js file.
take a look in that file an you see this
var arr = new Uint8Array(9);
the 9 is for the speed but when i change it to any thing else the snake get removed from the game.
Im way to lazy to search uphow to make pull requests, but L is the leaderboard in message types
It seems like the packet 'v' doesn't seem to work on it's own. Is it meant to be paired with another packet. Note: I'm trying to send the packet 'v' at random times. Does the snake have to actually die for me to send this packet?
@ThunderGemios10 @Mat2095
Hello,
When I parse the data using this function :
var client = http.createClient(80, "slither.io");
var request = client.request("GET", "/i33628.txt");
request.on('response', function( res ) {
res.on('data', function( data ) {
var charArray = data.toString().split('');
charArray.splice(0, 1);
for(var i=0;i<charArray.length;i++){
var code = charArray[i].charCodeAt(0) - 97;
charArray[i] = ((code - 7*i) % 26 + 26)%26;
}
var byteArray = [];
for(var i=0;i<(charArray.length-1)/2;i++){
byteArray[i] = charArray[i*2] * 16 + charArray[i*2 + 1];
}
for(var i=0;i<(byteArray.length-1)/11;i++){
var ip = byteArray[i*11+1]+'.'+byteArray[i*11+2]+'.'+byteArray[i*11+3];
var port = byteArray[i*11+4]*65536+byteArray[i*11+5]*256+byteArray[i*11+6];
console.log(ip+':'+port);
}
} );
} );
request.end();
I got weird ip like :
21.79.248:444
191.154.40:444
191.154.88:444
191.155.104:444
191.155.105:444
191.154.89:444
21.79.249:444
191.154.41:444
251.227.233:444
251.227.234:444
191.154.42:444
191.155.106:444
21.79.250:444
202.217.64:444
202.210.80:446
202.210.168:444
202.197.192:446
202.217.65:444
202.216.25:444
202.204.145:444
202.216.9:475
202.210.169:444
202.210.90:475
202.216.146:446
202.210.170:446
202.217.50:444
202.216.122:446
202.216.98:443
202.217.58:446
202.210.66:444
202.210.74:443
202.210.171:444
202.210.163:446
202.216.43:444
202.216.99:443
202.216.155:475
202.217.67:475
202.210.83:446
202.216.100:446
202.210.164:446
9.47.136:446
9.91.40:446
9.19.112:475
9.42.40:475
9.63.208:446
9.107.136:446
9.106.104:446
4.113.16:446
46.107.144:444
9.93.233:444
9.112.209:444
9.42.185:446
9.72.105:444
9.41.145:475
4.72.81:475
9.136.177:444
9.133.146:444
9.2.98:444
9.16.170:475
9.46.234:444
9.50.226:444
4.92.130:446
9.137.138:446
9.28.194:446
9.101.115:444
4.89.211:444
58.124.90:444
58.123.178:446
58.117.178:444
221.191.82:444
243.43.154:444
221.181.242:444
58.125.106:444
221.178.242:444
243.43.178:444
221.185.138:444
93.107.122:444
93.100.58:444
222.96.170:444
58.115.162:444
243.41.194:446
93.105.50:444
221.182.210:444
58.112.250:444
93.106.82:444
56.20.72:446
56.20.136:444
56.20.137:444
56.20.74:444
56.20.138:444
56.20.139:444
56.18.131:444
56.20.69:446
69.124.61:444
56.20.77:444
56.18.110:446
58.183.136:446
254.153.160:447
254.153.145:443
58.183.193:446
58.183.129:444
58.183.130:444
58.183.194:444
58.183.131:444
58.183.139:446
58.183.195:444
58.182.155:443
58.183.140:444
58.183.196:444
58.183.132:444
249.39.220:444
58.183.133:444
249.37.129:444
249.37.201:444
249.36.233:444
249.37.146:444
249.36.234:446
249.36.235:444
249.37.147:444
249.36.236:444
249.36.237:444
249.37.22:444
249.37.54:444
249.36.238:444
249.37.135:444
249.37.55:444
249.37.129:443
249.37.201:446
249.36.233:446
249.37.146:446
249.36.234:475
249.36.235:446
249.37.147:446
249.36.236:446
249.36.237:446
249.37.22:446
249.37.54:446
249.36.238:446
50.104.184:446
50.104.168:444
57.142.80:444
50.104.152:444
50.104.177:446
50.104.185:446
50.104.169:444
57.145.121:444
50.104.153:444
50.104.170:444
50.104.186:444
50.104.154:444
50.104.178:444
50.104.171:444
50.104.155:444
93.111.74:444
195.100.194:446
93.111.170:444
195.101.106:444
195.100.138:444
93.110.226:444
195.101.178:444
195.100.98:446
93.110.210:444
121.144.249:444
121.158.41:444
121.158.193:444
121.144.251:444
121.144.243:444
121.150.53:444
121.144.249:446
121.158.41:446
The port seems to be fine but none of these ip refers to known slither servers.
Idea?
Thanks!
I'm trying to understand y'all are figuring out the Slither.io protocol.
I have Wireshark running and I'm looking for websocket packets sent to the slither.io server, but they all seem to have a payload of length 0 or 1.
How is it that you guys are able to figure out what you have about the protocol? I would love to be able to help.
Hi,
I have some additional information (regarding the "w" and "W" packages), but they only apply to protocol version 8 (and above, most likely).
The documentation has a big heading saying "Protocol Version 6", are you only interested in version 6 or is this just not updated yet? In case you are interested in newer versions, do you want to keep the documentation about version 6 (e.g. in another branch)?
If I want to move a snake in my own script with buffer it would be "var random = new Buffer(g) {}" ??
I have been working on a copy of Slyther, which is protocol 10 based. As of today, the server disconnects me during login. :(
How do that packets "g" and "G" work? I've been debugging slither.io's client code but I don't see patterns in the way they're sent. The only difference I see is that the packet "g" isn't sent too often in the game so I can guess that this is for lag simulation.
On your protocol.md the client packet Ping you specify a int8 that is always 251
But int8 only goes from -128 to 127
So is there a typo on the protocol.md file?
Thanks
When you play for a while, the position from the packet will start showing the same position but I am still moving. (You can see my userscript at the end)
My Questions
Question 1: How to simply fix that problem?
-- If you can answer number one then you can ignore question 2 --
Question 2: Is there anyway to measure the position by adding what will the snake will go every minisecond
for example: snake.xx = xx + Math.sin(snake.angle) * **the Speed
** <-- Is there any way to know the speed, it will be a lot easier.
Please Help
Hey,
I love what you've done with this project for slither.io, and I actually started something
similar for a different .io game (diep.io). I could use your expertise in terms of
deciphering the protocol (I've not been having much luck with analyzing the
server-to-client packets).
The project is available here: https://github.com/firebolt55439/Diep.io-Protocol
How should I go about creating the sector's for my slither server? Should I create them all at once and if so, do each of them need ID's?
Hey guys,
I'm trying to use the Net module of Node.js to talk to a slither.io server. However, I've only gotten as far as opening the connection. The server won't respond to anything I send it.
I've tried something like this:
var packetSetUsernameAndSkin = new Buffer([115, 7, 0, 115]);
var packetPing = new Buffer([251]);
client.write(packetSetUsernameAndSkin);
client.write(packetPing);
Yet the server still doesn't respond. I must be missing something. Do I need to establish a SSL connection or something? Wireshark seems to indicate that the connection is over websockets, so I guess I do have to establish a secure websocket connection. Any advice on doing that?
(I'm sorry if this isn't the right place to ask!)
P.S. Love the work you guys are doing. Looking at the protocol is fun!
I'm unsure of what the intX data types mean. Are they just indicating how big the number potentially is by indicating the number of bytes? E.G. int8 would be one byte, int16 is 2 bytes, etc?
I'm asking because I'm trying to derive my snake's coordinates from the "s" packet when it spawns. I also don't know what "value / 5" means. Does it literally mean the x value is the given value divided by five? Could someone give me the layout of the game coords? Is negative y up? Is negative x left? I probably have to derive the bounds from the setup packet, right?
Also, is the first byte of the coordinates indicating the sign? Is 0 negative?
Thanks!
Has anyone worked out what the colors are in the custom skin data?
It is incredibly tedious to try to run two clients and keep the official custom skin snake alive so I can look at it (and receive its data) with my client.
why not angle * Math.PI /180 but angle * 2*Math.PI / 251 ?
Current clients use protocol version 11, we should update to it.
I see gameradius mentioned a few times in the protocol.md. How is this calculated or from what object can it be read?
Can I use:
function setMscps(b) {
if (b != mscps) {
mscps = b;
fmlts = [];
fpsls = [];
for (b = 0; b <= mscps; b++) b >= mscps ? fmlts.push(fmlts[b - 1]) : fmlts.push(Math.pow(1 - b / mscps, 2.25)), 0 == b ? fpsls.push(0) : fpsls.push(fpsls[b - 1] + 1 / fmlts[b - 1]);
var f = fmlts[fmlts.length - 1],
c = fpsls[fpsls.length - 1];
for (b = 0; 2048 > b; b++) fmlts.push(f), fpsls.push(c)
}
}
on my server to get fpsls and fmlts or do I need other code?
Current protocol is 12, the documentation should be adjusted to that.
However, protocol 11 is working with the current live servers.
What are sectors actually mean? In 'a' packet(initial setup) third and fourth values are describing something named "sectors". But what it really are?
I am trying to create a server for slither.io but I am stuck getting the player's score. Is Math.floor(15 * (fpsls[snake.sct] + snake.fam / fmlts[snake.sct] - 1) - 5) / 1
client-side and if so, how do I convert it to be server side. If not, can I just stick this code in to get the score. I can't seem to find any docs for fpsls and fmlts online so I don't know what to do with it
Basically what title says
Howdy,
Title says it all. I'm not getting all the web socket packets. I'm not getting p, W, G (so far that I have noticed) but I get all the others (seemingly) fine.
I should get a, s, g, W, F, W, F, W, F, W, F, W, F (this is what the game itself does); after all the W and F packets, the client shoots over the first ping.
I get a, s, g, F (so no W), just F, F, F, F, F, F, F, etc.
Then I never get any G packet updates; so I can't correctly determine my x, y.
Then I noticed after I send the preInitResponse, it's like the server doesn't take anymore of my packets but continued to send me stuff. So I can watch my snake in game but it won't move (but I can see my server pushing the speed up packet, but nothing happens). As soon as I disconnect the websocket, the snake starts moving around like there is a player behind it but it's the game's AI taking over.
Ideas? The protocol version, I've tried, 10, 11, and 12.
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.