Jump to content

morion

Inactive Member
  • Posts

    74
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by morion

  1. ACMD(do_ban)
    {
    char arg1[256], arg2[256];
    const char* name;
    const char* reason;
    if (!ch || ch->GetGMLevel() != GM_IMPLEMENTOR)
    {
        sys_log(0, "do_ban without rights %s[%d]", ch->GetName(), ch->GetPlayerID());
        return;
    }
    two_arguments(argument, arg1, sizeof (arg1), arg2, sizeof(arg2));
    if (!*arg1 || !*arg2)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, "Correct command form: /ban <player name> <reason>");
        return;
    }
    name = arg1;
    reason = arg2;
    LPDESC LDESC = DESC_MANAGER::instance().FindByCharacterName(name);
    LPCHARACTER LCHARACTER = LDESC ? LDESC->GetCharacter() : NULL;
    if (!LCHARACTER)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, "%s not found.", name);
        return;
    }
    if (LCHARACTER == ch)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, "You cant ban yourself!");
        return;
    }
    if (LCHARACTER->GetGMLevel() >= GM_LOW_WIZARD)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, "You cant do that.");
        return;
    }
    LCHARACTER = CHARACTER_MANAGER::instance().FindPC(name);
    
      
    DBManager::instance().DirectQuery("UPDATE account.account SET status = 'BLOCK' WHERE id = %d", LCHARACTER->GetAID());
    DBManager::instance().DirectQuery("UPDATE player.player SET reason = %s WHERE id = %d", reason, LCHARACTER->GetAID());  
    
    LDESC->DelayedDisconnect(5);
    sys_log(0, "%s[%d] banned %s with reason: %s", ch->GetName(), ch->GetPlayerID(), name, reason);
    ch->ChatPacket(CHAT_TYPE_INFO, "%s was banned with reason: %s", name, reason);
    }

     

  2. Hi

    i have this error when i try to drop a item

    0220 12:54:51383 ::   File "game.py", line 1396, in OnMouseLeftButtonUp

    0220 12:54:51383 ::   File "game.py", line 1433, in __PutItem

    0220 12:54:51383 ::   File "game.py", line 1508, in __DropItem

    0220 12:54:51383 :: AttributeError
    0220 12:54:51383 :: :
    0220 12:54:51383 :: 'module' object has no attribute 'QuestionDialogItem'
    0220 12:54:51383 ::

     

    • Love 1
  3. Hi devs

    I have a strange problem with the cube, if i put this

     

    CrystalCavern
    section        
    npc    20022
    item    23078    1
    item    23079    1
    item    23080    1
    reward    23081    1
    percent    100    
    end

    it works but if try this

    CrystalCavern
    section        
    npc    20126
    item    23078    1
    item    23079    1
    item    23080    1
    reward    23081    1
    percent    100    
    end

    with the same quest, it don't works....

    syserr on client

    CPythonNetworkStream::ServerCommand(c_szCommand=cube r_list 20126 0 ) - Strange Parameter Count : 5

    any help?

  4. 1014 19:00:19251 ::   File "networkModule.py", line 241, in SetGamePhase
    
    1014 19:00:19251 ::   File "game.py", line 120, in __init__
    
    1014 19:00:19251 ::   File "interfaceModule.py", line 338, in MakeInterface
    
    1014 19:00:19251 ::   File "interfaceModule.py", line 271, in __MakeDialogs
    
    1014 19:00:19251 ::   File "uiSystem.py", line 26, in __init__
    
    1014 19:00:19251 ::   File "uiSystem.py", line 30, in __Initialize
    
    1014 19:00:19251 :: NameError
    1014 19:00:19251 :: : 
    1014 19:00:19251 :: global name 'stream' is not defined
    1014 19:00:19251 :: 
    
    

     

  5. 1010 08:38:21522 ::   File "uiMiniMap.py", line 138, in OnUpdate
    
    1010 08:38:21523 :: NameError
    1010 08:38:21523 :: : 
    1010 08:38:21523 :: global name 'bgk' is not defined
    1010 08:38:21523 :: 
    	def OnUpdate(self):
    	
    		import time,app
    		global bgk		
    		nRenderFPS=app.GetRenderFPS()
    		fps="FPS:%3d"%(nRenderFPS)
    		gc=time.strftime("%d")
    		aycek=time.strftime("%B")
    		yilx=time.strftime("%Y")
    		gun=time.strftime("%A")
    		b=" "
    		ti=" - "
    		yazifps="FPS:"
    		st=time.strftime("%H:%M:%S")
    		text="Jakosc: "		
    		if bgk<=30 and bgk>0:kl="Doskonala!"
    		elif bgk<=50 and bgk>35:kl="Dobra"
    		elif bgk<= 100 and bgk>50:kl="Srednia"
    		elif bgk>= 100:kl="Zla"
    		bagla=b+gc+b+aycek+b+yilx+b+gun+b+st+ti+text+kl+ti+fps
    		self.reonasobject.SetText(bagla)
    		self.reonasobject.Show()

     

    same problem

  6. char.cpp function void CHARACTER::PointChange 

    case POINT_LEVEL:
        [..]
        if (iLevStep >= 4)
    	{
    		sys_err("%s LEVEL_STEP bigger than 4! (%d)", GetName(), iLevStep);
    		iLevStep = 4;
    	}
    
    	if (exp >= next_exp && iLevStep < 4)
    	{
    		for (int i = 0; i < 4 - iLevStep; ++i)
    			PointChange(POINT_LEVEL_STEP, 1, false, true);
    	}
    	else if (exp >= q * 3 && iLevStep < 3)
    	{
    		for (int i = 0; i < 3 - iLevStep; ++i)
    			PointChange(POINT_LEVEL_STEP, 1, false, true);
    	}
    	else if (exp >= q * 2 && iLevStep < 2)
    	{
    		for (int i = 0; i < 2 - iLevStep; ++i)
    			PointChange(POINT_LEVEL_STEP, 1, false, true);
    	}
    	else if (exp >= q && iLevStep < 1)
    		PointChange(POINT_LEVEL_STEP, 1);
    
    	if (iExpBalance)
    	{
    		PointChange(POINT_EXP, iExpBalance);
    	}
    	

    and case POINT_LEVEL_STEP:

     

    mm ok

    i have same idea but i have tried 2 hours without result.....

  7. Hi dev's

    I'm trying to create room for guilds in a particular map, I wanted to create it using the functions of the dungeons so that the index is always the same, and guild members can access it when they want and find other members of the guild, I tried using the functions already present as pc.warp indicating as an index map index * 10000 + index guild, this function I teleports me to map but not on specified index, i think is beceause the function not finding the index map of dungeon , so I suppose that is a check if the index exists or less, trying with d.new_jump tells me that it can not create the instance ... I wanted to know if there is any solution or if I have to create / edit a function in the source and how to do it.

    thanks

  8. Hi dev's

     

    I'm implementing the channel changer and gives me the sequent error,

    0520 13:53:25870 ::   File "ui.py", line 1031, in CallEvent
    
    0520 13:53:25870 ::   File "canal.py", line 99, in <lambda>
    
    0520 13:53:25870 ::   File "canal.py", line 268, in __OnClickConnectButton
    
    0520 13:53:25870 ::   File "canal.py", line 271, in DirectConnect
    
    0520 13:53:25870 :: NameError
    0520 13:53:25870 :: : 
    0520 13:53:25870 :: global name 'decode_string' is not defined
    0520 13:53:25870 :: 
    

    the system  runs the same but I would remove it from the errors

     

    this is the canal.py

     

    thanks

    
    import ui
    import net
    import app
    import chat
    import math
    import wndMgr
    import serverInfo
    import background
    import ServerStateChecker
    
    class ChannelChanger(ui.ScriptWindow):
    	def __init__(self):
    		ui.ScriptWindow.__init__(self)
    
    		self.__Schimbare_Canal()
    		self.__Incarcare_Resurse()
    		self.__Fill_Up_ChannelList()
    
    	def __del__(self):
    		ui.ScriptWindow.__del__(self)
    
    	def Destroy(self):
    		self.Hide()
    		return TRUE
    
    	def __Schimbare_Canal(self):
    		ServerStateChecker.Create(self)
    		self.SetSize(150, 175)
    		self.SetPosition(
    			(wndMgr.GetScreenWidth() / 2) - int(math.floor(self.GetWidth() / 2.)),
    			(wndMgr.GetScreenHeight() / 2) - int(math.floor(self.GetHeight() / 2.))
    		)
    		#self.AddFlag("movable")
    		self.AddFlag("float")
    		self.Show()
    
    	def __Incarcare_Resurse(self):
    		self.Board = ui.Board()
    		self.Board.SetParent(self)
    		self.Board.SetSize(self.GetWidth(), self.GetHeight())
    		self.Board.SetPosition(0, 0)
    		#self.Board.AddFlag("movable")
    		self.Board.AddFlag("float")
    		self.Board.Show()
    
    		self.TitleBar = ui.TitleBar()
    		self.TitleBar.SetParent(self.Board)
    		self.TitleBar.SetPosition(7, 7)
    		self.TitleBar.MakeTitleBar(self.GetWidth() - 2 * 7, 'bloodyblue')
    		self.TitleBar.SetCloseEvent(self.Close)
    		self.TitleBar.Show()
    
    		self.RefreshButton = ui.Button()
    		self.RefreshButton.SetParent(self.TitleBar)
    		self.RefreshButton.SetPosition(3, 3)
    		self.RefreshButton.SetUpVisual("d:/ymir work/ui/game/guild/refresh_button_01.sub")
    		self.RefreshButton.SetOverVisual("d:/ymir work/ui/game/guild/refresh_button_02.sub")
    		self.RefreshButton.SetDownVisual("d:/ymir work/ui/game/guild/refresh_button_03.sub")
    		self.RefreshButton.SetToolTipText("Refresh", 0, - 23)
    		self.RefreshButton.SetEvent(lambda : self.__Fill_Up_ChannelList())
    		self.RefreshButton.Show()
    
    		self.TitleText = ui.TextLine()
    		self.TitleText.SetParent(self.TitleBar)
    		self.TitleText.SetPosition(0, 4)
    		self.TitleText.SetText("CH - Selectie")
    		self.TitleText.SetWindowHorizontalAlignCenter()
    		self.TitleText.SetHorizontalAlignCenter()
    		self.TitleText.Show()
    
    		self.ServerName = ui.TextLine()
    		self.ServerName.SetParent(self.TitleBar)
    		self.ServerName.SetPosition(0, self.TitleBar.GetHeight())
    		self.ServerName.SetText(str(net.GetServerInfo()).split(",")[0])
    		self.ServerName.SetWindowHorizontalAlignCenter()
    		self.ServerName.SetHorizontalAlignCenter()
    		self.ServerName.Show()
    
    		self.ChannelListBase = ui.SlotBar()
    		self.ChannelListBase.SetParent(self.Board)
    		self.ChannelListBase.SetSize(self.Board.GetWidth() - 2 * 16, 5 * 18 - 4)
    		self.ChannelListBase.SetPosition(16 , 7 + self.TitleBar.GetHeight() + 6 + 10)
    		self.ChannelListBase.Show()
    
    		self.ChannelList = ui.ListBox()
    		self.ChannelList.SetParent(self.ChannelListBase)
    		self.ChannelList.SetSize(self.ChannelListBase.GetWidth()- 20, self.ChannelListBase.GetHeight())
    		self.ChannelList.SetPosition(0, 0)
    		self.ChannelList.SetEvent(ui.__mem_func__(self.__OnSelectChannel))
    		self.ChannelList.Show()
    
    		self.ChangeButton = ui.Button()
    		self.ChangeButton.SetParent(self.Board)
    		self.ChangeButton.SetPosition(self.Board.GetWidth() / 2 - 44, self.Board.GetHeight() - 35)
    		self.ChangeButton.SetUpVisual('d:/ymir work/ui/public/Large_button_01.sub')
    		self.ChangeButton.SetOverVisual('d:/ymir work/ui/public/Large_button_02.sub')
    		self.ChangeButton.SetDownVisual('d:/ymir work/ui/public/Large_button_03.sub')
    		self.ChangeButton.SetEvent(lambda : self.__OnClickConnectButton())
    		self.ChangeButton.SetText("Du-te")
    		self.ChangeButton.Show()
    		self.DisableChangeButton()
    
    		self.ChannelListScrollBar = ui.ScrollBar()
    		self.ChannelListScrollBar.SetParent(self.ChannelListBase)
    		self.ChannelListScrollBar.SetPosition(18, 3)
    		self.ChannelListScrollBar.SetScrollBarSize(83)
    		self.ChannelListScrollBar.SetWindowHorizontalAlignRight()
    		self.ChannelListScrollBar.SetScrollEvent(ui.__mem_func__(self.__OnScrollChannelList))
    		self.ChannelListScrollBar.Show()
    
    	def DisableChangeButton(self):
    		self.ChangeButton.Disable()
    		self.ChangeButton.Down()
    		self.ChangeButton.ButtonText.SetFontColor(0.4, 0.4, 0.4)
    
    	def EnableChangeButton(self):
    		self.ChangeButton.Enable()
    		self.ChangeButton.SetUp()
    		self.ChangeButton.ButtonText.SetFontColor(1, 1, 1)
    
    	def __GetRegionID(self):
    		return 0
    
    	def __GetServerID(self):
    		regionID = self.__GetRegionID()
    		for i in serverInfo.REGION_DICT[regionID].keys():
    			if serverInfo.REGION_DICT[regionID][i]["name"] == net.GetServerInfo().split(",")[0]:
    				serverID = int(i)
    				break
    
    		return serverID
    
    	def __Fill_Up_ChannelList(self):
    		self.__RequestServerStateList()
    		self.__RefreshServerStateList()
    		#self.ChannelList.SelectItem(0)
    
    	def __RequestServerStateList(self):
    		regionID = self.__GetRegionID()
    		serverID = self.__GetServerID()
    
    		try:
    			channelDict = serverInfo.REGION_DICT[regionID][serverID]["channel"]
    		except:
    			return
    
    		for id, channelDataDict in channelDict.items():
    			key=channelDataDict["key"]
    			ip=channelDataDict["ip"]
    			udp_port=channelDataDict["udp_port"]
    			ServerStateChecker.Request(key, ip, udp_port)
    
    	def __RefreshServerStateList(self):
    		regionID = self.__GetRegionID()
    		serverID = self.__GetServerID()
    		bakChannelID = self.ChannelList.GetSelectedItem()
    
    		self.ChannelList.ClearItem()
    
    		try:
    			channelDict = serverInfo.REGION_DICT[regionID][serverID]["channel"]
    		except:
    			return
    
    		for channelID, channelDataDict in channelDict.items():
    			channelName = channelDataDict["name"]
    			channelState = channelDataDict["state"]
    			self.ChannelList.InsertItem(channelID, "%s %s" % (channelName, channelState))
    
    		self.ChannelList.SelectItem(bakChannelID-1)
    
    	def NotifyChannelState(self, addrKey, state):
    		try:
    			stateName = serverInfo.STATE_DICT[state]
    		except:
    			stateName = serverInfo.STATE_NONE
    
    		regionID  = int(addrKey / 1000)
    		serverID  = int(addrKey / 10) % 100
    		channelID = addrKey % 10
    
    		try:
    			serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["state"] = stateName
    			self.__RefreshChannelStateList()
    		except:
    			pass
    
    	def __IsSpecialMap(self):
    		dis_maps = [
    			"season1/metin2_map_oxevent",
    			"season2/metin2_map_guild_inside01",
    			"season2/metin2_map_empirewar01",
    			"season2/metin2_map_empirewar02",
    			"season2/metin2_map_empirewar03",
    			"metin2_map_dragon_timeattack_01",
    			"metin2_map_dragon_timeattack_02",
    			"metin2_map_dragon_timeattack_03",
    			"metin2_map_skipia_dungeon_boss",
    			"metin2_map_skipia_dungeon_boss2",
    			"metin2_map_devilsCatacomb",
    			"metin2_map_deviltower1",
    			"metin2_map_t1",
    			"metin2_map_t2",
    			"metin2_map_t3",
    			"metin2_map_t4",
    			"metin2_map_t5",
    			"metin2_map_wedding_01",
    			"metin2_map_duel"
    		]
    		if str(background.GetCurrentMapName()) in dis_maps:
    			return TRUE
    		return FALSE
    
    	def __OnSelectChannel(self):
    		if self.ChangeButton.IsDown():
    			self.EnableChangeButton()
    
    	def __OnScrollChannelList(self):
    		viewItemCount = self.ChannelList.GetViewItemCount()
    		itemCount = self.ChannelList.GetItemCount()
    		pos = self.ChannelListScrollBar.GetPos() * (itemCount - viewItemCount)
    		self.ChannelList.SetBasePos(int(pos))
    
    	def __OnClickConnectButton(self):
    		regionID = self.__GetRegionID()
    		serverID = self.__GetServerID()
    		channelID = self.ChannelList.GetSelectedItem()
    		if not channelID:
    			chat.AppendChat(1, "Succes!")
    			return
    
    		try:
    			serverName = serverInfo.REGION_DICT[regionID][serverID]["name"]
    			channelName = serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["name"]
    			addrKey = serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["key"]
    			ip = serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["ip"]
    			tcp_port = serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["tcp_port"]
    			state = serverInfo.REGION_DICT[regionID][serverID]["channel"][channelID]["state"]
    
    			account_ip = serverInfo.REGION_AUTH_SERVER_DICT[regionID][serverID]["ip"]
    			account_port = serverInfo.REGION_AUTH_SERVER_DICT[regionID][serverID]["port"]
    
    			markKey = regionID * 1000 + serverID * 10
    			markAddrValue=serverInfo.MARKADDR_DICT[markKey]
    			net.SetMarkServer(markAddrValue["ip"], markAddrValue["tcp_port"])
    			app.SetGuildMarkPath(markAddrValue["mark"])
    			app.SetGuildSymbolPath(markAddrValue["symbol_path"])
    		except:
    			chat.AppendChat(1, "A aparut o eroare în timpul conexiunii!")
    			return
    
    		if state == serverInfo.STATE_NONE:
    			chat.AppendChat(1, "Ne pare rau pentru canalul selectat nu este disponibil!")
    			return
    		elif state == serverInfo.STATE_DICT[3]:
    			chat.AppendChat(1, "Ne pare rau pentru canalul selectat este plin!")
    			return
    		elif net.GetServerInfo().strip().split(", ")[1] == self.ChannelList.textDict[self.ChannelList.selectedLine].strip().split(" ")[0]:
    			chat.AppendChat(1, "Sunteti deja pe canalul selectat!")
    			return
    		elif self.__IsSpecialMap():
    			chat.AppendChat(1, "Ne pare rau, în acest domeniu nu se poate schimba canalul fara deconectare!")
    			return
    
    		self.Close()
    		net.SetServerInfo("%s, %s" % (serverName, channelName))
    		self.DirectConnect(ip, tcp_port, account_ip, account_port)
    
    	def DirectConnect(self, ChannelIP, ChannelPort, AuthServerIP, AuthServerPort):
    		net.SetLoginInfo(decode_string(net.ACCOUNT_ID), decode_string(net.ACCOUNT_PW))
    		net.ConnectToAccountServer(ChannelIP, ChannelPort, AuthServerIP, AuthServerPort)
    		net.DirectEnter(0)
    		net.SendSelectCharacterPacket(0)
    		net.SendEnterGamePacket()
    
    	def Show(self):
    		ui.ScriptWindow.Show(self)
    
    	def Close(self):
    		#ServerStateChecker.Destroy(self)
    		self.Hide()
    		return TRUE
    
    	def OnPressEscapeKey(self):
    		self.Close()
    		return TRUE
    
    	def OnUpdate(self):
    		ServerStateChecker.Update()
    
    iom = ChannelChanger()
    iom.Show()
    chat.AppendChat(1, "#System#{Operatiunea a avut succes!}")
    
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.