Skip to content

Commit

Permalink
Battleground Queue fixes (#4648)
Browse files Browse the repository at this point in the history
* Fixes #4644.
* Initialize all battleground queues at startup to reduce overhead of creation/deletion during live server.
* Removes lots of duplicate code between team checks.
* Adds missing checks for script commands bg_leave and bg_desert to only warp players out using the Battleground Queue System.
* Adds documentation for script commands bg_leave and bg_desert to state players will be warped out after when using the Battleground Queue System.
* Optimizes join logic to add new players to the end of the queue rather than the front.
* Cleans up the client messages so certain responses are cleared when they need to be.
Thanks to @Balferian and @Lemongrass3110!
  • Loading branch information
aleos89 committed Feb 21, 2020
1 parent 55645b8 commit 1fc4b8d
Show file tree
Hide file tree
Showing 9 changed files with 169 additions and 368 deletions.
6 changes: 6 additions & 0 deletions doc/script_commands.txt
Expand Up @@ -9390,6 +9390,9 @@ Note: 'bg_reserve' and 'bg_unbook' prevent the Battlegrounds queue from joining
Same as 'bg_leave' but slaps the player with a deserter status so they can't enter another queue for the time
defined in battleground_db (10 minutes by default).

With the Battleground Queue System, it will also warp the player to their previous position when they joined or
to their save point if the map had MF_NOSAVE.

---------------------------------------

*bg_warp <Battle Group>,"<map name>",<x>,<y>;
Expand Down Expand Up @@ -9451,6 +9454,9 @@ OnTimer1000:

Removes attached player from their Battle Group.

With the Battleground Queue System, it will also warp the player to their previous position when they joined or
to their save point if the map had MF_NOSAVE.

---------------------------------------

*bg_destroy <Batte Group>;
Expand Down
6 changes: 4 additions & 2 deletions npc/battleground/flavius/flavius01.txt
Expand Up @@ -538,7 +538,8 @@ bat_b01,10,294,3 script Vintenar#bat_b01_aover 419,{
close;
}
bg_leave;
warp "bat_room",154,150;
if (!getbattleflag("feature.bgqueue"))
warp "bat_room",154,150;
end;

OnInit:
Expand All @@ -562,7 +563,8 @@ bat_b01,389,14,3 script Vintenar#bat_b01_bover 415,{
close;
}
bg_leave;
warp "bat_room",154,150;
if (!getbattleflag("feature.bgqueue"))
warp "bat_room",154,150;
end;

OnInit:
Expand Down
6 changes: 4 additions & 2 deletions npc/battleground/flavius/flavius02.txt
Expand Up @@ -539,7 +539,8 @@ bat_b02,10,294,3 script Vintenar#bat_b02_aover 419,{
close;
}
bg_leave;
warp "bat_room",154,150;
if (!getbattleflag("feature.bgqueue"))
warp "bat_room",154,150;
end;

OnInit:
Expand All @@ -563,7 +564,8 @@ bat_b02,389,14,3 script Vintenar#bat_b02_bover 415,{
close;
}
bg_leave;
warp "bat_room",154,150;
if (!getbattleflag("feature.bgqueue"))
warp "bat_room",154,150;
end;

OnInit:
Expand Down
2 changes: 1 addition & 1 deletion npc/battleground/kvm/kvm02.txt
Expand Up @@ -375,8 +375,8 @@ bat_c02,51,130,5 script KVM Officer#KVM02A 419,{
set Bat_Team,0;
if (!getbattleflag("feature.bgqueue"))
warp "bat_room",154,150;
end;
}
end;
}
bat_c02,148,53,1 duplicate(KVM Officer#KVM02A) KVM Officer#KVM02B 415

Expand Down
4 changes: 2 additions & 2 deletions npc/battleground/kvm/kvm03.txt
Expand Up @@ -374,8 +374,8 @@ bat_c03,51,130,5 script KVM Officer#KVM03A 419,{
}
bg_leave;
set Bat_Team,0;
if (!getbattleflag("feature.bgqueue"))
warp "bat_room",154,150;
if (!getbattleflag("feature.bgqueue"))
warp "bat_room",154,150;
}
end;
}
Expand Down
2 changes: 1 addition & 1 deletion npc/battleground/tierra/tierra02.txt
Expand Up @@ -723,7 +723,7 @@ bat_a02,45,19,3 script Croix Vintenar#a02_b 415,{
callfunc "F_BG_Badge",1,"Croix","Tierra";
}
bg_leave;
if (getbattleflag("feature.bgqueue"))
if (!getbattleflag("feature.bgqueue"))
warp "bat_room",154,150;
end;

Expand Down

0 comments on commit 1fc4b8d

Please sign in to comment.