//public void Send(IClientGCMsg msg) //{ // var clientMsg = new ClientMsgProtobuf<CMsgGCClient>(EMsg.ClientToGC); // clientMsg.Body.msgtype = MsgUtil.MakeGCMsg(msg.MsgType, msg.IsProto); // clientMsg.Body.appid = (uint)570; // clientMsg.Body.payload = msg.Serialize(); // steamClient.Send(clientMsg); //} private void OnConnectionStatus(DotaGCHandler.ConnectionStatus callback) { if (callback.result.status == Dota2.GC.Internal.GCConnectionStatus.GCConnectionStatus_NO_SESSION_IN_LOGON_QUEUE) { dotaIsReady = false; Console.WriteLine("Waiting for LOGON QUEUE 10 seconds..."); Thread.Sleep(TimeSpan.FromSeconds(10)); return; } if (callback.result.status != Dota2.GC.Internal.GCConnectionStatus.GCConnectionStatus_HAVE_SESSION) { dotaIsReady = false; if (dota.Ready) { dota.Stop(); } dota.Start(); } }
private bool ConnectToDota() { if (dota == null) { return(false); } dota.Start(); Thread.Sleep(7000); if (dota.Ready) { return(true); } else { return(false); } }