Skip to content

Commit

Permalink
Fix: small changes to the 6h fix
Browse files Browse the repository at this point in the history
Should prolly rename it to 24h fix :p
  • Loading branch information
TheTS committed Jul 1, 2015
1 parent 5f5bc42 commit c56bf75
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
22 changes: 13 additions & 9 deletions lib/core/players.simba
Expand Up @@ -950,7 +950,7 @@ begin
repeat // Wait until the popup appears, or we hit the lobby/isLoggedIn
case inLobby of
true: if isLoggedIn() then exit(true);
false: if lobby.isOpen() then exit(true);
false: if (lobby.isOpen() or isLoggedIn()) then exit(true);
end;

popupMessage := __getPopupMessage();
Expand Down Expand Up @@ -1039,25 +1039,29 @@ var
tries: integer = 1;
reachedMaxTries: boolean;
begin
print('TPlayer.loginToLobby(): ', TDebug.HEADER);
__areDynamicInterfacesSet := false;

if (not self.isActive) then
begin
print('TPlayer.loginToLobby(): Player ' + self.nickname + ' is not active...');
print('TPlayer.loginToLobby(): Player ' + self.nickname + ' is not active...', TDebug.FOOTER);
exit(false);
end;

if (isLoggedIn() or lobby.isOpen()) then exit(true);

if not __setInputBoxes() then
begin
print('TPlayer.loginToLobby(): Failed to find username and/or password box', TDebug.ERROR);
print('TPlayer.loginToLobby(): Failed to find username and/or password box', TDebug.FOOTER);
exit(false);
end;

print('TPlayer.loginToLobby()', TDebug.HEADER);
__areDynamicInterfacesSet := false;

repeat
print('Attempt ' + toStr(tries) + ': ' + capitalize(self.loginName) + ' (' + capitalize(self.displayName) + ')');
if (isLoggedIn() or lobby.isOpen()) then
begin
result := true;
break;
end;

print('Login Attempt ' + toStr(tries) + ': ' + capitalize(self.loginName) + ' (' + capitalize(self.displayName) + ')');

print('Entering username...', TDebug.SUB);
__enterLoginInfo(_boxUsername, self.loginName, true, true);
Expand Down
19 changes: 10 additions & 9 deletions lib/misc/smart.simba
Expand Up @@ -544,7 +544,7 @@ begin
smartSetDebug(false);
addOnTerminate('smartFreeCurrentClient');

print('initSmart()', TDebug.FOOTER);
print('initSmart() result = ' + boolToStr(result), TDebug.FOOTER);
end;

(*
Expand Down Expand Up @@ -674,6 +674,7 @@ procedure smartReloadClient(waitTime: integer);
var
img, r, h, m, s: integer;
begin
print('smartReloadClient():', TDebug.HEADER);
img := -999;
ConvertTime(waitTime, h, m, s);

Expand All @@ -688,7 +689,7 @@ begin
smartFreeCurrentClient();
smartKillClient(__smartCurrentPID);

print('Killed our current client. Waiting ' + intToStr(m) + 'm & ' + intToStr(s) + 's before reloading');
print('Killed current client. Waiting ' + intToStr(m) + 'm & ' + intToStr(s) + 's before reloading SMART');
wait(waitTime);

if initSmart(true) then
Expand Down Expand Up @@ -723,7 +724,7 @@ Kills the current client, and spawns a new one.
.. note::

- By: Olly
- Last Updated: 11 January 2014 by The Mayor
- Last Updated: 1 July 2015 by The Mayor

Example:

Expand All @@ -734,24 +735,24 @@ procedure sixHourFix();
var
i: integer;
begin
print('sixHourFix():', TDebug.HEADER);

for i := 1 to smartResetAttempts do
begin
print('sixHourFix():', TDebug.HEADER);
print('Reset attempt #' + toStr(i));
print('SMART Reload Attempt ' + toStr(i) + '/' + toStr(smartResetAttempts));

if (players.getActive() < 1) then
print('No active players, no use in reloading the client!', TDebug.FATAL);

smartReloadClient((5 * 60000) + random(15000));
smartReloadClient((4 * 60000) + random(60000));

if (waitClientReady()) then
if waitClientReady() then
begin
print('Client succesfully loaded after reload');

if (players[currentPlayer].login()) then
begin
print('Succesfully logged in after client was reloaded');
print('sixHourFix()', TDebug.FOOTER);
print('sixHourFix(): Succesfully logged in after reload', TDebug.FOOTER);
exit();
end else
print('Failed to login player after restart attempt ' + toStr(i), TDebug.ERROR);
Expand Down

0 comments on commit c56bf75

Please sign in to comment.