L2JMobius

High Five olympiads error

pandim · 15 · 6268

Offline pandim

  • Heir
  • **
    • Posts: 14
Good afternoon!
Error Lineage 2 - HF at the start of the olympiads:

Code: [Select]
2020.03.15 18:00:02,094 INFO 26 org.l2jmobius.gameserver.model.olympiad.Olympiad Olympiad System: Olympiad Games have started.
2020.03.15 18:00:02,110 WARNING 26 org.l2jmobius.gameserver.model.instancezone.Instance Instance: can not find E:\LA2\Mobius_La2HF_server\game\data\instances\E:\LA2\Mobius_La2HF_server\game\data\instances\Olympiad\OlympiadGrassyArena.xml ! E:\LA2\Mobius_La2HF_server\game\data\instances\E:\LA2\Mobius_La2HF_server\game\data\instances\Olympiad\OlympiadGrassyArena.xml (Syntax error in file name, folder name, or volume label)
2020.03.15 18:00:02,354 WARNING 26 org.l2jmobius.gameserver.model.instancezone.Instance Instance: can not find E:\LA2\Mobius_La2HF_server\game\data\instances\E:\LA2\Mobius_La2HF_server\game\data\instances\Olympiad\OlympiadThreeBridgesArena.xml ! E:\LA2\Mobius_La2HF_server\game\data\instances\E:\LA2\Mobius_La2HF_server\game\data\instances\Olympiad\OlympiadThreeBridgesArena.xml (Syntax error in file name, folder name, or volume label)
2020.03.15 18:00:02,357 WARNING 26 org.l2jmobius.gameserver.model.instancezone.Instance Instance: can not find E:\LA2\Mobius_La2HF_server\game\data\instances\E:\LA2\Mobius_La2HF_server\game\data\instances\Olympiad\OlympiadHerossVestigesArena.xml ! E:\LA2\Mobius_La2HF_server\game\data\instances\E:\LA2\Mobius_La2HF_server\game\data\instances\Olympiad\OlympiadHerossVestigesArena.xml (Syntax error in file name, folder name, or volume label)
2020.03.15 18:00:02,359 WARNING 26 org.l2jmobius.gameserver.model.instancezone.Instance Instance: can not find ...

Incorrectly generated file names!

I think the error here is:
inctance.java

Code: [Select]
...
public void loadInstanceTemplate(int templateId)
{
// TODO: Cache templates.
Document doc = null;
final File xml = new File(Config.DATAPACK_ROOT, "data/instances/" + InstanceManager.getInstance().getInstanceTemplateFileName(templateId));

System.out.println("Instance:   " + InstanceManager.getInstance().getInstanceTemplateFileName(templateId));

try
{
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(false);
factory.setIgnoringComments(true);
doc = factory.newDocumentBuilder().parse(xml);

for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{
if ("instance".equalsIgnoreCase(n.getNodeName()))
{
parseInstance(n);
}
}
}
catch (IOException e)
{
LOGGER.log(Level.WARNING, "Instance: can not find " + xml.getAbsolutePath() + " ! " + e.getMessage(), e);

}
catch (Exception e)
{
LOGGER.log(Level.WARNING, "Instance: error while loading " + xml.getAbsolutePath() + " ! " + e.getMessage(), e);
}
}
...


I think it should be like this:
Code: [Select]
...
// TODO: Cache templates.
Document doc = null;
// final File xml = new File(Config.DATAPACK_ROOT, "data/instances/" + InstanceManager.getInstance().getInstanceTemplateFileName(templateId));
final File xml = new File(InstanceManager.getInstance().getInstanceTemplateFileName(templateId));

System.out.println("Instance:   " + InstanceManager.getInstance().getInstanceTemplateFileName(templateId));
...


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16056
After I do this, the Olympiad does not work for me. :D


Offline pandim

  • Heir
  • **
    • Posts: 14
after my editing:

Code: [Select]
[15/03 18:46:50] Olympiad System: Loaded 160 stadiums.


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16056
After your change.
Code: [Select]
[15/03 18:08:52] Instance: can not find C:\eclipse\workspace\L2J_Mobius_CT_2.6_HighFive\dist\game\Olympiad\OlympiadOrbisArena.xml !


Offline pandim

  • Heir
  • **
    • Posts: 14
Something is wrong with file paths :(

after my editing:

[15/03 18:46:50] Olympiad System: Loaded 160 stadiums.

Everything works, before that it did not start.

========================================================
I turned on file name output:

Code: [Select]
public void loadInstanceTemplate(int templateId)
{
// TODO: Cache templates.
Document doc = null;
// final File xml = new File(Config.DATAPACK_ROOT, "data/instances/" + InstanceManager.getInstance().getInstanceTemplateFileName(templateId));
final File xml = new File(InstanceManager.getInstance().getInstanceTemplateFileName(templateId));

System.out.println("Instance:   " + InstanceManager.getInstance().getInstanceTemplateFileName(templateId));

got:

Code: [Select]
[15/03 22:11:43] Olympiad System: Olympiad Games have started.
Instance:   /E:/LA2/Mobius_La2HF_server/game/data/instances/Olympiad/OlympiadGrassyArena.xml
Instance:   /E:/LA2/Mobius_La2HF_server/game/data/instances/Olympiad/OlympiadThreeBridgesArena.xml
...
Instance:   /E:/LA2/Mobius_La2HF_server/game/data/instances/Olympiad/OlympiadThreeBridgesArena.xml
Instance:   /E:/LA2/Mobius_La2HF_server/game/data/instances/Olympiad/OlympiadHerossVestigesArena.xml
Instance:   /E:/LA2/Mobius_La2HF_server/game/data/instances/Olympiad/OlympiadOrbisArena.xml
[15/03 22:11:43] Olympiad System: Loaded 160 stadiums.

everything seems to be right?

PS: I am not a programmer, I do not know Lineage well and do not know English well :)



Online Mobius

  • Distinguished King
  • *****
    • Posts: 16056
Maybe is a localization issue.
No idea, I have not looked into it.


Offline pandim

  • Heir
  • **
    • Posts: 14
Do you work on which operating system?

 ;) I liked your builds - they really work  ;)


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16056

