Пожалуйста, помогите! Unclosed connection! Trace: - Форум администраторов игровых серверов
Форум администраторов игровых серверов StormWall - Защита от DDos атак
Регистрация Мнения Справка Пользователи Календарь Все разделы прочитаны
Вернуться   Форум администраторов игровых серверов > MMO > Lineage II

Lineage II
Дискуссии на тему создания, настройки и обслуживания серверов Lineage 2. При поддержке: Премиум услуги по рекламе

Описание темы:Unclosed connection! Trace:

Ответ
Опции темы
Непрочитано 01.09.2010, 08:03   #1
Новичок

Автор темы (Топик Стартер) Пожалуйста, помогите! Unclosed connection! Trace:

Unclosed connection! Trace: sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e
Method)
java.lang.RuntimeException
at com.l2jserver.L2DatabaseFactory.getConnection(L2Da tabaseFactory.java:
223)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.python.core.PyReflectedFunction.__call__(Unkno wn Source)
at org.python.core.PyMethod.__call__(Unknown Source)
at org.python.core.PyObject.__call__(Unknown Source)
at org.python.core.PyInstance.invoke(Unknown Source)
at org.python.pycode.serializable._pyx1283409818906.g etSelfVotes$4(__ini
t__.py:49)
at org.python.pycode.serializable._pyx1283409818906.c all_function(__init
__.py)
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.pycode.serializable._pyx1283409818906.o nAdvEvent$9(__init_
_.py:140)
at org.python.pycode.serializable._pyx1283409818906.c all_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$425.onAdvEvent(Unkno wn Source)
at com.l2jserver.gameserver.model.quest.Quest.notifyE vent(Quest.java:405
)
at com.l2jserver.gameserver.model.actor.instance.L2Pc Instance.processQue
stEvent(L2PcInstance.java:1790)
at com.l2jserver.gameserver.network.clientpackets.Req uestBypassToServer.
runImpl(RequestBypassToServer.java:221)
at com.l2jserver.gameserver.network.clientpackets.L2G ameClientPacket.run
(L2GameClientPacket.java:93)
at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(Unknown Source
)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
at java.lang.Thread.run(Unknown Source)


Вот такая ошибка, хотя НПС работает, дает item. Уже все мозги сломал, не могу избавиться от ошибки. Платформа java сервер l2jserver


import sys

from com.l2jserver.gameserver.model.actor.instance import L2PcInstance
from com.l2jserver.gameserver.model.quest import State
from com.l2jserver.gameserver.model.quest import QuestState
from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest
from com.l2jserver import L2DatabaseFactory
from com.l2jserver.util import Rnd
from java.util import Calendar
from com.l2jserver import Config
from com.l2jserver.gameserver.network.clientpackets import Say2
from com.l2jserver.gameserver.network.serverpackets import CreatureSay
from com.l2jserver.gameserver.model import L2World


#========================================
QuestId = 1005
QuestName = "Voting"
QuestDesc = "custom"
qn = "q"+str(QuestId)+"_"+str(QuestName)
#========================================
NPC = 50005
reward1 = [ # [item_id,count],
[6392,3],
]
#======================================#
# *** DO NOT TOUCH LINES BELOW *** #
#======================================#
def shoutMsg(text) :
chars = L2World.getInstance().getAllPlayers().toArray()
if chars != None :
for pc in chars :
sm = CreatureSay(0, 1, "EVENT", text)
pc.sendPacket(sm)

def announceMsg(text) :
chars = L2World.getInstance().getAllPlayers().toArray()
if chars != None :
for pc in chars :
sm = CreatureSay(0, 10, "Event", "EVENT: "+text)
pc.sendPacket(sm)

def privateMsg(player,text) :
sm = CreatureSay(player.getObjectId(), 2, player.getName(), text)
player.sendPacket(sm)

