/// <summary> /// Internally create an instance of the GC handler. /// </summary> /// <param name="client"></param> /// <param name="appId"></param> /// <param name="_engine"></param> internal DotaGCHandler(SteamClient client, Games appId, ESourceEngine _engine) { gameId = appId; engine = _engine; SteamClient = client; gcConnectTimer = new Timer(5000); gcConnectTimer.Elapsed += (sender, args) => { if (!running) { gcConnectTimer.Stop(); return; } SayHello(); }; }
/// <summary> /// Internally create an instance of the GC handler. /// </summary> /// <param name="client"></param> /// <param name="appId"></param> /// <param name="_engine"></param> internal DotaGCHandler(SteamClient client, Games appId, ESourceEngine _engine) { gameId = appId; engine = _engine; SteamClient = client; // Usually we'd have around 200-600 items. EconItems = new Dictionary <ulong, CSOEconItem>(300); // Reasonably a bot wouldn't have very many of these. LeagueViewPasses = new Dictionary <ulong, CSOEconItemLeagueViewPass>(5); // Generally this seems to be 2 MapLocationStates = new Dictionary <int, CSODOTAMapLocationState>(2); gcConnectTimer = new Timer(5000); gcConnectTimer.Elapsed += (sender, args) => { if (!running) { gcConnectTimer.Stop(); return; } SayHello(); }; }
/// <summary> /// Setup the DOTA 2 GC handler on an existing client. /// </summary> /// <param name="client"></param> /// <param name="appId">Optional, specify the GC to communicate with.</param> /// <param name="engine">Optional, engine to connect to. Default source2.</param> public static void Bootstrap(SteamClient client, Games appId = Games.DOTA2, ESourceEngine engine = ESourceEngine.k_ESE_Source2) { client.AddHandler(new DotaGCHandler(client, appId, engine)); }
/// <summary> /// Internally create an instance of the GC handler. /// </summary> /// <param name="client"></param> /// <param name="appId"></param> /// <param name="_engine"></param> internal DotaGCHandler(SteamClient client, Games appId, ESourceEngine _engine) { GameID = appId; engine = _engine; SteamClient = client; // Usually we'd have around 200-600 items. EconItems = new Dictionary<ulong, CSOEconItem>(300); // Reasonably a bot wouldn't have very many of these. LeagueViewPasses = new Dictionary<ulong, CSOEconItemLeagueViewPass>(5); // Generally this seems to be 2 MapLocationStates = new Dictionary<int, CSODOTAMapLocationState>(2); gcConnectTimer = new Timer(5000); gcConnectTimer.Elapsed += (sender, args) => { if (!running) { gcConnectTimer.Stop(); return; } SayHello(); }; }