}
@Override
protected void onEvtThink()
{
L2RaceManagerInstance actor = getActor();
if(actor == null)
{
return;
}
MonRaceInfo packet = actor.getPacket();
if(packet == null)
{
return;
}
synchronized(thinking)
{
if(thinking)
{
return;
}
thinking = true;
}
try
{
GArray<Long> newPlayers = new GArray<Long>();
for(L2Player player : L2World.getAroundPlayers(actor, 1200, 200))
{
if(player == null)
{
continue;
}
newPlayers.add(player.getStoredId());
if(!_knownPlayers.contains(player.getStoredId()))
{
player.sendPacket(packet);
}
_knownPlayers.remove(player.getStoredId());
}
L2Player player;
for(Long playerStoreId : _knownPlayers)
{
if((player = L2ObjectsStorage.getAsPlayer(playerStoreId)) != null)
{
actor.removeKnownPlayer(player);
}
}
_knownPlayers = newPlayers;
}
finally