NCDS
2011-01-15 22:49:12
Instead of just 'LogoutOnMod', why not have a 'SwitchOnMod' as well? This way instead of logging out and just waiting to log back in, it gives the user the option to just switch worlds.
To add this…
Players.scar:
Patch:
AntiRandoms.scar:
Also, fixed a possible infinite loop in ChangeWorld..
WorldSwitcher.scar:
Just seemed like some pretty positive changes to me.
To add this…
Players.scar:
Patch:
--- players.scar (revision 689)
+++ players.scar (working copy)
@@ -93,6 +93,11 @@
Description: If you wish to logout, wait then login again when a mod is found. }
var
LogoutOnMod: Boolean;
+
+{ var SwitchOnMod: Boolean;
+ Description: If you wish to logout, switch worlds then login again when a mod is found. }
+var
+ SwitchOnMod: Boolean;
AntiRandoms.scar:
===================================================================
--- antirandoms.scar (revision 689)
+++ antirandoms.scar (working copy)
@@ -328,15 +328,16 @@
SaveToChatLog;
if (SRL_Procs[srl_OnFindMod] <> nil) then
SRL_Procs[srl_OnFindMod]();
- if (LogoutOnMod) then
+ if (LogoutOnMod) or (SwitchOnMod) then
begin
Players[CurrentPlayer].Rand := 'Found Mod';
- repeat
- Logout;
- Wait(1500 + Random(500));
- until not (LoggedIn);
- Wait(60000 + Random(60000));
- LoginPlayer;
+ WaitFunc(@ExitToLobby, 500, 1500);
+ if SwitchOnMod then
+ ChangeWorld(RandomWorld(Players[CurrentPlayer].Member, Players[CurrentPlayer].WorldInfo[2]))
+ else begin
+ Wait(60000 + Random(60000));
+ LoginPlayer;
+ end;
Players[CurrentPlayer].Rand := '';
end;
end;
Note: LoginPlayer is called in ChangeWorld.Also, fixed a possible infinite loop in ChangeWorld..
WorldSwitcher.scar:
Index: worldswitcher.scar
===================================================================
--- worldswitcher.scar (revision 689)
+++ worldswitcher.scar (working copy)
@@ -456,7 +456,8 @@
*******************************************************************************}
function ChangeWorld(W: Integer): Boolean;
begin
- while LoggedIn do ExitToLobby;
+ if LoggedIn then
+ WaitFunc(@ExitToLobby, 500, 5000);
Result := SelectWorld(W);
LoginPlayer;
end;
Just seemed like some pretty positive changes to me.