-
Posts
227 -
Joined
-
Last visited
-
Days Won
5 -
Feedback
0%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Everything posted by Endymion
-
Hi. I've got a problem and a question at the same time. With m2server switched off, the number of opened files on machine is about 600 (freebsd 9.2, 64bit). After starting 2 m2servers the same number in a blink of eye increases to 3000 and then gets bigger and bigger. At the moment, after 10 hours after m2servers launch, I've got 12000 opened files. I've searched all quests for opening file without closing it after use. The problem is that listing of these files returns neither their names nor paths. Instead of filename is (none). Below you've got a sample of listing opened files. Do you have any idea for closing these files or diagnose and fix for this problem? Sample: game 79870 root 87u unix 0xfffffe0e7cb5c2a8 0t0 ->(none) game 79870 root 88u unix 0xfffffe0e7304ed48 0t0 ->(none) game 79870 root 89u unix 0xfffffe0e73c76d48 0t0 ->(none) game 79870 root 90u unix 0xfffffe0e73db8000 0t0 ->(none) game 79870 root 91u unix 0xfffffe0e6d9d1aa0 0t0 ->(none) game 79870 root 92u unix 0xfffffe0e6ddad7f8 0t0 ->(none) game 79870 root 93u unix 0xfffffe0e73db1000 0t0 ->(none) game 79870 root 94u unix 0xfffffe0e6dbf5550 0t0 ->(none)
-
Spirt Stone Success Chance?
Endymion replied to Invictus's topic in Community Support - Questions & Answers
char_item.cpp if (number(1, 100) <= 30) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¸ŢĆľĽ® şÎÂřżˇ Ľş°řÇĎż´˝Ŕ´Ď´Ů.")); item2->SetSocket(i, item->GetVnum()); } else { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¸ŢĆľĽ® şÎÂřżˇ ˝ÇĆĐÇĎż´˝Ŕ´Ď´Ů.")); item2->SetSocket(i, ITEM_BROKEN_METIN_VNUM); } -
I'll leave your post better uncommented, otherwise you won't be happy about what I'd reply. If you want I can rewrite the code so you won't have to go through lua. If you have some free time you can rewrite. This version works ok, but why not.
-
Yes, thanks. First i use a|b|c|d|e|f and I want split it but I refused this idea.
-
Syslog pls.
-
Replace pc.give_item into pc.give_item2 and try again.
-
Shogun answered you for me. For safety You should always restart game after qc quests.
-
Try now:
-
Did you modify char_item.cpp?
-
/usr/bin/ld: cannot find -lmysqlclient Now You should use your brain.
-
Yes.
-
Only for npc.get_vid(). I didn't know how to do it by python alone, so I used LUA and it works as charm.
-
In Ascarial.pl (my pserver with ~1000 players online) it works well.
-
Hi. And now tutorial how add it into client: You must add following code to costinfo.py INPUT_IGNORE = 0 VID = 0 STHX = 0 HPXD = 0 PLAYER_HP = 0 PLAYER_MAX_HP = 0 PLAYER_SP = 0 PLAYER_MAX_SP = 0 PLAYER_NAME = "" Next, open game.py, and add these things: import uiHealth #wskaznikiHP "super_quest" : self.Tabulejtor, "pvp_zdruwko" : self.Mozart, #inputpowerdziwko "get_input_value" : self.GetInputValue, "get_input_start" : self.GetInputOn, "get_input_end" : self.GetInputOff, def Mozart(self, data): dane = data.split("|") constInfo.PLAYER_NAME = str(dane[0]) constInfo.PLAYER_HP = int(dane[1]) constInfo.PLAYER_MAX_HP = int(dane[2]) constInfo.PLAYER_SP = int(dane[3]) constInfo.PLAYER_MAX_SP = int(dane[4]) def Tabulejtor(self, id): constInfo.STHX = int(id) def GetInputOn(self): constInfo.INPUT_IGNORE = 1 def GetInputOff(self): constInfo.INPUT_IGNORE = 0 def GetInputValue(self): net.SendQuestInputStringPacket(str(constInfo.VID)) def OpenQuestWindow(self, skin, idx): if constInfo.INPUT_IGNORE == 1: return else: self.interface.OpenQuestWindow(skin, idx) Next pieces of code you have to add to uitarget.py import uiHealth import constInfo def OnUpdate(self): if player.IsPVPInstance(self.vid): constInfo.VID = self.vid event.QuestButtonClick(constInfo.STHX) if not self.healthBoard.IsShow() and self.vid != 0: self.healthBoard.Show() else: self.healthBoard.Hide() if self.isShowButton: exchangeButton = self.buttonDict[locale.TARGET_BUTTON_EXCHANGE] distance = player.GetCharacterDistance(self.vid) if distance < 0: return if exchangeButton.IsShow(): if distance > self.EXCHANGE_LIMIT_RANGE: self.RefreshButton() else: if distance < self.EXCHANGE_LIMIT_RANGE: self.RefreshButton() In def __init__(self) (uitarget.py) must add this: self.healthBoard = uiHealth.HealthBoard() In def Close() must add this: self.healthBoard.Hide() For eg. def Close(self): self.__Initialize() self.healthBoard.Hide() self.Hide() Now you must create uihealth.py in root and paste there this code: #Krzywy import ui import constInfo def GetInfoFrom(id): table = { 1 : constInfo.PLAYER_NAME, 2 : constInfo.PLAYER_HP, 3 : constInfo.PLAYER_MAX_HP, 4 : constInfo.PLAYER_SP, 5 : constInfo.PLAYER_MAX_SP} if table.has_key(id): return table[id] class HealthBoard(ui.ThinBoard): def __init__(self): ui.ThinBoard.__init__(self) self.Config() def __del__(self): ui.ThinBoard.__del__(self) def Config(self): self.SetSize(200, 120) self.SetPosition(0, 20) self.hp_bar = ui.Gauge() self.hp_bar.SetParent(self) self.hp_bar.SetPosition(30, 30+20) self.hp_bar.MakeGauge(130, "red") self.hp_bar.Show() self.sp_bar = ui.Gauge() self.sp_bar.SetParent(self) self.sp_bar.SetPosition(30, 60+20) self.sp_bar.MakeGauge(130, "blue") self.sp_bar.Show() self.name = ui.TextLine() self.name.SetParent(self) self.name.SetDefaultFontName() self.name.SetPosition(45, 30) self.name.SetText("") self.name.Show() self.hp_show = ui.TextLine() self.hp_show.SetParent(self) self.hp_show.SetDefaultFontName() self.hp_show.SetPosition(60-15, 57) self.hp_show.SetText("") self.hp_show.Show() self.sp_show = ui.TextLine() self.sp_show.SetParent(self) self.sp_show.SetDefaultFontName() self.sp_show.SetPosition(60-15, 80+7) self.sp_show.SetText("") self.sp_show.Show() def OnUpdate(self): if (GetInfoFrom(2)+GetInfoFrom(3)+GetInfoFrom(4)+GetInfoFrom(5)) == 0: self.Hide() self.hp_bar.SetPercentage(GetInfoFrom(2), GetInfoFrom(3)) self.sp_bar.SetPercentage(GetInfoFrom(4), GetInfoFrom(5)) self.name.SetText(GetInfoFrom(1)) self.hp_show.SetText("Health Points: %s / %s" % (GetInfoFrom(2), GetInfoFrom(3))) self.sp_show.SetText("Mana Points: %s / %s" % (GetInfoFrom(4), GetInfoFrom(5))) self.name.SetText("Character: %s" % (GetInfoFrom(1))) And quest: -- Quest Opponents HP and MP during pvp -- Made by: Endymion_ -- Server: Ascarial.pl quest wskaznikHpWroga begin state start begin when login begin cmdchat("super_quest "..q.getcurrentquestindex()) end when info or button begin cmdchat("get_input_start") local vid = input(cmdchat("get_input_value")) cmdchat("get_input_end") local old_pc = pc.select(vid) local name = pc.get_name() local hp = pc.get_hp() local max_hp = pc.get_max_hp() local mp = pc.get_sp() local max_mp = pc.get_max_sp() pc.select(old_pc) cmdchat("pvp_zdruwko "..name.."|"..hp.."|"..max_hp.."|"..mp.."|"..max_mp) end end end Dif (created by blackyuko): game34083 Greetings.
-
I had written this long time ago before I had official quests and I have use this on server on gamecore 2089 which doesn't have function d.find.
-
Put it into questlib.lua and add into quest_functions that: kodBramy
-
M2 Download Center Download Here ( Internal ) Quest: List of codes Map and regens file: [Hidden Content] Thanks & greetings.
- 19 replies
-
- 28