L2JMobius
Free Users => Solved/Invalid Bug Reports => Topic started by: pandim on March 15, 2020, 05:37:30 PM
-
Good afternoon!
Error Lineage 2 - HF at the start of the olympiads:
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
...
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:
...
// 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));
...
-
After I do this, the Olympiad does not work for me. :D
-
after my editing:
[15/03 18:46:50] Olympiad System: Loaded 160 stadiums.
-
After your change.
[15/03 18:08:52] Instance: can not find C:\eclipse\workspace\L2J_Mobius_CT_2.6_HighFive\dist\game\Olympiad\OlympiadOrbisArena.xml !
-
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:
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:
[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 :)
-
Maybe is a localization issue.
No idea, I have not looked into it.
-
Do you work on which operating system?
;) I liked your builds - they really work ;)
-
I use Windows.
-
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!
-
Can you try this?
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();
-
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?
-
// 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));
...
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
-
.toURI().relativize might do something wrong.
Try something like this.
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();
-
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?
-
For other questions make other posts.