Sync with L2jServer HighFive Mar 25th 2015.
This commit is contained in:
@@ -18,9 +18,11 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.model.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
@@ -61,15 +63,15 @@ public final class BlockCheckerEngine
|
||||
// The object which holds all basic members info
|
||||
protected ArenaParticipantsHolder _holder;
|
||||
// Maps to hold player of each team and his points
|
||||
protected HashMap<L2PcInstance, Integer> _redTeamPoints = new HashMap<>();
|
||||
protected HashMap<L2PcInstance, Integer> _blueTeamPoints = new HashMap<>();
|
||||
protected Map<L2PcInstance, Integer> _redTeamPoints = new ConcurrentHashMap<>();
|
||||
protected Map<L2PcInstance, Integer> _blueTeamPoints = new ConcurrentHashMap<>();
|
||||
// The initial points of the event
|
||||
protected int _redPoints = 15;
|
||||
protected int _bluePoints = 15;
|
||||
// Current used arena
|
||||
protected int _arena = -1;
|
||||
// All blocks
|
||||
protected ArrayList<L2Spawn> _spawns = new ArrayList<>();
|
||||
protected List<L2Spawn> _spawns = new CopyOnWriteArrayList<>();
|
||||
// Sets if the red team won the event at the end of this (used for packets)
|
||||
protected boolean _isRedWinner;
|
||||
// Time when the event starts. Used on packet sending
|
||||
@@ -118,7 +120,7 @@ public final class BlockCheckerEngine
|
||||
// Common z coordinate
|
||||
private static final int _zCoord = -2405;
|
||||
// List of dropped items in event (for later deletion)
|
||||
protected ArrayList<L2ItemInstance> _drops = new ArrayList<>();
|
||||
protected List<L2ItemInstance> _drops = new CopyOnWriteArrayList<>();
|
||||
// Default arena
|
||||
private static final byte DEFAULT_ARENA = -1;
|
||||
// Event is started
|
||||
@@ -597,12 +599,6 @@ public final class BlockCheckerEngine
|
||||
|
||||
for (L2ItemInstance item : _drops)
|
||||
{
|
||||
// npe
|
||||
if (item == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// a player has it, it will be deleted later
|
||||
if (!item.isVisible() || (item.getOwnerId() != 0))
|
||||
{
|
||||
@@ -651,12 +647,12 @@ public final class BlockCheckerEngine
|
||||
}
|
||||
|
||||
/**
|
||||
* Reward the speicifed team as a winner team 1) Higher score - 8 extra 2) Higher score - 5 extra
|
||||
* Reward the specified team as a winner team 1) Higher score - 8 extra 2) Higher score - 5 extra
|
||||
* @param isRed
|
||||
*/
|
||||
private void rewardAsWinner(boolean isRed)
|
||||
{
|
||||
HashMap<L2PcInstance, Integer> tempPoints = isRed ? _redTeamPoints : _blueTeamPoints;
|
||||
Map<L2PcInstance, Integer> tempPoints = isRed ? _redTeamPoints : _blueTeamPoints;
|
||||
|
||||
// Main give
|
||||
for (Entry<L2PcInstance, Integer> points : tempPoints.entrySet())
|
||||
@@ -713,7 +709,7 @@ public final class BlockCheckerEngine
|
||||
*/
|
||||
private void rewardAsLooser(boolean isRed)
|
||||
{
|
||||
HashMap<L2PcInstance, Integer> tempPoints = isRed ? _redTeamPoints : _blueTeamPoints;
|
||||
Map<L2PcInstance, Integer> tempPoints = isRed ? _redTeamPoints : _blueTeamPoints;
|
||||
|
||||
for (Entry<L2PcInstance, Integer> entry : tempPoints.entrySet())
|
||||
{
|
||||
@@ -726,7 +722,7 @@ public final class BlockCheckerEngine
|
||||
}
|
||||
|
||||
/**
|
||||
* Telport players back, give status back and send final packet
|
||||
* Teleport players back, give status back and send final packet
|
||||
*/
|
||||
private void setPlayersBack()
|
||||
{
|
||||
|
Reference in New Issue
Block a user