SRL Archive - SRL Archives

"Player already logged" in Login.scar


Harry

2008-03-16 22:59:05

Hi :)

Shouldn't in Login.scar
            'already'  : begin //Account already logged in
Actions := ['Your account is already logged in',0];
LastPlayer := CurrentPlayer;
repeat
CurrentPlayer := (CurrentPlayer + 1) mod HowManyPlayers;
Wait(200);
until (Players[CurrentPlayer].Active) and (CurrentPlayer <> LastPlayer);
be replaced with something so if you use a 1 player script it won't have an infinate loop in the repeat? Because on a 1 player script the player is probably active but it has until (CurrentPlayer <> LastPlayer) so INFINATE LOOP! :)

So whatcha gonna do about it SRL? ;)
~ Harry

Wizzup?

2008-03-17 08:27:47

Actually, we have always made that infinity loop on purpose.
This might allow you to use PHP-> Remote Control, so you can 'restart' your scripts' users. I don't see a problem with this infinite loop. :)

Harry

2008-03-17 15:03:33

Me and other users do ;) For one player scripts…

From: bink830
haha, lol
is there anyway you can add something to make it try to login at least once after a minute if it says you are already logged in?


Fix please :)

EvilChicken!

2008-03-17 15:37:08

I'm sorry Wizzup?, but I agree with Hy. I've made a script that is unable to use a certain fuction because of this endless loop. Lets say, all players are false and I need the script to do something AFTER that the payers are false. Won't work because of endless loop. But I've made my own solution to this.

Maybe made an seectable option..?

Harry

2008-03-18 17:01:45

Yeah,… please fix? :D

Starblaster100

2008-03-18 19:18:34

Post your fixes then, and we'll check them out…

Harry

2008-03-18 19:20:11

Replace

repeat
CurrentPlayer := (CurrentPlayer + 1) mod HowManyPlayers;
Wait(200);
until (Players[CurrentPlayer].Active) and (CurrentPlayer <> LastPlayer);

with

NextPlayer(True);
:p

EvilChicken!

2008-03-18 20:45:51

Hy, your fix wil still end up in a endless loop. Just look at the procs. EVERY endless loop needs to be taken out.

Harry

2008-03-18 20:47:11

No it should not. NextPlayer does not contain endless loops (UNLESS all players are false ;))

EvilChicken!

2008-03-18 21:05:14

THATS what I need being fixed. What if I want the script to do someting AFTER that all the players are false?

marpis

2009-08-23 02:56:08

Endless loop also prevents ScriptTerminate to proc..

Griff

2009-08-23 03:25:43

From: marpis
Endless loop also prevents ScriptTerminate to proc..


Dude, look at the dates…

ZephyrsFury

2009-08-23 07:23:49

Solution:


procedure InEndlessLoop;
begin
if (AllPlayersInactive) then TerminateScript;
end;


then in SetupScript:


SRL_Procs[srl_InNextPlayerLoop] := @InEndlessLoop;

or just check the number of inactive players before you call NextPlayer;