#========================================
def getSelfVotes(nick) :
con = L2DatabaseFactory.getInstance().getConnection()
stmt = con.prepareStatement("SELECT id,date_format(date, '%d.%m.%Y %H:%i') as date, nick, ip, date_format(reward, '%d.%m.%Y %H:%i') as 'reward' from z_voting where nick = ? order by id desc Limit 0,50")
stmt.setString(1,nick)
rs = stmt.executeQuery()
i = 1
list = []
while ( rs.next() ) :
l = []
l.append(rs.getInt("id"))
l.append(rs.getString("date"))
l.append(rs.getString("nick"))
l.append(rs.getString("ip"))
l.append(rs.getString("reward"))
list.insert(i,l)
i += 1
return list

def getAllVotes() :
con = L2DatabaseFactory.getInstance().getConnection()
stmt = con.prepareStatement("SELECT id,date_format(date, '%d.%m.%Y %H:%i') as date, nick, ip, date_format(reward, '%d.%m.%Y %H:%i') as 'reward' from z_voting order by id desc Limit 0,50")
rs = stmt.executeQuery()
i = 1
list = []
while ( rs.next() ) :
l = []
l.append(rs.getInt("id"))
l.append(rs.getString("date"))
l.append(rs.getString("nick"))
l.append(rs.getString("ip"))
l.append(rs.getString("reward"))
list.insert(i,l)
i += 1
return list

def giveReward1(player,recId) :
st = player.getQuestState(qn)
cal = Calendar.getInstance()
now = int(cal.getTimeInMillis()/1000)
con = L2DatabaseFactory.getInstance().getConnection()
stmt = con.prepareStatement("UPDATE z_voting SET reward = FROM_UNIXTIME(?) WHERE id = ?")
stmt.setInt(1,now)
stmt.setInt(2,int(recId))
r = stmt.executeUpdate()
if not r :
return False
for item in reward1 :
st.giveItems(item[0],item[1])
return True
#========================================
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)

def onAdvEvent(Self,event,npc,player):
htmltext = event
st = player.getQuestState(qn)
if not st : return
if event == "error_report" :
msg = error_report(qn,player)
return msg

cal = Calendar.getInstance()
now = cal.getTimeInMillis()
text = "noaction.htm"
st = player.getQuestState(qn)
if not st : return text

if event == "info" :
return "info.htm"
elif event == "start" :
return "start.htm"
elif event.startswith("stat_") :
e2 = event.split("_")[1]
if e2 == "all" :
# All votes
list = getAllVotes()
t = "<center>"
t += "<br1><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>"
t += "<font color=\"ff0000\">Last 50 votes:</font><br1>"
t += "<table width=\"60%\">"
t += "<tr><td><font color=\"LEVEL\">Date votes</font></td><td><font color=\"LEVEL\">Char</font></td></tr>"
for v in list :
t += "<tr>"
t += "<td>"+str(v[1])+"</td>"
t += "<td>"+str(v[2])+"</td>"
t += "</tr>"
t += "</table><br><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32></center>"
t = "<html>"+t+"</html>"
return t

elif e2 == "self" :
# Self votes
list = getSelfVotes(player.getName())
t = "<center>"
t += "<br1><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>"
t += "<font color=\"ff0000\">Your vote (last 50):</font><br1>"
t += "<table width=\"100%\">"
t += "<tr><td><font color=\"LEVEL\">Date votes</font></td><td><font color=\"LEVEL\">IP address</font></td><td><font color=\"LEVEL\">Date award</font></td></tr>"

for v in list :
t += "<tr>"
t += "<td>"+str(v[1])+"</td>"
t += "<td>"+str(v[3])+"</td>"
if v[4] == None :
t += "<td><a action=\"bypass -h Quest q1005_Voting reward_"+str(v[0])+"\">Send</a></td>"
else :
t += "<td>"+str(v[4])+"</td>"
t += "</tr>"
t += "</table><br><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32></center>"
t = "<html>"+t+"</html>"
return t
elif event.startswith("reward_") :
recId = int(event.split("_")[1])
if giveReward1(player,recId) :
return "done.htm"
else :
return "error.htm"
else :
return text

return text

def onTalk (Self,npc,player):
text = "noaction.htm"
st = player.getQuestState(qn)
if not st : return text
st.setState(State.STARTED)
return "start.htm"


def onFirstTalk (Self,npc,player):
st = getQuestState(qn)
if not st : return "Invalid quest state"

