From the author:
Features:Quote:
I present to you a little program I came with that monitors the BDO clients connection status and sends a Telegram message if it disconnects (and more). Before I get into the details, let's get some things out of the way: yes, this is my very first post on Reddit, but was a silent reader of this site for quite some time now. This subreddit has been a good resource and hence I felt like contributing something back would be the right thing. As for the program itself, it is written in Go. Note that I do not have a professional IT background and do all of my programming in R. As R is not appropriate for this kind of program I tried to "learn" Go in a couple of evenings, which is why the code quality is not the greatest (to put it lightly). Anyway, let's get to the important part!
- Monitors the BlackDesert64.exe and checks its connection status
- Detects if the client disconnected, even if BDO is running minimized in the system tray
- Sends a Telegram message to inform you about the disconnect
- (optionally) kills the BDO client (currently disabled, need to find a more reliable method)
- (optionally) shuts down the computer
Getting Started:
- Download the compiled executable file from GitHub ()
- Run BDO-Watchdog.exe once, which will create a config file in the same directory (config.yml) (NOTE: before launching the program right-click on the .exe -> Properties -> Allow Access. Otherwise, Windows will prevent its execution.)
- Edit the config file with any text editor and fill in the credentials for the Telegram service (see below for instructions how to set up a Telegram bot)
- Login to BDO and then start BDO-Watchdog.exe
- Enjoy the re-assuring feeling of no longer missing a disconnect
- ???
- Profit
HOW IT WORKS:
- For the curious, some technical details on the implementation:
- Check if the designated process is currently running
- Obtain the process ID (PID)
- Run cmd.exe netstat -aon and find the PID its output
- Send a Telegram message using a URL query string
- (optionally) tries to kill the process (currently disabled because unreliable)
- (optionally) shuts down the computer (cmd /C shutdown /s)
CONFIGURATION
On first startup the program creates the config.yml file, where you can provide the details of your Telegram bot. It also contains some program specific options.
Option | Description |
token | The token is a string along the lines of AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw that is required to authorize the bot |
botid | A unique ID of your bot along the lines of 123456789 |
chatid | Unique identifier for the target chat or username of the target supergroup or channel |
message | The message your bot sends in case of a disconnect |
stayalive | By default, the program closes if it has detected a disconnect |
process | The process to be monitored, defaults to BlackDesert64.exe |
timebetweenchecksins | Time in seconds to wait between each polling interval |
shutdownondc | Shut down the computer after the client disconnected |
killondc | Kill the process after it disconnected CURRENTLY DISABLED |
SETTING UP THE TELEGRAM BOT
- for your favorite platform
- Initiate chat with the
- Enter /newbot and follow instructions. If successful, you will receive the bot id and token (in the form of <botid:token>).
- Initiate a conversation with your bot by entering telegram.me/<bot_username> in your browser
- Retrieve your personal user/chat id by entering https://api.telegram.org/bot<BOT_ID>:<TOKEN>/getUpdates. You will see a JSON object that contains "from":{"id":12345678,[...]". The id is the chat id you will need.
- Finally, open config.yml and copy the bot id, token and chat id in the corresponding fields. Done!
COMPILING BDO WATCHDOG FROM SOURCE
If you want to compile this program yourself you will need the following programs/tools:
- (optional)
- (optional)
Source Below, no need for VirusScan Results.