Jump to content
Sign in to follow this  
Forss

ошибка БД

Recommended Posts

Подскажите как понимаю ошибка с импортом имени в базу 

Error on: /home/game/data/scripts/custom/auction/__init__.py.error.log
Line: -1 - Column: -1

Traceback (innermost last):
  File "__init__.py", line 4, in ?
ImportError: cannot import name DatabaseFactory

как понимаю импорты происходят вот тут

try:
     con=DatabaseFactory.getInstance().getConnection()
     if type2 >= 0:  
       st=con.prepareStatement("SELECT id, itemId, enchant, augment, augLvl, price, money, ownerId, shadow FROM `z_stock_items` WHERE `type` = ? ORDER BY `id` DESC LIMIT ?, ?")
       st.setInt(1, type2)
       st.setInt(2, limit1)
       st.setInt(3, limit2)
     elif itemId > 0:
       st=con.prepareStatement("SELECT id, itemId, enchant, augment, augLvl, price, money, ownerId, shadow FROM `z_stock_items` WHERE `itemId` = ? ORDER BY `id` DESC LIMIT ?, ?")
       st.setInt(1, itemId)
       st.setInt(2, limit1)
       st.setInt(3, limit2)
     elif augment > 0:
       st=con.prepareStatement("SELECT id, itemId, enchant, augment, augLvl, price, money, ownerId, shadow FROM `z_stock_items` WHERE `augment` = ? ORDER BY `id` DESC LIMIT ?, ?")
       st.setInt(1, augment)
       st.setInt(2, limit1)
       st.setInt(3, limit2)
     elif me == 1:
       st=con.prepareStatement("SELECT id, itemId, enchant, augment, augLvl, price, money, ownerId, shadow FROM `z_stock_items` WHERE `ownerId` = ? ORDER BY `id` DESC LIMIT ?, ?")
       st.setInt(1, player.getObjectId())
       st.setInt(2, limit1)
       st.setInt(3, limit2)
     else:
       st=con.prepareStatement("SELECT id, itemId, enchant, augment, augLvl, price, money, ownerId, shadow FROM `z_stock_items` ORDER BY `id` DESC LIMIT ?, ?")
       st.setInt(1, limit1)
       st.setInt(2, limit2)
     rs=st.executeQuery()
     while (rs.next()):
       sId = rs.getInt("id")
       itmId = rs.getInt("itemId")
       ownerId = rs.getInt("ownerId")
       brokeItem = ItemTable.getInstance().getTemplate(itmId)
       if brokeItem == None:
         continue

должны браться из z_stock_items.sql взял данный файл с другой сборки вставил но как понимаю он не подходит. Люди добрые помогите создать правильный z_stock_items.sql или вообще ошибка в другом? Спасибо.

Share this post


Link to post
Share on other sites

а сборку нам начинать уже ванговать ? или как ? 

Название напиши сборки.

Share this post


Link to post
Share on other sites

а сборку нам начинать уже ванговать ? или как ? 

Название напиши сборки.

l2jlovely

Share this post


Link to post
Share on other sites

И так эту ошибку убрал методом что поменял импорт с from ru.catssoftware.sql import DatabaseFactory на import ru.catssoftware.L2DatabaseFactory;

Теперь когда подходишь к нпц и жмешь просмотр товара то выскакивает script error и вот какая ошибка в логих ГС

 [05.07.17 11:44:57] /home/game/data/scripts/custom/auction/__init__.py
Traceback (innermost last):
  File "__init__.py", line 273, in onAdvEvent
  File "__init__.py", line 225, in showSellItems
UnboundLocalError: local: 'rs'

	at org.python.core.Py.UnboundLocalError(Unknown Source)
	at org.python.core.PyFrame.getlocal(Unknown Source)
	at org.python.core.PyFrame.getlocal(Unknown Source)
	at org.python.pycode.serializable._pyx1499240598761.showSellItems$15(__init__.py:225)
	at org.python.pycode.serializable._pyx1499240598761.call_function(__init__.py)
	at org.python.core.PyTableCode.call(Unknown Source)
	at org.python.core.PyTableCode.call(Unknown Source)
	at org.python.core.PyTableCode.call(Unknown Source)
	at org.python.core.PyFunction.__call__(Unknown Source)
	at org.python.core.PyMethod.__call__(Unknown Source)
	at org.python.core.PyObject.__call__(Unknown Source)
	at org.python.core.PyObject.invoke(Unknown Source)
	at org.python.pycode.serializable._pyx1499240598761.onAdvEvent$18(__init__.py:273)
	at org.python.pycode.serializable._pyx1499240598761.call_function(__init__.py)
	at org.python.core.PyTableCode.call(Unknown Source)
	at org.python.core.PyTableCode.call(Unknown Source)
	at org.python.core.PyTableCode.call(Unknown Source)
	at org.python.core.PyFunction.__call__(Unknown Source)
	at org.python.core.PyMethod.__call__(Unknown Source)
	at org.python.core.PyObject.__call__(Unknown Source)
	at org.python.core.PyObject._jcallexc(Unknown Source)
	at org.python.core.PyObject._jcall(Unknown Source)
	at org.python.proxies.main$Quest$328.onAdvEvent(Unknown Source)
	at ru.catssoftware.gameserver.model.quest.Quest.notifyEvent(Unknown Source)
	at ru.catssoftware.gameserver.model.actor.instance.L2PcInstance.processQuestEvent(Unknown Source)
	at ru.catssoftware.gameserver.network.clientpackets.RequestBypassToServer.runImpl(Unknown Source)
	at ru.catssoftware.gameserver.network.clientpackets.L2GameClientPacket.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:722)

Подскажите с чем это связанно.

Share this post


Link to post
Share on other sites

Тогда. Ясно у меня есть и работает, но отключил в целях безопасности и падения сервера

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...