QUEST = Quest(-1,qn,"custom")
QUEST.addStartNpc(NPC)
QUEST.addTalkId(NPC)
QUEST.addAcquireSkillId(NPC)


Добавлено через 1 час 23 минуты
Cпосибо за участие, ошибку сам нашол, выкладываю решение.

import sys

from com.l2jserver.gameserver.model.actor.instance import L2PcInstance
from com.l2jserver.gameserver.model.quest import State
from com.l2jserver.gameserver.model.quest import QuestState
from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest
from com.l2jserver import L2DatabaseFactory
from com.l2jserver.util import Rnd
from java.util import Calendar
from com.l2jserver import Config
from com.l2jserver.gameserver.network.clientpackets import Say2
from com.l2jserver.gameserver.network.serverpackets import CreatureSay
from com.l2jserver.gameserver.model import L2World


#========================================
QuestId = 1005
QuestName = "Voting"
QuestDesc = "custom"
qn = "q"+str(QuestId)+"_"+str(QuestName)
#========================================
NPC = 50005
reward1 = [ # [item_id,count],
[6392,3],
]
#======================================#
# *** DO NOT TOUCH LINES BELOW *** #
#======================================#
def shoutMsg(text) :
chars = L2World.getInstance().getAllPlayers().toArray()
if chars != None :
for pc in chars :
sm = CreatureSay(0, 1, "EVENT", text)
pc.sendPacket(sm)

def announceMsg(text) :
chars = L2World.getInstance().getAllPlayers().toArray()
if chars != None :
for pc in chars :
sm = CreatureSay(0, 10, "Event", "EVENT: "+text)
pc.sendPacket(sm)

def privateMsg(player,text) :
sm = CreatureSay(player.getObjectId(), 2, player.getName(), text)
player.sendPacket(sm)

#========================================
def getSelfVotes(nick) :
con = L2DatabaseFactory.getInstance().getConnection()
stmt = con.prepareStatement("SELECT id,date_format(date, '%d.%m.%Y %H:%i') as date, nick, ip, date_format(reward, '%d.%m.%Y %H:%i') as 'reward' from z_voting where nick = ? order by id desc Limit 0,50")
stmt.setString(1,nick)
rs = stmt.executeQuery()
i = 1
list = []
while ( rs.next() ) :
l = []
l.append(rs.getInt("id"))
l.append(rs.getString("date"))
l.append(rs.getString("nick"))
l.append(rs.getString("ip"))
l.append(rs.getString("reward"))
list.insert(i,l)
i += 1
con.close()
return list

def getAllVotes() :
con = L2DatabaseFactory.getInstance().getConnection()
stmt = con.prepareStatement("SELECT id,date_format(date, '%d.%m.%Y %H:%i') as date, nick, ip, date_format(reward, '%d.%m.%Y %H:%i') as 'reward' from z_voting order by id desc Limit 0,50")
rs = stmt.executeQuery()
i = 1
list = []
while ( rs.next() ) :
l = []
l.append(rs.getInt("id"))
l.append(rs.getString("date"))
l.append(rs.getString("nick"))
l.append(rs.getString("ip"))
l.append(rs.getString("reward"))
list.insert(i,l)
i += 1
con.close()
return list

def giveReward1(player,recId) :
st = player.getQuestState(qn)
cal = Calendar.getInstance()
now = int(cal.getTimeInMillis()/1000)
con = L2DatabaseFactory.getInstance().getConnection()
stmt = con.prepareStatement("UPDATE z_voting SET reward = FROM_UNIXTIME(?) WHERE id = ?")
stmt.setInt(1,now)
stmt.setInt(2,int(recId))
r = stmt.executeUpdate()
con.close()

if not r :
return False
for item in reward1 :
st.giveItems(item[0],item[1])
return True
#========================================
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)

def onAdvEvent(Self,event,npc,player):
htmltext = event
st = player.getQuestState(qn)
if not st : return
if event == "error_report" :
msg = error_report(qn,player)
return msg

cal = Calendar.getInstance()
now = cal.getTimeInMillis()
text = "noaction.htm"
st = player.getQuestState(qn)
if not st : return text

