DotaMatch is a .NET library that makes creating and managing dota 2 private lobbies easy. It works with SteamKit and Paralin's Dota2 Library.
Available on NuGet Here
All dependencies will be installed automatically through nuget.
Installing through NuGet Package Manager and .NET CLI
PM> Install-Package DotaMatch -Version 1.0.0
> dotnet add package DotaMatch --version 1.0.0
You will need:
- Steam Account with SteamGuard OFF
- Steam API Key (get one here)
- Initialize the
DotaClient
Class
DotaClient client = DotaClient.Create("<SteamAccountUsername>",
"<SteamAccountPassword>",
"<SteamAPIKey>",
new DotaClientParams());;
- Connect to the GameCoordinator
client.Connect();
- Create a lobby & run the match
client.CreateLobby("<LobbyName>",
"<LobbyPassword>",
new DotaLobbyParams(
new ulong[] { /* List of RADIANT team SteamID64s */ },
new ulong[] { /* List of DIRE team SteamID64s */ }
));
- Getting a match result
//Add event handler for OnGameFinished
client.OnGameFinished += Client_OnGameFinished;
private void Client_OnGameFinished(DotaGameResult Outcome) {
if(Outcome == DotaGameResult.Radiant) {
//Radiant Win
} else if(Outcome == DotaGameResult.Dire) {
// Dire Win
} else {
// Error Occured
}
}
- Reset the bot so a new lobby can be made.
client.Reset();