{"id":18489167,"url":"https://github.com/floriancassayre/diep.io-protocol","last_synced_at":"2026-01-24T10:33:27.421Z","repository":{"id":89163599,"uuid":"61884920","full_name":"FlorianCassayre/diep.io-protocol","owner":"FlorianCassayre","description":"Websocket protocol of the game diep.io","archived":false,"fork":false,"pushed_at":"2016-06-25T15:45:31.000Z","size":3,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-10-12T15:05:54.822Z","etag":null,"topics":["diep","game","packet-format","packets","protocol"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FlorianCassayre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-24T13:02:17.000Z","updated_at":"2025-07-13T03:37:04.000Z","dependencies_parsed_at":"2023-06-14T05:30:40.707Z","dependency_job_id":null,"html_url":"https://github.com/FlorianCassayre/diep.io-protocol","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FlorianCassayre/diep.io-protocol","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianCassayre%2Fdiep.io-protocol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianCassayre%2Fdiep.io-protocol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianCassayre%2Fdiep.io-protocol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianCassayre%2Fdiep.io-protocol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FlorianCassayre","download_url":"https://codeload.github.com/FlorianCassayre/diep.io-protocol/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianCassayre%2Fdiep.io-protocol/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28725357,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T10:24:43.181Z","status":"ssl_error","status_checked_at":"2026-01-24T10:24:36.112Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["diep","game","packet-format","packets","protocol"],"created_at":"2024-11-06T12:55:40.191Z","updated_at":"2026-01-24T10:33:27.403Z","avatar_url":"https://github.com/FlorianCassayre.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# diep.io Protocol\n\n[diep.io](http://diep.io) is a small online war game featuring tanks, bullets and blobs. There are several game modes but this document only concentrates on the FFA mode.\n\n1. [Communication](#communication)\n1. [Data types](#data-types)\n1. [Packet format](#packet-format)\n1. [Packets](#packets)\n   1. [Serverbound](#serverbound)\n   1. [Clientbount](#clientbound)\n\n## Communication\n\nData is transmitted through a http websocket pipe. \n\n## Data types\n\nThis game uses standard data formats. Bytes are in **big endian** order. The size of each type might not be constant (eg. strings, varints).\n\nName | Size (bytes) | Data range | Notes\n--- | --- | --- | ---\n**uint8** | 1 | An integer between 0 and 255 | Unsigned 8-bit integer\n**uint16** | 2 | An integer between 0 and 65535 | Unsigned 16-bit integer\n**uint32** | 4 | An integer between 0 and 4294967295 | Unsigned 32-bit integer\n**int8** | 1 | An integer between -128 and 127 | Signed 8-bit integer\n**int16** | 2 | An integer between -32768 and 32767 | Signed 16-bit integer\n**int32** | 4 | An integer between -2147483647 and 2147483646 | Signed 32-bit integer\n**float32** | 4 | A floating point number | Floating point number with 32-bit precision\n**float64** | 8 | A floating point number | Floating point number with 64-bit precision\n**String** | ≥ 1 | A variable-length UTF-8 string | The string ends when byte `0x00` is reached\n**T[i]** | ? | A fixed size array of a type | Arrays can contain any type of data\n\n## Packet format\n\nEvery packet begins with **one** byte indicating the packet ID and then the **content** follows. Packets can be split if they are too large but this behavior is automatically corrected by the buffer manager.\n\nType | Size (bytes) | Notes\n--- | --- | ---\n**Packet ID** | 1 | There can be 256 different packets, but in practice there are only a few. Sending an unknown packet ID will immediately close the connection.\n**Content** | ≥ 0 | Packets can have an empty body\n\n## Packets\n\nSome packets might be missing and their purposes haven't been totally discovered.\n\n### Serverbound\nPackets sent from the client to the server.\n\n#### Recap\n\nPacket ID | Arbitrary name | Purpose\n--- | --- | ---\n`0x00` | User ID | Sent at the begining of the connection, contains the ID of the player.\n`0x01` | Player control | Contains the location of the mouse, if the player is shooting and the state of the 4-directional keys\n`0x02` | Start game | Contains the nickname entered by the player\n`0x03` | Tank upgrade | Tells the server which upgrade the player wants to choose\n`0x04` | Tank evolution | Tells the server which evolution the player wants to choose\n`0x05` | Heartbeat | The server checks if the player is still online. This packet is sent every 0.1 second.\n\n#### `0x00` User ID\nField | Type | Notes\n--- | --- | ---\nUser ID | String | No maximal length specified\n\n#### `0x01` Player control\nField | Type | Notes\n--- | --- | ---\n??? | 8 to 10 bytes | Mouse location (?)\nKeys | uint8 | State (pressed or released) of 5 keys encoded in bits\n\nCodes for each key can be found in the following table. Each key state is added to the stack using the logic OR ( =| ) operator.\n\nKey | Code (byte) | Code (binary)\n--- | --- | ---\nMouse left button | `0x01` | `0b00000001`\nArrow up | `0x02` | `0b00000010`\nArrow left | `0x04` | `0b00000100`\nArrow down | `0x08` | `0b00001000`\nArrow right | `0x10` | `0b00010000`\n\n#### `0x02` Start game\nField | Type | Notes\n--- | --- | ---\nNickname | String | Nicknames must be between 0 and 15 characters long\n\n#### `0x03` Tank upgrade\nField | Type | Notes\n--- | --- | ---\nUpgrade ID | uint8 | The upgrade level doesn't matter\n\nUpgrades IDs can be found in the following table.\n\nUpgrade | Code (byte)\n--- | ---\nHealth regeneration | `0x0e`\nMaximum health | `0x0c`\nBody damage | `0x0a`\nBullet speed | `0x08`\nBullet penetration | `0x06`\nBullet damage | `0x04`\nReload | `0x02`\nMovement speed | `0x00`\n\n#### `0x04` Tank evolution\nField | Type | Notes\n--- | --- | ---\nTank ID | uint8 | Each tank has its own ID\n\nTanks IDs are as following.\n\nTier | Levels requiered\n--- | ---\n**0** | 0\n**1** | 15\n**2** | 30\n**3** | 45\n\nTier | Tank name | Obtainable after | Code (byte)\n--- | --- | --- | ---\n1 | Twin | Normal | `0x02`\n1 | Flank Guard | Normal | `0x10`\n1 | Machine Gun | Normal | `0x0e`\n1 | Sniper | Normal | `0x0c`\n2 | Triple Shot | Twin | `0x06`\n2 | Twin Flank | Twin **OR** Flank Guard | `0x1a`\n2 | Quad Tank | Twin **OR** Flank Guard | `0x08`\n2 | Tri Angle | Flank Guard | `0x12`\n2 | Destroyer | Machine Gun | `0x14`\n2 | Gunner | Machine Gun | `0x28`\n2 | Assassin | Sniper | `0x1e`\n2 | Overseer | Sniper | `0x16`\n2 | Hunter | Sniper | `0x26`\n3 | Triplet | Triple Shot | `0x04`\n3 | Penta Shot | Triple Shot | `0x1c`\n3 | Triple Twin | Twin Flank | `0x24`\n3 | Octo Tank | Twin Flank **OR** Quad Tank | `0x0a`\n3 | Booster | Tri Angle | `0x2e`\n3 | Fighter | Tri Angle | `0x30`\n3 | Hybrid | Destroyer | `0x32`\n3 | Stalker | Assassin | `0x2a`\n3 | Ranger | Assassin | `0x2c`\n3 | Manager | Overseer | `0x34`\n3 | Overlord | Overseer | `0x18`\n3 | Necromancer | Overseer | `0x22`\n\n#### `0x05` Heartbeat\nThis packet is empty.\n\n\n### Clientbound\nPackets sent from the server to the client.\n\n#### Recap\n\nPacket ID | Arbitrary name | Purpose\n--- | --- | ---\n`0x00` | ??? | ???\n`0x02` | ??? | Contains **sometimes** the shop data and the leaderboard (?)\n`0x04` | Server location | Tells the client its location\n`0x05` | Heartbeat | The client checks if the server is still online. This packet is sent every 0.1 second.\n\n#### `0x00` ???\nField | Type | Notes\n--- | --- | ---\nCounter | uint8 | Counts from 128 to 255 (?)\n??? | ??? | ???\n\n#### `0x02` ???\nField | Type | Notes\n--- | --- | ---\n??? | ??? | ???\nNicknames | String[10] | 10 best players on the server\n??? | ??? | ???\nScores | float32[10] | And their score\n??? | ??? | ???\n\n#### `0x04` Server location\nField | Type | Notes\n--- | --- | ---\nLocation name | String | Contains informations about the server's location\n\n#### `0x05` Heartbeat\nThis packet is empty.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloriancassayre%2Fdiep.io-protocol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloriancassayre%2Fdiep.io-protocol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloriancassayre%2Fdiep.io-protocol/lists"}