Dervish
2010-09-06 13:31:34
These procedures are one's i've made to make it so that you will not log into a world which is over populated where you will auto :
MarkWorld will make the world you are currently in Marked.
ChangeWorldMark changes the world to another one, with your settings :
Mark : mark the world using MarkWorld or not ?
amountofplayers : how many players to detect for it to change the world ?
MemberWorld : should it also consider member worlds to login to ?
PvPWorld : should it also consider PvPWorlds to login to ?
Using these would require to add :
Somewhere in the LoginPlayer; though so that there is a CurrentWorld_ marked.
TL;DR :
MarkWorld : marks the world you're in so that you won't log into it using ChangeMarkWorld.
ChangeMarkWorld : logs into a non marked world with your settings
Edit : needless to say these need reflection.
procedure MarkWorld;
var
MarkedWorlds : TIntegerArray;
CurrentWorld_ : Integer;
begin
MarkedWorlds[((high(MarkedWorlds))+1)] := CurrentWorld_;
end; MarkWorld will make the world you are currently in Marked.
procedure ChangeWorldMark(mark: boolean;
amountofplayers : integer;
MemberWorld, PvPWorld : boolean);
var
MarkedWorlds : TIntegerArray;
CurrentWorld_, X: Integer;
GoodWorld : Boolean;
begin
If ((high(GetPlayers)) > amountofplayers) then
begin
Writeln('It would seem that there are too many players in this world.');
if (mark) then
MarkWorld;
repeat
CurrentWorld_ := RandomWorld(MemberWorld,PvPWorld);
for x:=0 to high(MarkedWorlds) do
begin
if (CurrentWorld_ = MarkedWorlds[x]) then
break;
GoodWorld := True;
end;
until(GoodWorld);
SelectWorld(CurrentWorld_);
LoginPlayer;
end;
end; ChangeWorldMark changes the world to another one, with your settings :
Mark : mark the world using MarkWorld or not ?
amountofplayers : how many players to detect for it to change the world ?
MemberWorld : should it also consider member worlds to login to ?
PvPWorld : should it also consider PvPWorlds to login to ?
Using these would require to add :
CurrentWorld_ := RandomWorld(MemberWorld,PvPWorld);
SelectWorld(CurrentWorld_); Somewhere in the LoginPlayer; though so that there is a CurrentWorld_ marked.
TL;DR :
MarkWorld : marks the world you're in so that you won't log into it using ChangeMarkWorld.
ChangeMarkWorld : logs into a non marked world with your settings
Edit : needless to say these need reflection.