Jump to content

Draveniou1

Active Member
  • Posts

    252
  • Joined

  • Last visited

  • Days Won

    2
  • Feedback

    100%

Posts posted by Draveniou1

  1. # post update 100%  fixxed problem withs locale_game.txt 

    OPEN NOW IN LOCALE LOCALE_GAME.TXT and locale_interface.txt
    
    ADD TOOLTIP_BUYPRICE_FREE Not Sell items my friends

     

    open uicommon and search    Only this you change from uicommon.py
    
    class MoneyInputDialog(ui.ScriptWindow):
    /................
    .................
    ............................
    ................
    ..................
    
    change with:
    
    
    class MoneyInputDialog(ui.ScriptWindow):
    
    	def __init__(self):
    		ui.ScriptWindow.__init__(self)
    
    		self.moneyHeaderText = localeInfo.MONEY_INPUT_DIALOG_SELLPRICE
    		self.__CreateDialog()
    		self.SetMaxLength(9)
    
    	def __del__(self):
    		ui.ScriptWindow.__del__(self)
    
    	def __CreateDialog(self):
    
    		pyScrLoader = ui.PythonScriptLoader()
    		pyScrLoader.LoadScriptFile(self, "uiscript/moneyinputdialog.py")
    
    		getObject = self.GetChild
    		self.board = self.GetChild("board")
    		self.acceptButton = getObject("AcceptButton")
    		self.accept2Button = getObject("Accept2Button")
    		self.cancelButton = getObject("CancelButton")
    		self.inputValue = getObject("InputValue")
    		self.inputValue.SetNumberMode()
    		self.inputValue.OnIMEUpdate = ui.__mem_func__(self.__OnValueUpdate)
    		self.moneyText = getObject("MoneyValue")
    
    	def Open(self):
    		self.inputValue.SetText("0")
    		self.inputValue.SetFocus()
    		self.__OnValueUpdate()
    		self.SetCenterPosition()
    		self.SetTop()
    		self.Show()
    
    	def Close(self):
    		self.ClearDictionary()
    		self.board = None
    		self.acceptButton = None
    		self.accept2Button = None
    		self.cancelButton = None
    		self.inputValue = None
    		self.Hide()
    
    	def SetTitle(self, name):
    		self.board.SetTitleName(name)
    
    	def SetFocus(self):
    		self.inputValue.SetFocus()
    
    	def SetMaxLength(self, length):
    		length = min(9, length)
    		self.inputValue.SetMax(length)
    
    	def SetMoneyHeaderText(self, text):
    		self.moneyHeaderText = text
    
    	def SetAcceptEvent(self, event):
    		self.acceptButton.SetEvent(event)
    		self.accept2Button.SetEvent(event)
    		self.inputValue.OnIMEReturn = event
    
    	def SetCancelEvent(self, event):
    		self.board.SetCloseEvent(event)
    		self.cancelButton.SetEvent(event)
    		self.inputValue.OnPressEscapeKey = event
    
    	def SetValue(self, value):
    		value=str(value)
    		self.inputValue.SetText(value)
    		self.__OnValueUpdate()
    		ime.SetCursorPosition(len(value))
    
    
    	def GetText(self):
    		return self.inputValue.GetText()
    
    	def __OnValueUpdate(self):
    		ui.EditLine.OnIMEUpdate(self.inputValue)
    
    		text = self.inputValue.GetText()
    
    		money = 0
    		if text and text.isdigit():
    			try:
    				money = int(text)
    			except ValueError:
    				money = 199999999
    
    		self.moneyText.SetText(self.moneyHeaderText + localeInfo.NumberToMoneyString(money))

     

    • Metin2 Dev 1
  2. 1 minute ago, TMP4 said:

    @Draveniou1 That fix is actually for hackers who bypasses the clientside block.

    I Know

    Normal:

    if (r_item.price < 0)  Normal change with   if (r_item.price <= 0)

     


    Your method    I have not tried this, the children will tell us

    if (r_item.price < 0 || (IsPCShop() && r_item.price <= 0))

    1 minute ago, xP3NG3Rx said:

    @Draveniou1 Apparently you have no clue what I was talking about neither how this process works, and how it can be exploited. 

    As I can see @TMP4 was faster to answer, and explained my point of view.

    it is safe, if it was not safe I would not publish it

  3. 2 hours ago, xP3NG3Rx said:

    Basically it just blocks the clientside popup message, right?
    So if I send the packet anyway, the players whom are showing the items going to get screwed up.

    No  block item in private shop ,   He has absolutely no problems

    1 hour ago, TMP4 said:

    To be safe as P3NG3R said, In shop.cpp edit this:

    if (r_item.price < 0)

    To this:

    if (r_item.price < 0 || (IsPCShop() && r_item.price <= 0))

    (You may have the original check with <= too)

    +1

    • Confused 1
  4. This is the hidden content, please

    Metin2 Download

     

    Players put items in their own private shop without being able to sell them as a sample

    This is the hidden content, please

    Edit: It will no longer message when you purchase the sample item

    Open uishop.py and search:

                itemBuyQuestionDialog = uiCommon.QuestionDialog()
                itemBuyQuestionDialog.SetText(localeInfo.DO_YOU_BUY_ITEM(itemName, itemCount, localeInfo.NumberToMoneyString(itemPrice)))
                itemBuyQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.AnswerBuyItem(arg))
                itemBuyQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.AnswerBuyItem(arg))
                itemBuyQuestionDialog.Open()
                itemBuyQuestionDialog.pos = slotPos
                self.itemBuyQuestionDialog = itemBuyQuestionDialog

    CHANGE WITH:

            if itemPrice == 0 :
                return;
            else:
                itemBuyQuestionDialog = uiCommon.QuestionDialog()
                itemBuyQuestionDialog.SetText(localeInfo.DO_YOU_BUY_ITEM(itemName, itemCount, localeInfo.NumberToMoneyString(itemPrice)))
                itemBuyQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.AnswerBuyItem(arg))
                itemBuyQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.AnswerBuyItem(arg))
                itemBuyQuestionDialog.Open()
                itemBuyQuestionDialog.pos = slotPos
                self.itemBuyQuestionDialog = itemBuyQuestionDialog

     

    ------------------------------------------------------------------------------------------------------

     

    FROM UICOMMON.PY CHANGE ONLY THIS CODE 

    Only this you change from uicommon.py

    open uicommon and search    Only this you change from uicommon.py
    
    class MoneyInputDialog(ui.ScriptWindow):
    /................
    .................
    ............................
    ................
    ..................
    
    change with:
    
    
    class MoneyInputDialog(ui.ScriptWindow):
    
    	def __init__(self):
    		ui.ScriptWindow.__init__(self)
    
    		self.moneyHeaderText = localeInfo.MONEY_INPUT_DIALOG_SELLPRICE
    		self.__CreateDialog()
    		self.SetMaxLength(9)
    
    	def __del__(self):
    		ui.ScriptWindow.__del__(self)
    
    	def __CreateDialog(self):
    
    		pyScrLoader = ui.PythonScriptLoader()
    		pyScrLoader.LoadScriptFile(self, "uiscript/moneyinputdialog.py")
    
    		getObject = self.GetChild
    		self.board = self.GetChild("board")
    		self.acceptButton = getObject("AcceptButton")
    		self.accept2Button = getObject("Accept2Button")
    		self.cancelButton = getObject("CancelButton")
    		self.inputValue = getObject("InputValue")
    		self.inputValue.SetNumberMode()
    		self.inputValue.OnIMEUpdate = ui.__mem_func__(self.__OnValueUpdate)
    		self.moneyText = getObject("MoneyValue")
    
    	def Open(self):
    		self.inputValue.SetText("0")
    		self.inputValue.SetFocus()
    		self.__OnValueUpdate()
    		self.SetCenterPosition()
    		self.SetTop()
    		self.Show()
    
    	def Close(self):
    		self.ClearDictionary()
    		self.board = None
    		self.acceptButton = None
    		self.accept2Button = None
    		self.cancelButton = None
    		self.inputValue = None
    		self.Hide()
    
    	def SetTitle(self, name):
    		self.board.SetTitleName(name)
    
    	def SetFocus(self):
    		self.inputValue.SetFocus()
    
    	def SetMaxLength(self, length):
    		length = min(9, length)
    		self.inputValue.SetMax(length)
    
    	def SetMoneyHeaderText(self, text):
    		self.moneyHeaderText = text
    
    	def SetAcceptEvent(self, event):
    		self.acceptButton.SetEvent(event)
    		self.accept2Button.SetEvent(event)
    		self.inputValue.OnIMEReturn = event
    
    	def SetCancelEvent(self, event):
    		self.board.SetCloseEvent(event)
    		self.cancelButton.SetEvent(event)
    		self.inputValue.OnPressEscapeKey = event
    
    	def SetValue(self, value):
    		value=str(value)
    		self.inputValue.SetText(value)
    		self.__OnValueUpdate()
    		ime.SetCursorPosition(len(value))
    
    
    	def GetText(self):
    		return self.inputValue.GetText()
    
    	def __OnValueUpdate(self):
    		ui.EditLine.OnIMEUpdate(self.inputValue)
    
    		text = self.inputValue.GetText()
    
    		money = 0
    		if text and text.isdigit():
    			try:
    				money = int(text)
    			except ValueError:
    				money = 199999999
    
    		self.moneyText.SetText(self.moneyHeaderText + localeInfo.NumberToMoneyString(money))

     

     

    #update tutorial in github fixxed with locale_game.txt 
    
    OPEN NOW IN LOCALE LOCALE_GAME.TXT and locale_interface.txt
    
    ADD
    
    TOOLTIP_BUYPRICE_FREE Not Sell items my friends

     

    ---------------------------------------------------------------------------------------------

    THIS COCE ONLY FOR SERVER WITH 0 YANG IN NPC
    
    If you do not have a server with 0 yang in npc then you do not need to make this small change in source shop.cpp
    
    idea from @TMP4
    
    In shop.cpp edit this:
    
    if (r_item.price < 0)
    
    To this:
    
    if (r_item.price < 0 || (IsPCShop() && r_item.price <= 0))

     

    • Metin2 Dev 122
    • Dislove 1
    • Angry 1
    • Not Good 2
    • Sad 1
    • Think 5
    • Confused 3
    • Good 29
    • Love 40
  5. This is the hidden content, please

    Metin2 Download

     

    I do this topic for those who have a problem with Unknown Header operating server in France with 800-1k player online and it has been working for 5 days without problems and without kick

    This is the hidden content, please

     

    If you have provlem :

    Open in game.py

    search and remove:

            if constInfo.SEQUENCE_PACKET_ENABLE:
                net.SetPacketSequenceMode()

     

    Now open constinfo.py and search and remove

    SEQUENCE_PACKET_ENABLE = 1

    ----------------------------------------------------------------------------------------------

     

    Source Client:

    Search 

    return SendSequence();

    change with

    // return disable;

     

    • Metin2 Dev 200
    • Dislove 2
    • Angry 1
    • Not Good 3
    • Think 5
    • Scream 1
    • Lmao 4
    • Good 50
    • muscle 1
    • Love 5
    • Love 65
  6.           create new line in root introloading

     imgFileNameDict = {
                    0 : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/loading0.sub",
                    1 : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/loading1.sub",
                    2 : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/loading2.sub",
                    3 : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/loading3.sub",
                    4 : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/loading4.sub",
                    5 : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/loading5.sub",
                    6 : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/loading6.sub",
                    7 : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/loading7.sub",
                    8 : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/loading8.sub",
                    9 : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/loading9.sub",
                    10 : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/loading10.sub",
                    11 : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/loading11.sub",

                }

     

    AND add subxx.sub  in locale/xx/ui/loading  

    • Good 1
  7. Hello

    I've done a lot of issues with IMPROVED_PACKET_ENCRYPTION 

    Today I managed to find a relatively big fix 

    But I can not figure out which method is best

    Please check up photo 

    I would be very happy if someone could tell me which method is the best

     

    METHOD (1) :

    https://metin2.download/picture/R78VJX8Ow1r73Pss1bG5b7mu1XyOYFMy/.jpg

     

    METHOD (2) :

    https://metin2.download/picture/4ZJbVb97MGYogmhRAw3SjE23J25xQ0Vl/.jpg

     

    By removing IMPROVED_PACKET_ENCRYPTION I have created a new key in Lib for security simply IMPROVED_PACKET_ENCRYPTION I disabled it to have a fast client

     

     

     

     

     

     

    • Metin2 Dev 4
    • Think 1
    • Love 1
  8. 2 minutes ago, ondry said:

    No, its not safe nor good solution for unknown header packets.. Your client will not be closed if you receive wrong packets, but your whole client will go nuts (you will see that your level is 98865556, you will see nonsense items in your inventory etc.)

    ?  thanks if do you have any idea for fix unknown header closed client 

  9. Hello

    ------------------------------------------------------
    This way I solved the problem that the client crash the issue is this can bring some problem to the server? is it 100% safe?
    ------------------------------------------------------

    open PythonNetworkStream.cpp
    search :

    bool CPythonNetworkStream::RecvErrorPacket(int header)
    {
        TraceError("Phase %s does not handle this header (header: %d, last: %d, %d)",
            m_strPhase.c_str(), header, g_iLastPacket[0], g_iLastPacket[1]);
    
        ClearRecvBuffer();
        return true;
    }

    replace:

    bool CPythonNetworkStream::RecvErrorPacket(int header)
    {
        if (0 == header)
            return true;
    }

    new search: 

        if (!s_packetHeaderMap.Get(header, &PacketType))
        {
            TraceError("Unknown packet header: %d, last: %d %d", header, g_iLastPacket[0], g_iLastPacket[1]);
            ClearRecvBuffer();
    
            PostQuitMessage(0);
            return false;
        }

    replace:

        if (!s_packetHeaderMap.Get(header, &PacketType))
        {
            if (0 == header)
                return true;
        }

     

    • Confused 1
×
×
  • 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.