Jump to content
  • 0

help pls !!!


Question

Posted

I have a server l2 brick freya rev 1586.

I have problem olympiad stadiums not working i push stadium :

screenshottpt.png

look error :

Exception in null

java.lang.NullPointerException
at handlers.bypasshandlers.OlympiadObservation.useBypass(OlympiadObservation.java:260)
at l2.brick.gameserver.model.actor.L2Npc.onBypassFeedback(L2Npc.java:1030)
at l2.brick.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:129)
at l2.brick.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:62)
at l2.brick.gameserver.network.L2GameClient.run(L2GameClient.java:1027)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

 

How the fix pls....?

Recommended Posts

  • 0
Posted

look friend : Observation.java

/*

* This program is free software: you can redistribute it and/or modify it under

* the terms of the GNU General Public License as published by the Free Software

* Foundation, either version 3 of the License, or (at your option) any later

* version.

* 

* This program is distributed in the hope that it will be useful, but WITHOUT

* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS

* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more

* details.

* 

* You should have received a copy of the GNU General Public License along with

* this program. If not, see <http://www.gnu.org/licenses/>.

*/

package handlers.bypasshandlers;



import java.util.StringTokenizer;



import l2.brick.gameserver.handler.IBypassHandler;

import l2.brick.gameserver.instancemanager.SiegeManager;

import l2.brick.gameserver.model.actor.L2Character;

import l2.brick.gameserver.model.actor.L2Npc;

import l2.brick.gameserver.model.actor.instance.L2PcInstance;

import l2.brick.gameserver.network.SystemMessageId;

import l2.brick.gameserver.network.serverpackets.ActionFailed;

import l2.brick.gameserver.network.serverpackets.ItemList;

import l2.brick.gameserver.network.serverpackets.SystemMessage;



public class Observation implements IBypassHandler

{

private static final String[] COMMANDS =

{

	"observesiege",

	"observeoracle",

	"observe"

};



public boolean useBypass(String command, L2PcInstance activeChar, L2Character target)

{

	if (!(target instanceof L2Npc))

		return false;



	try

	{

		if (command.toLowerCase().startsWith(COMMANDS[0])) // siege

		{

			String val = command.substring(13);

			StringTokenizer st = new StringTokenizer(val);

			st.nextToken(); // Bypass cost



			if (SiegeManager.getInstance().getSiege(Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken())) != null)

				doObserve(activeChar, (L2Npc)target, val);

			else

				activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ONLY_VIEW_SIEGE));

			return true;

		}

		else if (command.toLowerCase().startsWith(COMMANDS[1])) // oracle

		{

			String val = command.substring(13);

			StringTokenizer st = new StringTokenizer(val);

			st.nextToken(); // Bypass cost

			doObserve(activeChar, (L2Npc)target, val);

			return true;

		}

		else if (command.toLowerCase().startsWith(COMMANDS[2])) // observe

		{

			doObserve(activeChar, (L2Npc)target, command.substring(8));

			return true;

		}



		return false;

	}

	catch (Exception e)

	{

		_log.info("Exception in " + getClass().getSimpleName());

	}

	return false;

}



private static final void doObserve(L2PcInstance player, L2Npc npc, String val)

{

	StringTokenizer st = new StringTokenizer(val);

	long cost = Long.parseLong(st.nextToken());

	int x = Integer.parseInt(st.nextToken());

	int y = Integer.parseInt(st.nextToken());

	int z = Integer.parseInt(st.nextToken());



	if (player.reduceAdena("Broadcast", cost, npc, true))

	{

		// enter mode

		player.enterObserverMode(x, y, z);

		player.sendPacket(new ItemList(player, false));

	}

	player.sendPacket(ActionFailed.STATIC_PACKET);

}



public String[] getBypassList()

{

	return COMMANDS;

}

}

you see a mistake;

  • 0
Posted

sorry my friend now i see i have mistake here :

OlympiadObservation.java

/*

* This program is free software: you can redistribute it and/or modify it under

* the terms of the GNU General Public License as published by the Free Software

* Foundation, either version 3 of the License, or (at your option) any later

* version.

* 

* This program is distributed in the hope that it will be useful, but WITHOUT

* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS

* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more

* details.

* 

* You should have received a copy of the GNU General Public License along with

* this program. If not, see <http://www.gnu.org/licenses/>.

*/

package handlers.bypasshandlers;



import java.util.logging.Level;



import l2.brick.gameserver.handler.IBypassHandler;

import l2.brick.gameserver.model.actor.L2Character;

