Skip to content

Commit

Permalink
Added a delay before pressing the 'Change Realm' button to avoid the …
Browse files Browse the repository at this point in the history
…infamous 'You have been disconnected' error. Fixes #49
  • Loading branch information
highvoltz authored and highvoltz committed Oct 11, 2017
1 parent b988e86 commit 9e7bc91
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion WoW/States/CharacterSelectState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ void ChangeRealm()
_wowManager.CloseGameProcess();
return;
}

// Inserts a delay before pressing button because pressing too fast causes the 'You have been disconnected' error.
// See https://github.com/BosslandGmbH/HBRelog/issues/49
Thread.Sleep(4000);
var changeRealmButton = UIObject.GetUIObjectByName<Button>(_wowManager, "CharSelectChangeRealmButton");
var clickPos = _wowManager.ConvertWidgetCenterToWin32Coord(changeRealmButton);
Utility.LeftClickAtPos(_wowManager.GameWindow, (int)clickPos.X, (int)clickPos.Y);
Expand Down

0 comments on commit 9e7bc91

Please sign in to comment.