Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

KeganHollern/DotaMatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

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.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published