import l2.brick.gameserver.model.actor.instance.L2OlympiadManagerInstance;

import l2.brick.gameserver.model.actor.instance.L2PcInstance;

import l2.brick.gameserver.model.entity.DM;

import l2.brick.gameserver.model.entity.LMEvent;

import l2.brick.gameserver.model.entity.TvTEvent;

import l2.brick.gameserver.model.entity.TvTRoundEvent;

import l2.brick.gameserver.model.olympiad.Olympiad;

import l2.brick.gameserver.model.olympiad.OlympiadGameManager;

import l2.brick.gameserver.model.olympiad.OlympiadGameTask;

import l2.brick.gameserver.model.olympiad.OlympiadManager;

import l2.brick.gameserver.network.SystemMessageId;

import l2.brick.gameserver.network.serverpackets.NpcHtmlMessage;

import l2.brick.gameserver.network.serverpackets.SystemMessage;

import l2.brick.util.StringUtil;



/**

* 

* @author DS

*

*/

public class OlympiadObservation implements IBypassHandler

{

private static final String[] COMMANDS =

{

	"arenalist",

	"arenachange"

};



public final boolean useBypass(String command, L2PcInstance activeChar, L2Character target)

{

	try

	{

		final boolean isManager = target instanceof L2OlympiadManagerInstance;

		if (!isManager)

		{

			// without npc command can be used only in observer mode on arena

			if (!activeChar.inObserverMode()

					|| activeChar.isInOlympiadMode()

					|| activeChar.getOlympiadGameId() < 0)

				return false;

		}



		if (command.startsWith(COMMANDS[0])) //list

		{

			NpcHtmlMessage message = new NpcHtmlMessage(0);

			if (command.length() < 10)

			{

				if (isManager)

				{

					message.setFile(activeChar.getHtmlPrefix(), Olympiad.OLYMPIAD_HTML_PATH + "olympiad_observe.htm");

					message.replace("%objectId%", String.valueOf(target.getObjectId()));

				}

				else

					message.setFile(activeChar.getHtmlPrefix(), Olympiad.OLYMPIAD_HTML_PATH + "olympiad_arena_observe.htm");



				activeChar.sendPacket(message);

				return true;

			}



			final int firstArena, lastArena;

			switch (Integer.parseInt(command.substring(10).trim()))

			{

				case 1:

					firstArena = 0;

					lastArena = 21;

					break;

				case 2:

					firstArena = 22;

					lastArena = 43;

					break;

				case 3:

					firstArena = 44;

					lastArena = 65;

					break;

				case 4:

					firstArena = 66;

					lastArena = 87;

					break;

				default:

					return false;

			}



			StringBuilder list = new StringBuilder(3500);

			OlympiadGameTask task;



			if (isManager)

			{

				message.setFile(activeChar.getHtmlPrefix(), Olympiad.OLYMPIAD_HTML_PATH + "olympiad_observe_list.htm");

				for (int i = firstArena; i <= lastArena; i++)

				{

					task = OlympiadGameManager.getInstance().getOlympiadTask(i);

					if (task != null)

					{

						StringUtil.append(list,

								"<a action=\"bypass -h npc_%objectId%_arenachange ",

								String.valueOf(i),

								"\">Arena ",

								String.valueOf(i + 1),

								"   ");



						if (task.isGameStarted())

						{

							if (task.isBattleStarted())

								StringUtil.append(list, "&$1719;"); // Playing

							else

								StringUtil.append(list, "&$1718;"); // Standby



							StringUtil.append(list,

									"   ",

									task.getGame().getPlayerNames()[0],

									"  :  ",

									task.getGame().getPlayerNames()[1]);

						}

						else

						{

							StringUtil.append(list, "&$906;", // Initial State

									"</td><td> ");

						}



						StringUtil.append(list, "</a><br>");

					}

				}

				message.replace("%list%", list.toString());

				message.replace("%objectId%", String.valueOf(target.getObjectId()));

			}

			else

			{

				message.setFile(activeChar.getHtmlPrefix(), Olympiad.OLYMPIAD_HTML_PATH + "olympiad_arena_observe_list.htm");					

				for (int i = firstArena; i <= lastArena; i++)

				{

					task = OlympiadGameManager.getInstance().getOlympiadTask(i);

					if (task != null)

					{

						StringUtil.append(list,

								"<tr><td fixwidth=30><a action=\"bypass arenachange ",

								String.valueOf(i),

								"\">",

								String.valueOf(i + 1),

								"</a></td><td fixwidth=60>");



						if (task.isGameStarted())

						{

							if (task.isBattleStarted())

								StringUtil.append(list, "&$1719;"); // Playing

							else

								StringUtil.append(list, "&$1718;"); // Standby



							StringUtil.append(list,

									"</td><td>",

									task.getGame().getPlayerNames()[0],

									" ",

									task.getGame().getPlayerNames()[1]);

						}

						else

						{

							StringUtil.append(list, "&$906;", // Initial State

									"</td><td> ");

						}



						StringUtil.append(list, "</td><td><font color=\"aaccff\"></font></td></tr>");

					}

				}

			}



			for (int i = firstArena; i <= lastArena; i++)

			{

				task = OlympiadGameManager.getInstance().getOlympiadTask(i);

				if (task != null)

				{

					StringUtil.append(list,

							"<tr><td fixwidth=30><a action=\"bypass arenachange ",

							String.valueOf(i),

							"\">",

							String.valueOf(i + 1),

							"</a></td><td fixwidth=60>");



					if (task.isGameStarted())

					{

						if (task.isBattleStarted())

							StringUtil.append(list, "&$1719;"); // Playing

						else

							StringUtil.append(list, "&$1718;"); // Standby



						StringUtil.append(list,

								"</td><td>",

								task.getGame().getPlayerNames()[0],

								" ",

								task.getGame().getPlayerNames()[1]);

					}

					else

					{

						StringUtil.append(list, "&$906;", // Initial State

								"</td><td> ");

					}



					StringUtil.append(list,

							"</td><td><font color=\"aaccff\"></font></td></tr>");

				}

				message.replace("%list%", list.toString());

			}



			activeChar.sendPacket(message);

			return true;

		}

		else //change

		{

			if (isManager)

			{

				if (OlympiadManager.getInstance().isRegisteredInComp(activeChar))

				{

					activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.WHILE_YOU_ARE_ON_THE_WAITING_LIST_YOU_ARE_NOT_ALLOWED_TO_WATCH_THE_GAME));

					return false;

				}

				if (!TvTEvent.isInactive() && TvTEvent.isPlayerParticipant(activeChar.getObjectId()))

				{

					activeChar.sendMessage("You can not observe games while registered for TvT");

					return false;

				}

				if (!LMEvent.isInactive() && LMEvent.isPlayerParticipant(activeChar.getObjectId()))

				{

					activeChar.sendMessage("You can not observe games while registered for LM");

					return false;

				}

				if (!DM.isInactive() && DM.isPlayerParticipant(activeChar.getObjectId()))

				{

					activeChar.sendMessage("You can not observe games while registered for DM");

					return false;

				}

				if (!TvTRoundEvent.isInactive() && TvTRoundEvent.isPlayerParticipant(activeChar.getObjectId()))

				{

					activeChar.sendMessage("You can not observe games while registered for TvT Round");

					return false;

				}

			}



			final int arenaId = Integer.parseInt(command.substring(12).trim());

			final OlympiadGameTask nextArena = OlympiadGameManager.getInstance().getOlympiadTask(arenaId);

			if (nextArena != null)

			{

				activeChar.enterOlympiadObserverMode(nextArena.getZone().getSpawns().get(0), arenaId);

				return true;

			}

		}

	}

	catch (Exception e)

	{

		_log.log(Level.INFO, "Exception in " + e.getMessage(), e);

	}

	return false;

}



public final String[] getBypassList()

{

	return COMMANDS;

}

}

  • 0
Posted

i dont find something about updates.

i have find only H5 update but they dont working in freya error game console.

the problem is here when i click arena :

screenshottpt.png

 

error:

Exception in null

java.lang.NullPointerException
at handlers.bypasshandlers.OlympiadObservation.useBypass(OlympiadObservation.java:260)
at l2.brick.gameserver.model.actor.L2Npc.onBypassFeedback(L2Npc.java:1030)
at l2.brick.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:129)
at l2.brick.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:62)
at l2.brick.gameserver.network.L2GameClient.run(L2GameClient.java:1027)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

:P

  • 0
Posted

I told you already you have some corrupted XML, it could be an outdated XML or one with typos or incomplete...

 

I know where the error is I read the code, it gets a null zone, that happens when it fails to find it, meaning is not properly loaded from XML files.

  • 0
Posted

you mean this? olympiad_stadium_zones.xml

 

Yes, that zone XML files.

 

Try to find the file from their SVN that worked, you may need to test a few...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...