Skip to content

Setting up the bot

Thor Conzales edited this page Jul 6, 2017 · 14 revisions

Before running the bot you have to set it up and configure it.

A lot of it is already configured but some critical steps you have to do yourself.

Setting up the binaries

2 set of binaries are required: Dota2SentinelHost and Dota2LobbyBot You can either build both of the projects or download them (built for 64 bit Windows7/Windows Server 2008 R2 and up): Dota2SentinelHost and Dota2LobbyBot. If you are running the project from Visual Studio Debug mode then bot stays in silent mode and won't make any noise in game lobbies. If not then place those binaries in separate folders. Read here more for building the bot.

Database setup

You need to download and install Postgres SQL database. Once installed you have to create a blank database. Tables are created automatically.

Preparing Steam users

Next step is to find 2 Steam users. Both of them must have Steam Guard disabled.

First user which is used by the coordinator/host bot has to be non-limited account with at least Dota rank 5 in order to use public chat. Otherwise bot's chat responses are not going through.

Another user has no prerequisites other than disabled Steam Guard. This bot is used to host actual lobbies and game lobbies so far have no chat restrictions.

Configuration files

Configuration files reside in Dota2SentineHost/Config directory. There are 2 files: config.json and log4net.xml.

log4net.xml is a logging configuration, make sure the check the output path in log4net->appender->file section.

config.json contains everything else. Following sections you must configure yourself: connectionString, admins, coordinatorBot, lobbyBothPath, lobbyBotsPool.

For generating a magic number needed for lobby bot credentials read more here.

Games already come pre-configured for Overthrow and Dota 10vs10. However if they will receive an update you need to update following parameters: customGameMode, customGameCrc and customGameTimestamp. If they are out of date nobody will be able join your lobby from public listing, only via chat lobby link that the bot shares. To get those values you have to capture and inspect Steam network. Config file contains additional comments exactly where you can expect to find those parameters.

Adding new custom games

Adding new custom games is very similar to previously described updating parameters. To add a new game mode few additional parameters are needed. Follow comments in config.json where to get them.

Running the bot

Once you are finished with the configuration you can try starting it up by launching Dota2SentinelHost/Dota2SentinelHost.exe which will launch a Kestrel web server. If everything was configured correctly you will only see default Kestrel log, informing you that the server is now running on some specific port and log files will appear.

If you don't see any exceptions in the console and see some logs are being produced then it means you have succeeded and you can start using the bot. If you suspect anything to be out of order check the log.

Project should be published as self contained app but in case there are some runtime problems try installing .NET Core Runtime 1.1 or newer.

Running as a service on Windows

There are couple of options for running it as a service:

Auto-recovering

Sometimes it may happen that the steam client times out without reconnecting and for such cases you should build auto restating mechanism that detects if there is no activity and then restarts the service. Example where service is being restarted when there has been no log files written in more than half an hour.