Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/andsfonseca/dota2-rpc-client

Allows you to observe the status of your DotA 2 (Defense of the Ancients 2) match within the Discord, through the Rich Presence service. 🎮
https://github.com/andsfonseca/dota2-rpc-client

discord discord-rich-presence discord-rpc-client dota-gsi dota2 rich-presence rpc

Last synced: about 2 months ago
JSON representation

Allows you to observe the status of your DotA 2 (Defense of the Ancients 2) match within the Discord, through the Rich Presence service. 🎮

Awesome Lists containing this project

README

        

# DotA 2 RPC (dota2-rpc-client)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/andsfonseca/dota2-rpc-client)
![GitHub milestone](https://img.shields.io/github/milestones/progress/andsfonseca/dota2-rpc-client/2)
[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fandsfonseca%2Fdota2-rpc-client&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)](#)
[![Website](https://img.shields.io/website?label=Website&url=https%3A%2F%2Fandsfonseca.github.io%2Fdota2-rpc-client%2F)](https://andsfonseca.github.io/dota2-rpc-client/)
![GitHub](https://img.shields.io/github/license/andsfonseca/dota2-rpc-client)

Allows you to observe the status of your DotA 2 (Defense of the Ancients 2) match within the Discord, through the Rich Presence service.

You can access the project website by [clicking here](https://andsfonseca.github.io/dota2-rpc-client/).
## What is?

This is a service that allows you to show your Discord friends information about the matches you play and watch within DotA 2.



Share real-time information about what happens in your game with everyone.

## Features

| Feature | Preview |
|---------|---------|
| Check what your friends are watching. |

|
| Show off your heroes with your favorite skins. |

|
| Show your skills of accumulating money in the game |

|
| Show your items and your buffs. |

|
| Modified map support. |

|
| See your instructors. |

|
| Multiple language support. |

|

## Installation (Windows only)

> See instructions for Linux below

Follow the step-by-step below to install your version of DotA 2 RPC

* Download the latest software version on the [Releases page](https://github.com/andsfonseca/dota2-rpc-client/releases/);
* Unzip the file in a folder of your preference. (There are many files, then be careful!🙃);
* Open the file `install.windows.bat` and everything will be ready!

## Uninstallation (Windows only)

* Open the `uninstall.windows.bat` file to remove the installation of your computer;
* If you want, you can delete all the files.

## Advanced Users (Windows Only)

This software is registered as Windows service. If you are looking for other options, here are other ways to use the application.

```shell
dota2-rpc-client.exe
```

| Flag | Description |
|:-------------------------:|:---------------------------------------------------------------------------------:|
| `-i` | Install the DotA 2 RPC as a service. |
| `-r` | Uninstall the service, if installed. |
| `-s` | If installed, start the service. |
| `-e` | If installed, stop the service. |
| `-f` | Execute the DotA 2 RPC like a Console Application. |

## Running on Linux (Experimental)

Just as a warning it's just a experimental version. If you find any bugs in this version, please report them. The Discord API and other functions commonly used on Windows may not have the same effect on Linux.

Unfortunately, this service has not been adapted to work with `daemon`. So installing and running the application must be done manually from the terminal.

Make the file executable

```shell
chmod +x dota2-rpc-client
```

Use this command to install
```shell
./dota2-rpc-client -i
```

And run the application using

```shell
./dota2-rpc-client
```

### Known bugs:

* A bug related to the discord SDK loop, sometimes returning a "panicked". Probably some problem related to threads. Still looking for a solution.

Temporary solution: Try running until it works.

* A failure to create files and folders, usually caused by missing permissions

Temporary solution: Give the necessary permissions.

## Settings

You can choose what can be displayed and other application settings.

Just modify the [config.json](src/templates/config/config.json) file.

```json
{
"HOST": "127.0.0.1",
"PORT" : 52424,
"LOCALE" : "System",
"DISPLAY_OPTIONS":
{
"AEGIS" : true,
"AGHANIM" : true,
"GOLD_AND_LAST_HIT": true,
"KILL_DEATH_ASSIST" : true,
"SMOKE": true
},
"STEAM_FOLDER": ""
}
```

Below is a brief description of each property.

| Property | Description |
|:------------------------------------ |:----------------------------------------------------------------------------------|
| `HOST` | The url the application will use. (Default: `127.0.0.1`) |
| `PORT` | The port the application will listen on. (Default: `52424`) |
| `LOCALE` | Language used. (Default: `System`, Avaiable options : [LocaleString](lang/), `System` and `Discord` ) |
| `DISPLAY_OPTIONS` | Discord display options. |
| `DISPLAY_OPTIONS:AEGIS` | Whether or not to display the Aegis effect (Default: `true`) |
| `DISPLAY_OPTIONS:AGHANIM` | Whether or not to display the Aghanim effect (Default: `true`) |
| `DISPLAY_OPTIONS:GOLD_AND_LAST_HIT` | Whether or not to display the Gold, last hits and denies (Default: `true`) |
| `DISPLAY_OPTIONS:KILL_DEATH_ASSIST` | Whether or not to display the K/D/A (Default: `true`) |
| `DISPLAY_OPTIONS:SMOKE` | Whether or not to display the smoke effect (Default: `true`) |
| `STEAM_FOLDER` | Steam folder location (Optional, default: Default folder commonly used by steam) |

> If you installed the cfg file manually, when changing the `host` and `port` you will need to change them also in the `gamestate_integration_rpc.cfg` file. See this [issue #1](/../../issues/1).

## Compilation Instructions

Want to improve the project or compile a version outside the official channel?

> See the [Contribution Section](#contribution) to read more instructions or clone this repository.

This project mainly uses 4 libraries to work. Are they:

* [Discord SDK](https://discord.com/developers/docs/intro) - A Library for Integration with the Discord application;
* [Drogon C++](https://github.com/drogonframework/drogon) - A web framework written with C++;
* [SrvLib](https://github.com/Tomenz/SrvLib) - A library for creating services in Windows and Linux created by [@tomenz](https://github.com/tomenz).
* [NFD](https://github.com/btzy/nativefiledialog-extended) - A small C library with that portably invokes native file open, folder select and file save dialogs. Created by [@btzy](https://github.com/btzy) and [@mlabbe](https://github.com/mlabbe).

This is a project made with *CMake*, these libraries are downloaded during the first compilation of the software and placed in a folder called `third_party`.

With the repository downloaded, run the command:

```shell
cmake --build {folder} --config Debug --target dota2-rpc-client -j {threads}
```

> This project uses Conan Package Manager to download [Drogon C++](https://github.com/drogonframework/drogon) and jsoncpp packages. If you use a package manager like `vcpkg` or libs and dlls externally, feel free to modify `CMakeLists.txt` (Just comment out the references to conan 😅).
>
> An installation guide for the *Drogon C++* dependencies can be found on [this page](https://github.com/drogonframework/drogon/wiki/ENG-02-Installation).

## Web Page Compilation Instructions

Would you like to change the project webpage? You can access the files from the `web` directory.

The following frameworks and templates were used:

* [Angular 13](https://angular.io/) - A component-based framework for building scalable web applications;
* [Paradigm Shift](https://html5up.net/paradigm-shift) - A open-source web template created by [@ajlkn](https://github.com/ajlkn)

Instead of using static pages, a framework was used to create the site. So to compile, follow the instructions [available here](https://angular.io/guide/setup-local).

With everything configured, use the command below to run:

```shell
ng serve
```

## Language Contribution

Would you like to translate the app into your language? Create a translation file based on the [en-us.json](lang/en-us.json) file. Then create an _issue_ or a _pull request_ to submit your modification.


## Issues

Feel free to submit issues and enhancement requests.

## Contribution

1. Fork the project
2. Create a _branch_ for your modification (`git checkout -b my-new-resource`)
3. Do the _commit_ (`git commit -am 'Adding a new resource...'`)
4. _Push_ (`git push origin my-new-resource`)
5. Create a new _Pull Request_

## Notes

Images, names, and any entities related to DotA 2 are copyrighted by Valve Corporation. This software only uses the data shared by the game, but it is not related to the original game.