Jump to content

127.0.0.1

Banned
  • Posts

    51
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by 127.0.0.1

  1. 48 minutes ago, Defective said:

    Hello guys,is it possible that if i select a player in gmlist with LOW_WIZARD grade that he won't have the GM icon when he PM's someone?and that yellow writing?i want it to be for GOD and above is it possible?if yes ,can you teach me how?i have the server sources (game + binary) 

    Search 

    if(!test_server)
    {
    	if(GetGMLevel() > GM_LOW_WIZARD)
    	{
    		m_afAffectFlag.Set(AFF_YMIR);
    		m_bPKMode = PK_MODE_PROTECT;
    	}
    }

    Add after

    	if(GetGMLevel() == GM_GOD)
    	{
    		m_afAffectFlag.Set(AFF_YMIR);
    	}

     

  2. 40 minutes ago, EnKor said:

    i get same error in line 59. So i make the same u say.... 

     

    This systems it's all bug :\ Cant compile. But ty anywat

     

     

    error:  " 
    item_block.cpp:61: error: no matching function for call to 'std::multimap<long int, unsigned int,

    "

     

     

    Here if fixed :

    #include "stdafx.h"
    #include "item_block.h"
    #include <fstream>
    #include <sstream>
    
    void CItemBlock::Process()
    {
    	std::string strMapIndex;
    	std::string strItemVnums;
    
    	std::ifstream File("blocked_items.txt");
    
    	if (!File.is_open())
    		return;
    
    	if (!m_map_BlockedItems.empty())
    		m_map_BlockedItems.clear();
    
    	while (!File.eof())
    	{
    		File >> strMapIndex >> strItemVnums;
    
    		std::string strItemVnum;
    
    		std::istringstream Vnums(strItemVnums);
    
    		while (std::getline(Vnums, strItemVnum, ','))
    		{
    			AddItem(strtoul(strMapIndex.c_str(), NULL, 10), strtoul(strItemVnum.c_str(), NULL, 10));
    		}
    	}
    
    	File.close();
    }
    
    void CItemBlock::AddItem(const long lMapIndex, const DWORD dwVnum)
    {
    	if (lMapIndex < 0 || dwVnum < 0)
    		return;
    
    	m_map_BlockedItems.insert(std::make_pair(lMapIndex, dwVnum));
    }
    
    void CItemBlock::RemoveItem(const long lMapIndex, const DWORD dwVnum)
    {
    	if (lMapIndex < 0 || dwVnum < 0)
    		return;
    
    	BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin();
    
    	if (it != m_map_BlockedItems.end())
    	{
    		if (it->first == lMapIndex && it->second == dwVnum)
    			it = m_map_BlockedItems.erase(it);
    		else
    			++it;
    	}
    
    }
    
    bool CItemBlock::CanUseItem(const long lMapIndex, const DWORD dwVnum) const
    {
    	BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin();
    
    	if (it != m_map_BlockedItems.end())
    	{
    		if (it->first == lMapIndex && it->second == dwVnum)
    			return false;
    	}
    
    	return true;
    }
    #pragma once
    
    class CItemBlock : public singleton<CItemBlock>
    {
    public:
    	CItemBlock()	{ }
    	~CItemBlock()	{ }
    
    	void	Process();
    	bool	CanUseItem(const long lMapIndex, const DWORD dwVnum) const;
    	void	AddItem(const long lMapIndex, const DWORD dwVnum);
    	void	RemoveItem(const long lMapIndex, const DWORD dwVnum);
    
    private:
    	typedef std::multimap<long, DWORD> BLOCKED_ITEMS;
    	BLOCKED_ITEMS m_map_BlockedItems;
    };

     

    • Love 1
  3. What a silly question. It's like asking: Who fucked my mother? Only she knows.


    Same happens with your problem, where to we know what is in your server?
    This issue can have 100 cases? Do you want to make a list of them all? Silly.

     

    You do not even bother to tell if you have syserr or to receive any core dump. And you want help ?  If you want a good answer, ask a good question. I've learned so on StackOverflow.

  4. No one can say what is wrong with this function.
    Matter how it is used.

     

    This topic should be deleted because you have not given enough information.

     

    def GetAlignmentTitleName(alignment):
    	import chr 
    	import player
    
    	race	= player.GetRace()
    	sex	= chr.RaceToSex(race)
    	align	= player.GetAlignmentData()
    
    	if align >= 12000:
    		if sex == 1:
    			# Do stuff
    		else:
    			# Do stuff

     

     

    USE YOU BRAIN WHEN YOU POST A QUESTION. And who is that exygo ? 

  5. 3 hours ago, DeYaN. said:

    Yes yes yes !!! i do that . i put the old flag in navicat/client ANTIFLAG_MYSHOP - 106880 ! And if i add only that item  and click open the shop , the function is working "You can't trade this items!" , but if i add in addition other item who is trade , the shop are working ...

     

    What it should to do is when i try to put an item who is non-trade then to OPEN A WINDOW where is say "you can`t add a non-trade item" ,... no how is now , like after you add items and click "CREATE SHOP" to give a message in the chat "you can`t blalblalba"

    https://metin2.download/picture/ZUYSLEQ4g9aNJMp6532vq3v5124I5Akl/.png

     

    • Love 1
  6. 51 minutes ago, DeYaN. said:

     

    Thx you for your reply .

     

    I see here , the offlineshopbuild.py and uiofflineshop.py use the old flag from normal shop "ANTIFLAG_MYSHOP" , so .. probably if i put the new flag , will be the same problem ...

      Hide contents

    Untitled.jpg

     

     

    You don't have brain #confirmed Read my post again.

    Think logically. If using the old flag, what should you do?

  7. 36 minutes ago, iFreakTime~.~ said:

    This is solution ? "player%s_deleted" to "player_deleted%s" ? 

    Sure, the TablePostfix is used to use 2 database intro same server.

    If you set  TABLE_POSTFIX = "dev"  the player will become player_dev intro mysql.

     

    This is not the correct fix, if you have TABLE_POSTFIX=" " intro CONFIG then player_deleted will become  player _delete wtith one space and this will break database.

    But if you have the TABLE_POSTFIX="" this is default postfix and this fix is useless.

     

    snprintf(queryStr, sizeof(queryStr), "INSERT INTO player_deleted SELECT * FROM player WHERE id=%d", pi->player_id);
    std::auto_ptr<SQLMsg> pIns(CDBManager::instance().DirectQuery(queryStr));
    
    if (pIns->Get()->uiAffectedRows == 0 || pIns->Get()->uiAffectedRows == (uint32_t)-1)
    {
    	sys_log(0, "PLAYER_DELETE FAILED %u CANNOT INSERT TO player_deleted", dwPID);
    
    	peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, pi->dwHandle, 1);
    	peer->EncodeBYTE(pi->account_index);
    	return;
    }

    This is the best solution.  Table postfix is shit.

    Next use you brain.

    • Good 1
  8. 25 minutes ago, DeYaN. said:

     

    I belive the antiflag is working , but if i try to open a shop offline and add the non-trade item second time , the items are put in the shop. 

    I belive i need to put this antiflag in item_proto client ? i put then ,but i don`t upgrade the ItemCSVreader with the new antiflag .

    ItemData.h

    enum EItemAntiFlag
    ////////////////////////////
    ITEM_ANTIFLAG_MY_OFFLINE_SHOP = (1 << 19),

    PythonItemModule.cpp

    PyModule_AddIntConstant(poModule, "ITEM_ANTIFLAG_MY_OFFLINE_SHOP", CItemData::ITEM_ANTIFLAG_MY_OFFLINE_SHOP);

     

    Dump_proto.cpp

    int get_Item_AntiFlag_Value (string inputString)
    {
    	string arAntiFlag[] =

     

    Then add in  uiofflineshopbuilder.py  / uiofflineshop.py those antiflags.

    offlineshopbuilder.py

     

    	def OnSelectEmptySlot(self, selectedSlotPos):
    			if item.IsAntiFlag(item.ANTIFLAG_GIVE) or item.IsAntiFlag(item.ITEM_ANTIFLAG_MY_OFFLINE_SHOP):
    				chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OFFLINE_SHOP_CANNOT_SELL_ITEM)
    				return

    uiofflineshop.py

        def SelectEmptySlot(self, slotIndex):

    etc etc... Use you brain.

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