На корню не правильно.
package ru.ljts.gameserver.network.lineage.serverpackets;
import java.util.Iterator;
import java.util.Map;
import javolution.util.FastMap;
import ru.ljts.gameserver.data.xml.holder.InstantZoneHolder;
import ru.ljts.gameserver.model.Player;
/**
* @author KilRoy
*/
public class ExInZoneWaitingInfo extends L2GameServerPacket
{
private int instanceZoneId = -1;
private Map<Integer, Integer> collapseInstanceTime;
public ExInZoneWaitingInfo(Player player)
{
collapseInstanceTime = new FastMap<Integer, Integer>();
if(player.getActiveReflection() != null)
instanceZoneId = player.getActiveReflection().getInstancedZoneId();
for(int i : player.getInstanceReuses().keySet())
{
int timeToCollapse = InstantZoneHolder.getInstance().getMinutesToNextEntrance(i, player);
if(timeToCollapse > 0)
collapseInstanceTime.put(i, timeToCollapse * 60);
}
}
@Override
protected void writeImpl()
{
writeFe(getClass());
writeD(instanceZoneId);
writeD(collapseInstanceTime.size());
for(Iterator<Integer> i = collapseInstanceTime.keySet().iterator(); i.hasNext()
{
int currentInstanceId = i.next().intValue();
writeD(currentInstanceId);
writeD((collapseInstanceTime.get(currentInstanceId)));
}
}
}