public void Start() { //get game coordinator handler, use in game _steamGameCoordinator = _steamClient.GetHandler <SteamGameCoordinator>(); _callbackManager.Subscribe <SteamGameCoordinator.MessageCallback>(OnGcMessage); //tell that we are playing DOTA var playGame = new ClientMsgProtobuf <CMsgClientGamesPlayed>(EMsg.ClientGamesPlayed); playGame.Body.games_played.Add(new CMsgClientGamesPlayed.GamePlayed { game_id = new GameID(570), // or game_id = APPID, }); _steamClient.Send(playGame); // inform the dota GC that we want a session var clientHello = new ClientGCMsgProtobuf <CMsgClientHello>((uint)EGCBaseClientMsg.k_EMsgGCClientHello) { Body = { engine = ESourceEngine.k_ESE_Source2, client_session_need = 104 } }; AddMessageHandler((uint)EGCBaseClientMsg.k_EMsgGCClientWelcome, Connected); AddMessageHandler((uint)ESOMsg.k_ESOMsg_CacheSubscribed, OnCacheSubscribed); AddMessageHandler((uint)ESOMsg.k_ESOMsg_UpdateMultiple, OnUpdateMultiple); _steamGameCoordinator.Send(clientHello, 570); _status = DotaManagerStatus.Connecting; }
private void Connected(IPacketGCMsg packetGcMsg) { _status = DotaManagerStatus.InGame; }
public void Stop() { _steamClient.RemoveHandler(_steamGameCoordinator); _status = DotaManagerStatus.Stopped; }