Ir para conteúdo
  • Cadastre-se
  • 0

ERROR NO GAMESERVER


ChristoferFernandes

Pergunta

Senhores bom dia, estou com um problema na minha gameserver, consegui configurar tudo menos isso.

Exception in thread "main" java.lang.NullPointerException
        at l2p.util.Strings.reload(Strings.java:116)
        at l2p.gameserver.GameServer.<init>(GameServer.java:133)
        at l2p.gameserver.GameServer.main(GameServer.java:491)

Esse é o erro, informando sobre o Strings.reload na página 116, indo na pagina 116 é um código VOID.

public static void reload()
{
   Files.cacheClean();
   String[] pairs = Files.read("data/translit.txt").split("\n");
   tr = new String[pairs.length * 2];
   for(int i = 0; i < pairs.length; i++)
   {
      String[] ss = pairs[i].split(" +");
      tr[i * 2] = ss[0];
      tr[i * 2 + 1] = ss[1];
   } copiei da pagina 113 até a 118, sendo que o erro está nesse meio, pois é isso que o gameserver indica

Sobre o segundo error init JAVA 133 no gameserver

public GameServer() throws Exception
{
   Server.gameServer = this;

   _serverStarted = time();

   _log.finest("used mem:" + ((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1024 / 1024) + "MB");

   Strings.reload(); ...... COPIEI DA PÁGINA 125 Até a página 133 QUE É ONDE ESTÁ O ERRO E NÃO CONSIGO ENXERGAR.

Sobre o terceiro error pagina 491.

 

public static void main(String[] args) throws Exception
{
   Server.SERVER_MODE = Server.MODE_GAMESERVER;
   // Local Constants
   final String LOG_FOLDER = "log"; // Name of folder for log file
   final String LOG_NAME = "./config/log.properties"; // Name of log file

   /*** Main ***/
   // Create log folder
   File logFolder = new File(Config.DATAPACK_ROOT, LOG_FOLDER);
   logFolder.mkdir();

   // Create input stream for log file -- or store file data into memory
   InputStream is = new FileInputStream(new File(LOG_NAME));
   LogManager.getLogManager().readConfiguration(is);
   is.close();

   // Initialize config
   Config.load();
   checkFreePorts();
   L2DatabaseFactory.getInstance();
   Log.InitGSLoggers();

   gameServer = new GameServer();......... TOMEI A LIBERDADE DE COPIAR DA PAGINA 468 ATÉ 491.

Não sei como solucionar, pois, ainda estou novo nessa área e estou estudando, gostaria muito da ajuda de vocês

 

Grandes vitórias requer grandes esforços, até onde está disposto a ir pelos seus sonhos ?

Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts recomendados

  • 0
6 horas atrás, ChristoferFernandes disse:

Senhores bom dia, estou com um problema na minha gameserver, consegui configurar tudo menos isso.

Exception in thread "main" java.lang.NullPointerException
        at l2p.util.Strings.reload(Strings.java:116)
        at l2p.gameserver.GameServer.<init>(GameServer.java:133)
        at l2p.gameserver.GameServer.main(GameServer.java:491)

Esse é o erro, informando sobre o Strings.reload na página 116, indo na pagina 116 é um código VOID.


public static void reload()
{
   Files.cacheClean();
   String[] pairs = Files.read("data/translit.txt").split("\n");
   tr = new String[pairs.length * 2];
   for(int i = 0; i < pairs.length; i++)
   {
      String[] ss = pairs[i].split(" +");
      tr[i * 2] = ss[0];
      tr[i * 2 + 1] = ss[1];
   } copiei da pagina 113 até a 118, sendo que o erro está nesse meio, pois é isso que o gameserver indica

Sobre o segundo error init JAVA 133 no gameserver


public GameServer() throws Exception
{
   Server.gameServer = this;

   _serverStarted = time();

   _log.finest("used mem:" + ((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1024 / 1024) + "MB");

   Strings.reload(); ...... COPIEI DA PÁGINA 125 Até a página 133 QUE É ONDE ESTÁ O ERRO E NÃO CONSIGO ENXERGAR.

Sobre o terceiro error pagina 491.

 


public static void main(String[] args) throws Exception
{
   Server.SERVER_MODE = Server.MODE_GAMESERVER;
   // Local Constants
   final String LOG_FOLDER = "log"; // Name of folder for log file
   final String LOG_NAME = "./config/log.properties"; // Name of log file

   /*** Main ***/
   // Create log folder
   File logFolder = new File(Config.DATAPACK_ROOT, LOG_FOLDER);
   logFolder.mkdir();

   // Create input stream for log file -- or store file data into memory
   InputStream is = new FileInputStream(new File(LOG_NAME));
   LogManager.getLogManager().readConfiguration(is);
   is.close();

   // Initialize config
   Config.load();
   checkFreePorts();
   L2DatabaseFactory.getInstance();
   Log.InitGSLoggers();

   gameServer = new GameServer();......... TOMEI A LIBERDADE DE COPIAR DA PAGINA 468 ATÉ 491.

Não sei como solucionar, pois, ainda estou novo nessa área e estou estudando, gostaria muito da ajuda de vocês

 

oque você ta modificando exatamente? oque ta dando erro?, é mais fácil você postar o erro mostrado no seu eclipse, do que uma simples print mostrando o arquivo que tu colocou.

De preferencia, manda o link da source que tu ta usando e o arquivo que tu quer adicionar, só assim analisamos, explique-se a sua situação, para que possamos tentar ajuda-lo.

Link para o comentário
Compartilhar em outros sites


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.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  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.

Processando...




×
×
  • Criar Novo...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.