Offline pandim

  • Heir
  • **
    • Posts: 14
I also use Windows, so the problem is not in different OS

Well, then I will deal with the file InstanceManager.java and the format in which the information is stored.
Thank you for your attention!


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16056
Can you try this?
Code: [Select]
Index: java/org/l2jmobius/gameserver/model/instancezone/Instance.java
===================================================================
--- java/org/l2jmobius/gameserver/model/instancezone/Instance.java (revision 6985)
+++ java/org/l2jmobius/gameserver/model/instancezone/Instance.java (working copy)
@@ -459,7 +459,7 @@
  {
  // TODO: Cache templates.
  Document doc = null;
- final File xml = new File(Config.DATAPACK_ROOT, "data/instances/" + InstanceManager.getInstance().getInstanceTemplateFileName(templateId));
+ final File xml = new File("./data/instances/" + InstanceManager.getInstance().getInstanceTemplateFileName(templateId));
  try
  {
  final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();


Offline pandim

  • Heir
  • **
    • Posts: 14
Code: [Select]
2020.03.16 13:07:18,012 INFO 1 org.l2jmobius.gameserver.model.olympiad.Olympiad Olympiad System: Event starts/started: Mon Mar 16 18:00:17 MSK 2020

time now: 13:16

how to run the olympiad?


Offline pandim

  • Heir
  • **
    • Posts: 14
Code: [Select]
// TODO: Cache templates.
Document doc = null;
// final File xml = new File(Config.DATAPACK_ROOT, "data/instances/" + InstanceManager.getInstance().getInstanceTemplateFileName(templateId));
// final File xml = new File(InstanceManager.getInstance().getInstanceTemplateFileName(templateId));
final File xml = new File("./data/instances/" + InstanceManager.getInstance().getInstanceTemplateFileName(templateId));
...

Code: [Select]
2020.03.16 13:26:05,220 INFO 27 org.l2jmobius.gameserver.model.olympiad.Olympiad Olympiad System: Olympiad Games have started.
2020.03.16 13:26:05,292 WARNING 27 org.l2jmobius.gameserver.model.instancezone.Instance Instance: can not find e:\LA2\Mobius_La2HF_server\game\.\data\instances\E:\LA2\Mobius_La2HF_server\game\data\instances\Olympiad\OlympiadGrassyArena.xml ! e:\LA2\Mobius_La2HF_server\game\.\data\instances\E:\LA2\Mobius_La2HF_server\game\data\instances\Olympiad\OlympiadGrassyArena.xml (
Syntax error in file name, folder name, or volume label)
2020.03.16 13:26:05,311 WARNING 27 org.l2jmobius.gameserver.model.instancezone.Instance Instance: can not find e:\LA2\Mobius_La2HF_server\game\.\data\instances\E:\LA2\Mobius_La2HF_server\game\data\instances\Olympiad\OlympiadThreeBridgesArena.xml ! e:\LA2\Mobius_La2HF_server\game\.\data\instances\E:\LA2\Mobius_La2HF_server\game\data\instances\Olympiad\OlympiadThreeBridgesArena.xml (
Syntax error in file name, folder name, or volume label)
2020.03.16 13:26:05,315 WARNING 27 org.l2jmobius.gameserver.model.instancezone.Instance Instance: can not find
...

InstanceManager.getInstance().getInstanceTemplateFileName(templateId)) -
prints the full path with the disk and file name.
example: /E:/LA2/Mobius_La2HF_server/game/data/instances/Olympiad/OlympiadOrbisArena.xml




Online Mobius

  • Distinguished King
  • *****
    • Posts: 16056
.toURI().relativize might do something wrong.
Try something like this.
Code: [Select]
Index: java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java
===================================================================
--- java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java (revision 6710)
+++ java/org/l2jmobius/gameserver/instancemanager/InstanceManager.java (working copy)
@@ -228,7 +228,7 @@
  case "instance":
  {
  final NamedNodeMap attrs = n.getAttributes();
- _instanceTemplates.put(parseInteger(attrs, "id"), new File("data/instances/").toURI().relativize(f.toURI()).getPath());
+ _instanceTemplates.put(parseInteger(attrs, "id"), f.getPath().substring(f.getPath().lastIndexOf("\\instances\\") + 11));
  break;
  }
  }
Index: java/org/l2jmobius/gameserver/model/instancezone/Instance.java
===================================================================
--- java/org/l2jmobius/gameserver/model/instancezone/Instance.java (revision 6985)
+++ java/org/l2jmobius/gameserver/model/instancezone/Instance.java (working copy)
@@ -459,7 +459,7 @@
  {
  // TODO: Cache templates.
  Document doc = null;
- final File xml = new File(Config.DATAPACK_ROOT, "data/instances/" + InstanceManager.getInstance().getInstanceTemplateFileName(templateId));
+ final File xml = new File(".\\data\\instances\\" + InstanceManager.getInstance().getInstanceTemplateFileName(templateId));
  try
  {
  final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();


Offline pandim

  • Heir
  • **
    • Posts: 14
Everything started correctly! Thanks!

If possible, then I will ask one more question:
The gameserver logs are saved to the java0.log file, but only the latest entries are saved.
Can this be fixed so that the logs are saved completely?


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16056