Jump to content
  • 0
Dovall Araújo

Erro Fakeplayer

Question

Alguém pode me ajudar com script de Fakeplaers  do pacote L2Mythras H5  quando eu tento criar o Fake  com este comando // create_fake_players ou com / / create_fake_players 50i obter este erro 

---------------------------------------------------------------------------------------

[14:28:50] ERROR AdminCommandHandler: Error while using Admin Command!
java.lang.ArrayIndexOutOfBoundsException: 1
        at l2f.gameserver.handler.admincommands.impl.AdminFakePlayers.useAdminCommand(AdminFakePlayers.java:25)
        at l2f.gameserver.handler.admincommands.AdminCommandHandler.useAdminCommandHandler(AdminCommandHandler.java:188)
        at l2f.gameserver.network.clientpackets.SendBypassBuildCmd.runImpl(SendBypassBuildCmd.java:32)
        at l2f.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:49)
        at l2f.commons.net.nio.impl.MMOExecutableQueue.run(MMOExecutableQueue.java:39)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

 

 

AdminFakePlayers.java
pacote l2f.gameserver.handler.admincommands.impl;

import l2f.gameserver.handler.admincommands.IAdminCommandHandler;
import l2f.gameserver.model.Player;
import l2f.gameserver.network.FakeGameClient;

classe pública AdminFakePlayers implementa IAdminCommandHandler
{
	enum estático privado Comandos
	{
		admin_create_fake_players;
	}

	@Sobrepor
	público booleano useAdminCommand (Enum comm, String [] wordList, String fullString, Player activeChar)
	{
		Comandos command = (Comandos) comm;

		if (! activeChar.getPlayerAccess (). CanReload)
			retorna falso;

		interruptor (comando)
		{
			case admin_create_fake_players:
				int count = Integer.parseInt (wordList [1]);
				para (int i = 0; i <contagem; i ++)
					novo FakeGameClient (nulo);
				pausa;
		}

		retorno verdadeiro;
	}

	@Sobrepor
	public Enum [] getAdminCommandEnum ()
	{
		return Commands.values ();
	}
}
FakePlayers.java

 

FakePlayers.java

pacote l2f.gameserver;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

importar l2f.commons.dbutils.DbUtils;
import l2f.gameserver.database.DatabaseFactory;
import l2f.gameserver.model.Player;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

classe pública FakePlayers
{
	string final estática privada LOAD_OFFLINE_STATUS = "SELECT * FROM fake_players";
	final estático privado Logger _log = LoggerFactory.getLogger (GameServer.class);
	FakePlayers estáticos privados _instance;
	
	public static FakePlayers getInstance ()
	{
		if (_instance == nulo)
		{
			_instance = new FakePlayers ();
		}
		
		return _instance;
	}
	
	FakePlayers privados ()
	{
		storeFakePlayers ();
	}
	
	public static void storeFakePlayers ()
	{
		_log.info ("FakePlayers: Ativado");
		Conexão con = null;
		int nPlayers = 0;
		experimentar
		{
			Jogador jogador = nulo;
			con = DatabaseFactory.getInstance (). getConnection ();
			PreparedStatement stm = con.prepareStatement (LOAD_OFFLINE_STATUS);
			ResultSet rs = stm.executeQuery ();
			while (rs.next ())
			{
				experimentar
				{
					player = Player.restore (rs.getInt ("obj_Id"));
					player.setFakePlayer ();
					player.spawnMe ();
					if (Config.FAKE_PLAYERS_SIT)
					{
						player.sitDown (nulo);
					}
					player.setOnlineStatus (true);
					player.restoreExp ();
					player.broadcastCharInfo ();
					nPlayers ++;
				}
				captura (exceção e)
				{
					_log.error ("Mecanismo de Jogadores Falsos: Erro ao carregar o player:" + player, e);
					if (jogador! = nulo)
					{
						player.deleteMe ();
					}
				}
			}
			rs.close ();
			stm.close ();
			_log.info ("Loaded:" + nPlayers + "fake Players");
		}
		captura (exceção e)
		{
			_log.error ("Mecanismo de Jogadores Falsos: Erro ao carregar o player:", e);
		}
		finalmente
		{
			DbUtils.closeQuietly (con);
		}
	}
}

 

Edited by Dovall Araújo
Falto Conteúdo

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

nesse caso vc nao fez o tokenizador tem que reescrever de outra maniera

quando vc vai criar um comando composto tem que tokenizar quer uma dica nesse dai use os exemplos do " //spawn "   que sumona os mobs

Share this post


Link to post
Share on other sites

Precisando de Dedicado ou VPS?

Conheça a L2JCenter

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.

Loading...




     



×
×
  • Create New...