KeganHollern / DotaMatch

DotaMatch is a .NET library that makes creating and managing dota 2 private lobbies easy.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DotaMatch - .NET Dota 2 Lobby Controller


forthebadge

DotaMatch is a .NET library that makes creating and managing dota 2 private lobbies easy. It works with SteamKit and Paralin's Dota2 Library.

Binaries


forthebadge

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

Documentation


forthebadge

Before you start

You will need:

  • Steam Account with SteamGuard OFF
  • Steam API Key (get one here)

Code

  1. Initialize the DotaClient Class
DotaClient client = DotaClient.Create("<SteamAccountUsername>",
                "<SteamAccountPassword>", 
                "<SteamAPIKey>", 
                new DotaClientParams());;
  1. Connect to the GameCoordinator
client.Connect();
  1. 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 */ }
    ));
  1. 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
    }
}
  1. Reset the bot so a new lobby can be made.
client.Reset();

License


forthebadge

Just like SteamKit and Dota2, DotaMatch is licensed under LGPL.

About

DotaMatch is a .NET library that makes creating and managing dota 2 private lobbies easy.

License:MIT License


Languages

Language:C# 85.2%Language:PowerShell 14.8%