02-26-2011, 09:34 PM
Как обычно мне нужна ваша помощь
При попытке компиляции вот такая ошибка:
Что я там запорол?
Код:
public static synchronized void onBypass(String command, L2PcInstance playerInstance)
{
if (playerInstance == null || !isParticipating())
return;
final String htmContent;
if (command.equals("tvt_event_participation"))
{
NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(0);
int playerLevel = playerInstance.getLevel();
[COLOR="Red"]String IPRegPlayer = playerInstance.getClient().getConnection().getInetAddress().getHostAddress();
for(L2PcInstance pl : playerInstance)
if (pl!=null)
if(pl.getClient().getConnection().getInetAddress().getHostAddress().equals(IPRegPlayer))
{
htmContent = HtmCache.getInstance().getHtm(htmlPath+"IP.htm");
if (htmContent != null)
npcHtmlMessage.setHtml(htmContent);
}[/COLOR]
if (playerInstance.isCursedWeaponEquipped())
{
htmContent = HtmCache.getInstance().getHtm(htmlPath+"CursedWeaponEquipped.htm");
if (htmContent != null)
npcHtmlMessage.setHtml(htmContent);
}
else if (Olympiad.getInstance().isRegistered(playerInstance))
{
htmContent = HtmCache.getInstance().getHtm(htmlPath+"Olympiad.htm");
if (htmContent != null)
npcHtmlMessage.setHtml(htmContent);
}
else if (playerInstance.getKarma() > 0)
{
htmContent = HtmCache.getInstance().getHtm(htmlPath+"Karma.htm");
if (htmContent != null)
npcHtmlMessage.setHtml(htmContent);
}
else if (playerLevel < Config.TVT_EVENT_MIN_LVL || playerLevel > Config.TVT_EVENT_MAX_LVL)
{
htmContent = HtmCache.getInstance().getHtm(htmlPath+"Level.htm");
if (htmContent != null)
{
npcHtmlMessage.setHtml(htmContent);
npcHtmlMessage.replace("%min%", String.valueOf(Config.TVT_EVENT_MIN_LVL));
npcHtmlMessage.replace("%max%", String.valueOf(Config.TVT_EVENT_MAX_LVL));
}
}
else if (_teams[0].getParticipatedPlayerCount() == Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS && _teams[1].getParticipatedPlayerCount() == Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS)
{
htmContent = HtmCache.getInstance().getHtm(htmlPath+"TeamsFull.htm");
if (htmContent != null)
{
npcHtmlMessage.setHtml(htmContent);
npcHtmlMessage.replace("%max%", String.valueOf(Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS));
}
}
else if (!payParticipationFee(playerInstance))
{
htmContent = HtmCache.getInstance().getHtm(htmlPath+"ParticipationFee.htm");
if (htmContent != null)
{
npcHtmlMessage.setHtml(htmContent);
npcHtmlMessage.replace("%fee%", getParticipationFee());
}
}
else if (addParticipant(playerInstance))
npcHtmlMessage.setHtml(HtmCache.getInstance().getHtm(htmlPath+"Registered.htm"));
else
return;
playerInstance.sendPacket(npcHtmlMessage);
}
else if (command.equals("tvt_event_remove_participation"))
{
removeParticipant(playerInstance.getObjectId());
NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(0);
npcHtmlMessage.setHtml(HtmCache.getInstance().getHtm(htmlPath+"Unregistered.htm"));
playerInstance.sendPacket(npcHtmlMessage);
}
}
При попытке компиляции вот такая ошибка:
Код:
compile:
[javac] C:\l2open\Game\build.xml:42: warning: 'includeantruntime' was not se
t, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 1593 source files to C:\l2open\Game\target\classes
[javac] C:\l2open\Game\src\main\java\com\l2open\gameserver\model\entity\TvTE
vent.java:658: foreach not applicable to expression type
[javac] for(L2PcInstance pl : playerInstance)
[javac] ^
[javac] 1 error
Что я там запорол?