if event == "info" :
return "info.htm"
elif event == "start" :
return "start.htm"
elif event.startswith("stat_") :
e2 = event.split("_")[1]
if e2 == "all" :
# All votes
list = getAllVotes()
t = "<center>"
t += "<br1><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>"
t += "<font color=\"ff0000\">Last 50 votes:</font><br1>"
t += "<table width=\"60%\">"
t += "<tr><td><font color=\"LEVEL\">Date votes</font></td><td><font color=\"LEVEL\">Char</font></td></tr>"
for v in list :
t += "<tr>"
t += "<td>"+str(v[1])+"</td>"
t += "<td>"+str(v[2])+"</td>"
t += "</tr>"
t += "</table><br><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32></center>"
t = "<html>"+t+"</html>"
return t

elif e2 == "self" :
# Self votes
list = getSelfVotes(player.getName())
t = "<center>"
t += "<br1><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>"
t += "<font color=\"ff0000\">Your vote (last 50):</font><br1>"
t += "<table width=\"100%\">"
t += "<tr><td><font color=\"LEVEL\">Date votes</font></td><td><font color=\"LEVEL\">IP address</font></td><td><font color=\"LEVEL\">Date award</font></td></tr>"

for v in list :
t += "<tr>"
t += "<td>"+str(v[1])+"</td>"
t += "<td>"+str(v[3])+"</td>"
if v[4] == None :
t += "<td><a action=\"bypass -h Quest q1005_Voting reward_"+str(v[0])+"\">Send</a></td>"
else :
t += "<td>"+str(v[4])+"</td>"
t += "</tr>"
t += "</table><br><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32></center>"
t = "<html>"+t+"</html>"
return t
elif event.startswith("reward_") :
recId = int(event.split("_")[1])
if giveReward1(player,recId) :
return "done.htm"
else :
return "error.htm"
else :
return text

return text

def onTalk (Self,npc,player):
text = "noaction.htm"
st = player.getQuestState(qn)
if not st : return text
st.setState(State.STARTED)
return "start.htm"


def onFirstTalk (Self,npc,player):
st = getQuestState(qn)
if not st : return "Invalid quest state"

QUEST = Quest(-1,qn,"custom")
QUEST.addStartNpc(NPC)
QUEST.addTalkId(NPC)
QUEST.addAcquireSkillId(NPC)



Последний раз редактировалось Gromila; 01.09.2010 в 09:29. Причина: Добавлено сообщение
Gromila вне форума Ответить с цитированием
Непрочитано 01.09.2010, 19:23   #2
Аватар для krisadr
Пользователь

По умолчанию Re: Пожалуйста, помогите! Unclosed connection! Trace:

сам спросил, сам ответил)))
krisadr вне форума Ответить с цитированием
Непрочитано 01.09.2010, 22:53   #3
Новичок

Автор темы (Топик Стартер) Re: Пожалуйста, помогите! Unclosed connection! Trace:

Не поверишь, 3 часа пыхтел, не мог понять, в чем дело )). Этот НПС стоял у меня на Interlude я его переделал для Gracia epilogue. Сейчас все работает отлично.
Gromila вне форума Ответить с цитированием
Непрочитано 01.09.2010, 23:24   #4
Аватар для DreamCast
Пользователь

По умолчанию Re: Пожалуйста, помогите! Unclosed connection! Trace:

проблема стара как мир, коннект надо закрывать)
DreamCast вне форума Ответить с цитированием
Ответ


Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
 
Опции темы

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.

Быстрый переход

Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
ПОМОГИТЕ ПОЖАЛУЙСТА С TvT Manioo Lineage II 1 01.04.2010 05:33
Помогите пожалуйста) ovruch Работа со скриптами 1 28.03.2010 19:16
Помогите пожалуйста!!! BruarioR Lineage II 4 30.12.2009 20:10
Помогите пожалуйста! BlackKain Lineage II 1 09.11.2009 00:05
Помогите пожалуйста! RedSmaile Корзина / Trash 1 30.07.2009 09:11


© 2007–2022 «Форум администраторов игровых серверов»
Защита сайта от DDoS атак — StormWall
Работает на Булке неизвестной версии с переводом от zCarot
Текущее время: 17:37. Часовой пояс GMT +3.

Вверх