01-28-2015, 04:37 PM
И так,суть вопроса в том,что на 7 яву бафхолдер налазить не хотел
В итоге пришлось пошаманить на 7 яву,и вышло вот так
Но при загрузке я вижу только это теперь:
исходный код
[SRC="java"]
@Override
protected void parseDocument(Document doc)
{
for(Node list : getNodes(doc, "list"))
for(Node nScheme : getNodes(list, "buffscheme"))
{
String schemeName = get(nScheme, "name");
for(Node nBuff : getNodes(nScheme, "buff"))
{
int skillId = get(nBuff, "skillId", -1);
int level = get(nBuff, "level", -1);
if (SkillTable.getInstance().getInfo(skillId, level) == null)
{
_log.error("BufferHolder: Not found skill with ID " + skillId + " and level " + level);
continue;
}
Buff buff = new Buff(skillId, level, schemeName);
for(Node nSet : getNodes(nBuff, "set"))
{
String name = get(nSet, "name");
String val = get(nSet, "val");
if ("price".equalsIgnoreCase(name))
{
int itemId = Integer.parseInt(val.split(" ")[0]);
int count = Integer.parseInt(val.split(" ")[1]);
buff.addPrice(itemId, count);
}
else if ("isPremium".equalsIgnoreCase(name))
{
buff.setPremium(Boolean.parseBoolean(val));
}
else if ("isNoble".equalsIgnoreCase(name))
{
buff.setNoble(Boolean.parseBoolean(val));
}
else if ("isHero".equalsIgnoreCase(name))
{
buff.setHero(Boolean.parseBoolean(val));
}
else if ("isOnlyCheckPrice".equalsIgnoreCase(name))
{
buff.setOnlyCheckPrice(Boolean.parseBoolean(val));
}
else if ("addActiveProfile".equalsIgnoreCase(name))
{
buff.setAddActiveProfile(Boolean.parseBoolean(val));
}
}
addBuff(schemeName, buff);
}
}
}
[/SRC]
@Override
protected void parseDocument(Document doc)
{
for(Node list : getNodes(doc, "list"))
for(Node nScheme : getNodes(list, "buffscheme"))
{
String schemeName = get(nScheme, "name");
for(Node nBuff : getNodes(nScheme, "buff"))
{
int skillId = get(nBuff, "skillId", -1);
int level = get(nBuff, "level", -1);
if (SkillTable.getInstance().getInfo(skillId, level) == null)
{
_log.error("BufferHolder: Not found skill with ID " + skillId + " and level " + level);
continue;
}
Buff buff = new Buff(skillId, level, schemeName);
for(Node nSet : getNodes(nBuff, "set"))
{
String name = get(nSet, "name");
String val = get(nSet, "val");
if ("price".equalsIgnoreCase(name))
{
int itemId = Integer.parseInt(val.split(" ")[0]);
int count = Integer.parseInt(val.split(" ")[1]);
buff.addPrice(itemId, count);
}
else if ("isPremium".equalsIgnoreCase(name))
{
buff.setPremium(Boolean.parseBoolean(val));
}
else if ("isNoble".equalsIgnoreCase(name))
{
buff.setNoble(Boolean.parseBoolean(val));
}
else if ("isHero".equalsIgnoreCase(name))
{
buff.setHero(Boolean.parseBoolean(val));
}
else if ("isOnlyCheckPrice".equalsIgnoreCase(name))
{
buff.setOnlyCheckPrice(Boolean.parseBoolean(val));
}
else if ("addActiveProfile".equalsIgnoreCase(name))
{
buff.setAddActiveProfile(Boolean.parseBoolean(val));
}
}
addBuff(schemeName, buff);
}
}
}
[/SRC]
В итоге пришлось пошаманить на 7 яву,и вышло вот так
исходный код
[SRC="java"]
@Override
protected void parseDocument(Document doc)
{
try
{
Node n = doc.getFirstChild();
for(Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
{
if(d.getNodeName().equalsIgnoreCase("buffscheme"))
{
NamedNodeMap atr = d.getAttributes();
String schemeName = atr.getNamedItem("name").getNodeValue();
if(d.getNodeName().equalsIgnoreCase("buff"))
{
int skillId = Integer.parseInt(atr.getNamedItem("skillId").getNodeValue());
int level = Integer.parseInt(atr.getNamedItem("level").getNodeValue());
if(SkillTable.getInstance().getInfo(skillId,level) == null)
{
_log.error("BufferHolder: Not found skill with ID " + skillId + " and level " + level);
continue;
}
Buff buff = new Buff(skillId, level, schemeName);
if(d.getNodeName().equalsIgnoreCase("set"))
{
String name = atr.getNamedItem("name").getNodeValue();
String val = atr.getNamedItem("val").getNodeValue();
if ("price".equalsIgnoreCase(name))
{
int itemId = Integer.parseInt(val.split(" ") [0]);
int count = Integer.parseInt(val.split(" ") [1]);
buff.addPrice(itemId,count);
}
else if ("isOnlyCheckPrice".equalsIgnoreCase(name))
{
buff.setOnlyCheckPrice(Boolean.parseBoolean(val));
}
else if ("addActiveProfile".equalsIgnoreCase(name))
{
buff.setAddActiveProfile(Boolean.parseBoolean(val));
}
}
addBuff(schemeName, buff);
}
}
}
}
catch (Exception e)
{
_log.warn("BufferHolder: Error loading from database:" + e.getMessage(), e);
}
}
[/SRC]
@Override
protected void parseDocument(Document doc)
{
try
{
Node n = doc.getFirstChild();
for(Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
{
if(d.getNodeName().equalsIgnoreCase("buffscheme"))
{
NamedNodeMap atr = d.getAttributes();
String schemeName = atr.getNamedItem("name").getNodeValue();
if(d.getNodeName().equalsIgnoreCase("buff"))
{
int skillId = Integer.parseInt(atr.getNamedItem("skillId").getNodeValue());
int level = Integer.parseInt(atr.getNamedItem("level").getNodeValue());
if(SkillTable.getInstance().getInfo(skillId,level) == null)
{
_log.error("BufferHolder: Not found skill with ID " + skillId + " and level " + level);
continue;
}
Buff buff = new Buff(skillId, level, schemeName);
if(d.getNodeName().equalsIgnoreCase("set"))
{
String name = atr.getNamedItem("name").getNodeValue();
String val = atr.getNamedItem("val").getNodeValue();
if ("price".equalsIgnoreCase(name))
{
int itemId = Integer.parseInt(val.split(" ") [0]);
int count = Integer.parseInt(val.split(" ") [1]);
buff.addPrice(itemId,count);
}
else if ("isOnlyCheckPrice".equalsIgnoreCase(name))
{
buff.setOnlyCheckPrice(Boolean.parseBoolean(val));
}
else if ("addActiveProfile".equalsIgnoreCase(name))
{
buff.setAddActiveProfile(Boolean.parseBoolean(val));
}
}
addBuff(schemeName, buff);
}
}
}
}
catch (Exception e)
{
_log.warn("BufferHolder: Error loading from database:" + e.getMessage(), e);
}
}
[/SRC]
Но при загрузке я вижу только это теперь:
PHP код:
<?php
=======================================================-[ BUFF HOLDER LUCERA2 ]
[INFO 17:21:44]: BuffHolder: Loaded 0 buffScheme(s)
Куда копать? Может есть у кого готовый вариант,буду благодарен!
пс: натягиваю на люсю1