Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .circleci/config.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
run: npm test
25 changes: 25 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: npm-publish
on:
push:
branches:
- master # Change this to your default branch
jobs:
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@master
- name: Set up Node.js
uses: actions/setup-node@master
with:
node-version: 10.0.0
- name: Publish if version has been updated
uses: pascalgn/npm-publish-action@4f4bf159e299f65d21cd1cbd96fc5d53228036df
with: # All of theses inputs are optional
tag_name: "%s"
tag_message: "%s"
commit_pattern: "^Release (\\S+)"
env: # More info about the environment variables in the README
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # You need to set this in your repo settings
181 changes: 124 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,78 @@
# diablo2-protocol
[![NPM version](https://img.shields.io/npm/v/diablo2-protocol.svg)](http://npmjs.com/package/diablo2-protocol)
[![Build Status](https://img.shields.io/circleci/project/MephisTools/diablo2-protocol/master.svg)](https://circleci.com/gh/MephisTools/diablo2-protocol)
[![Discord Chat](https://img.shields.io/badge/discord-here-blue.svg)](https://discord.gg/9RqtApv)
[![Try it on gitpod](https://img.shields.io/badge/try-on%20gitpod-brightgreen.svg)](https://gitpod.io/#https://github.com/MephisTools/diablo2-protocol)


Network protocol for diablo 2 : create client and servers for diablo 1.13 and 1.14.

[Bot example](https://www.youtube.com/watch?v=KYPTijLiwMI&feature=youtu.be)

[Sniffer example](https://www.youtube.com/watch?v=R5yfRTR3-mY)
# diablo2-protocol

<!-- PROJECT SHIELDS -->

[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![NPM version](https://img.shields.io/npm/v/diablo2-protocol.svg)](npm-url)
[![Build Status](https://github.com/Mephistools/diablo2-protocol/workflows/CI/badge.svg)](build-url)
[![Discord](https://img.shields.io/badge/chat-on%20discord-brightgreen.svg)](discord-url)
[![Try it on gitpod](https://img.shields.io/badge/try-on%20gitpod-brightgreen.svg)](gitpod-url)

<!-- PROJECT LOGO -->
<br />
<p align="center">
<a href="https://github.com/Mephistools/diablo2-protocol">
<img src="docs/images/logo.png" alt="Logo" width="80" height="80">
</a>

<h3 align="center">diablo2-protocol</h3>

<p align="center">
Network protocol for diablo 2 : create client and servers for diablo 1.13 and 1.14.
<br />
<a href="https://github.com/MephisTools/diablo2-protocol/wiki"><strong>Explore the docs »</strong></a>
<br />
<br />
<a href="https://www.youtube.com/watch?v=KYPTijLiwMI&feature=youtu.be">View Demo</a>
·
<a href="https://github.com/Mephistools/diablo2-protocol/issues">Report Bug</a>
·
<a href="https://github.com/Mephistools/diablo2-protocol/issues">Request Feature</a>
</p>
</p>

<!-- TABLE OF CONTENTS -->
## Table of Contents

* [About the Project](#about-the-project)
* [Built With](#built-with)
* [Getting Started](#getting-started)
* [Prerequisites](#prerequisites)
* [Installation](#installation)
* [Usage](#usage)
* [Projects using diablo2-protocol](#projects-using-diablo2-protocol)
* [Documentation](#documentation)
* [Roadmap](#roadmap)
* [Contributing](#contributing)
* [License](#license)
* [Acknowledgements](#acknowledgements)

## Built With

* <https://github.com/ProtoDef-io/node-protodef>
* <https://github.com/ProtoDef-io/ProtoDef/blob/master/doc/datatypes.md>

<!-- GETTING STARTED -->
## Getting Started

### Prerequisites

```sh
npm install npm@latest -g
```

## Installation
### Installation

```
```js
npm install diablo2-protocol
```

<!-- USAGE EXAMPLES -->
## Usage

Follow bot in a few lines
Expand Down Expand Up @@ -50,52 +105,64 @@ start()

```

See docs/API.md
## Projects using diablo2-protocol

Follow bot example
* [mephistools-sniffer](https://github.com/MephisTools/mephistools-sniffer) diablo 2 packet sniffing.
* [diablo2-live-viewer](https://github.com/MephisTools/diablo2-live-viewer) web map hack, packets table and inventory.
* [AutoTathamet](https://github.com/MephisTools/AutoTathamet) high level API to build bots for example

```
node examples/simpleBot.js [-h] [-v] -au USERNAME -ap PASSWORD -c CHARACTER -gn \
GAMENAME -gp GAMEPASSWORD -gs GAMESERVER -s SIDSERVER \
[-dv DIABLOVERSION] -k1 KEYCLASSIC -k2 KEYEXTENSION
```

Sniffer (Linux / MacOS only)

```
cd example/sniffer
npm install
sudo node sniffer.js
```

## Projects using diablo-protocol

* [diablo2-live-viewer](https://github.com/MephisTools/diablo2-live-viewer) displaying a live diablo map and live packets table
* [AutoTathamet](https://github.com/MephisTools/AutoTathamet) Create Diablo2 bots with a powerful, stable, and high level JavaScript API.
## Documentation

* <https://github.com/MephisTools/diablo2-protocol/wiki/Diablo-2-implementations-and-docs>

<!-- ROADMAP -->
## Roadmap
- [ ] Test all packets
- [x] Sniffer
- [x] more documentation
- [ ] Proxy ?
- [ ] More examples
- [ ] Web / mobile interface

## Docs

### Diablo

* doc of diablo2 implementations https://github.com/MephisTools/diablo2-protocol/wiki/Diablo-2-implementations-and-docs
* packets general description http://www.blizzhackers.cc/viewtopic.php?f=182&t=444264
* dump of a normal connection sequence http://www.blizzhackers.cc/viewtopic.php?t=406445
* index of packets https://bnetdocs.org/packet/index
* example of packet doc https://bnetdocs.org/packet/146
* basic example of packet parsing in python of a diablo2 packet https://gist.github.com/rom1504/8d2824d9d89dbd8b991b102696a1321e

### Libs

* node basic client implementation https://nodejs.org/api/net.html#net_net_createconnection_options_connectlistener
* protodef js implementation doc https://github.com/ProtoDef-io/node-protodef https://github.com/ProtoDef-io/node-protodef/blob/master/doc/api.md and https://github.com/ProtoDef-io/node-protodef/blob/master/example.js
* protodef types https://github.com/ProtoDef-io/ProtoDef/blob/master/doc/datatypes.md
* nodepcap for sniffing https://github.com/node-pcap/node_pcap

See the [open issues](https://github.com/Mephistools/diablo2-protocol/issues) for a list of proposed features (and known issues).

<!-- CONTRIBUTING -->
## Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

<!-- LICENSE -->
## License

Distributed under the MIT License. See `LICENSE` for more information.

<!-- ACKNOWLEDGEMENTS -->

## Acknowledgements

* [GitHub Emoji Cheat Sheet](https://www.webpagefx.com/tools/emoji-cheat-sheet)
* [Img Shields](https://shields.io)
* [Choose an Open Source License](https://choosealicense.com)
* [GitHub Pages](https://pages.github.com)

<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
[contributors-shield]: https://img.shields.io/github/contributors/Mephistools/diablo2-protocol.svg?style=flat-square
[contributors-url]: https://github.com/Mephistools/diablo2-protocol/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/Mephistools/diablo2-protocol.svg?style=flat-square
[forks-url]: https://github.com/Mephistools/diablo2-protocol/network/members
[stars-shield]: https://img.shields.io/github/stars/Mephistools/diablo2-protocol.svg?style=flat-square
[stars-url]: https://github.com/Mephistools/diablo2-protocol/stargazers
[issues-shield]: https://img.shields.io/github/issues/Mephistools/diablo2-protocol.svg?style=flat-square
[issues-url]: https://github.com/Mephistools/diablo2-protocol/issues
[license-shield]: https://img.shields.io/github/license/Mephistools/diablo2-protocol.svg?style=flat-square
[license-url]: https://github.com/Mephistools/diablo2-protocol/blob/master/LICENSE.txt
[product-screenshot]: images/screenshot.png
[npm-shield]: https://img.shields.io/npm/v/diablo2-protocol.svg
[npm-url]: http://npmjs.com/package/diablo2-protocol
[build-shield]: https://github.com/Mephistools/diablo2-protocol/workflows/CI/badge.svg
[build-url]: https://github.com/Mephistools/diablo2-protocol/actions?query=workflow%3A%22CI%22
[discord-shield]: https://img.shields.io/badge/chat-on%20discord-brightgreen.svg
[discord-url]: https://discord.gg/9RqtApv
[gitpod-shield]: https://img.shields.io/badge/try-on%20gitpod-brightgreen.svg
[gitpod-url]: https://gitpod.io/#https://github.com/MephisTools/diablo2-protocol
26 changes: 23 additions & 3 deletions data/1.13/d2gs.json
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,7 @@
}
]],
"D2GS_GAMEEXIT": ["container", []],
"D2GS_UNKNOWN3": ["container", []],
"packet": [
"container",
[
Expand Down Expand Up @@ -930,6 +931,7 @@
"0x28": "D2GS_INSERTSOCKETITEM",
"0x29": "D2GS_SCROLLTOTOME",
"0x2A": "D2GS_ITEMTOCUBE",
"0x2B": "D2GS_UNKNOWN3",
"0x2D": "D2GS_UNSELECTOBJ",
"0x2E": "D2GS_CHATUNK1",
"0x2F": "D2GS_NPCINIT",
Expand Down Expand Up @@ -1078,7 +1080,8 @@
"D2GS_SWITCHEQUIP": "D2GS_SWITCHEQUIP",
"D2GS_RESURRECTMERC": "D2GS_RESURRECTMERC",
"D2GS_INVENTORYTOBELT": "D2GS_INVENTORYTOBELT",
"D2GS_GAMEEXIT": "D2GS_GAMEEXIT"
"D2GS_GAMEEXIT": "D2GS_GAMEEXIT",
"D2GS_UNKNOWN3": "D2GS_UNKNOWN3"
}
}
]
Expand Down Expand Up @@ -1298,6 +1301,10 @@
{
"name": "ladder",
"type": "lu8"
},
{
"name": "unknown",
"type": "lu8"
}
]],
"D2GS_LOADSUCCESSFUL": ["container", []],
Expand Down Expand Up @@ -2783,6 +2790,13 @@
}
]],
"D2GS_UNKNOWN38": ["container", []],
"D2GS_UNKNOWN39": ["container", [
{"name":"unknown","type" : ["array", {"count": 356, "type": "lu8" } ] }
]],
"D2GS_UNKNOWN40": ["container", [
{"name":"unknown","type" : ["array", {"count": 12, "type": "lu8" } ] }
]],
"D2GS_UNKOWNFF": ["container", []],
"packet": [
"container",
[
Expand Down Expand Up @@ -2974,7 +2988,10 @@
"0xB2": "D2GS_UNKNOWN37",
"0xB3": "D2GS_IPBAN",
"0xB4": "D2GS_UNKNOWN38",
"0xB5": "D2GS_OVERHEAD"
"0xB5": "D2GS_OVERHEAD",
"0xD5": "D2GS_UNKNOWN39",
"0xF5": "D2GS_UNKNOWN40",
"0xFF": "D2GS_UNKOWNFF"
}
}
]
Expand Down Expand Up @@ -3167,7 +3184,10 @@
"D2GS_UNKNOWN36": "D2GS_UNKNOWN36",
"D2GS_UNKNOWN37": "D2GS_UNKNOWN37",
"D2GS_IPBAN": "D2GS_IPBAN",
"D2GS_UNKNOWN38": "D2GS_UNKNOWN38"
"D2GS_UNKNOWN38": "D2GS_UNKNOWN38",
"D2GS_UNKNOWN39": "D2GS_UNKNOWN39",
"D2GS_UNKNOWN40": "D2GS_UNKNOWN40",
"D2GS_UNKOWNFF": "D2GS_UNKOWNFF"
}
}
]
Expand Down
7 changes: 7 additions & 0 deletions data/1.14/d2gs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,10 @@
{
"name": "ladder",
"type": "lu8"
},
{
"name": "unknown",
"type": "lu8"
}
]],
"D2GS_LOADSUCCESSFUL": ["container", []],
Expand Down Expand Up @@ -2783,6 +2787,7 @@
}
]],
"D2GS_UNKNOWN38": ["container", []],
"D2GS_UNKNOWN39": ["container", []],
"D2GS_UNKOWNFF": ["container", []],
"packet": [
"container",
Expand Down Expand Up @@ -2976,6 +2981,7 @@
"0xB3": "D2GS_IPBAN",
"0xB4": "D2GS_UNKNOWN38",
"0xB5": "D2GS_OVERHEAD",
"0xD5": "D2GS_UNKNOWN39",
"0xFF": "D2GS_UNKOWNFF"
}
}
Expand Down Expand Up @@ -3170,6 +3176,7 @@
"D2GS_UNKNOWN37": "D2GS_UNKNOWN37",
"D2GS_IPBAN": "D2GS_IPBAN",
"D2GS_UNKNOWN38": "D2GS_UNKNOWN38",
"D2GS_UNKNOWN39": "D2GS_UNKNOWN39",
"D2GS_UNKOWNFF": "D2GS_UNKOWNFF"
}
}
Expand Down
Binary file added docs/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading