void ValidateWithServer() { _loadStatus = LoadStatus.FetchingFromServer; // Connect to server HClient client = new HClient("ValidateWithServer"); client.Connect(HClient.ServerAddress, HClient.ServerPort); client.OnGameInfoResponse += Client_OnGameInfoResponse; client.OnAccountResponse += Client_OnAccountResponse; // Send request client.SendValidateGameInfoRequest(m_GameInfo.AuthString, Encoding.UTF8.GetString(m_GameInfo.Hash, 0, m_GameInfo.Hash.Length)); // Wait for response while (client.Connected && _loadStatus == LoadStatus.FetchingFromServer) { client.Update(); Task.Delay(10).Wait(); } client.Close(); }