Jump to content

Abel(Tiger)

Active+ Member
  • Posts

    196
  • Joined

  • Last visited

  • Days Won

    14
  • Feedback

    0%

Posts posted by Abel(Tiger)

  1. 				BYTE bMaxItemSize = 1;
    				const CSpecialItemGroup* pGroup = ITEM_MANAGER::instance().GetSpecialItemGroup(dwBoxVnum);
    				if (pGroup)
    				{
    					for (int i = 0; i < pGroup->GetGroupSize(); i++)
    					{
    						const TItemTable* itemTable = ITEM_MANAGER::instance().GetTable(pGroup->GetVnum(i));
    						if(itemTable)
    						{
    							if(itemTable->bSize > bMaxItemSize)
    							{
    								bMaxItemSize = itemTable->bSize;
    								if(bMaxItemSize == 3)
    									break;
    							}
    						}
    					}
    				}
    				
    				if(GetEmptyInventory(bMaxItemSize) == -1)
    				{
    					ChatPacket(CHAT_TYPE_INFO, "You need %d perpendicular slots in your inventory to open the Chest.", bMaxItemSize);
    					return false;
    				}

     

    Place it in char_item.cpp inside case ITEM_GIFTBOX: after dwBoxVnum. (there are other cases for other types of chests, this instruction is only for giftbox type). 

    Also I think the max size from the chest must be a info loaded when the special group is loaded and saved in a variable.

    The code I posted for you increases the time complexity of the function and it's not a good ideea 😀

     

  2. 3 minutes ago, Draveniou1 said:

    I know you look but it will not work because it has random BYTES long [9]

    I Can creating my client and you search my Byte and not  fghfghfgjfgsdfsdfsdfgjhfgjhdfhdhd

    https://metin2.download/picture/2I2wvQotSgs70P6aQFdcUOj3pif2yIVt/.png

     

     

    If you don't sent it to the server with some keys it doesn't matter what it have in it, all that matter is the size of the struct.

    And if you sent it with some keys to check on the server the only thing that matter it's the address of the struct in memory and the size of the struct, after that the keys are easy to find.

  3. 18 minutes ago, Draveniou1 said:

     

    Can't find the key because it is in BYTE up 250 // long fghfghfgjfgsdfsdfsdfgjhfgjhdfhdhd [9]? 9x100 900 BYTE -100 byte after login it is safe try to break it you will not be able to

     

    If it wasn't safe I wouldn't post it

     

    It will also not be delayed, ... because you have deactivated the send packet 

    So you think that long array it's 900 bytes ? :))) It's actualy 36 bytes (288 bits) and yeah it can be found. This how it looks in memory (initialized with 1)

    screenshot-831.png

    And this is how it looks if it's 250+ bytes

    screenshot-832.png

     

  4. 19 minutes ago, Draveniou1 said:

    With this method I am always safe in packets of course everyone has their own way for security in packets I work with BYTES because hackers can not break them

    With 1k player online server I was always safe no one could damage my server as long as these BYTES existed

    Because you have heard various things about it you think it is not a good solution just try it and you will find that it is a correct solution

     

    But I try to make a better security in lib 

    I need to deal more with lib and not with packet.h  So that I do not have to constantly make new BYTE

     

     

    Maybe they didn't because your server is not that popular. Your method is so fucked up and no one should use that. Yes I agree with a single byte argument for version control or smth but wtf is this ?

        int    wertgwertgetdfgsdfgsdgdsfggrgergrgyergh[8];
        long    fghfghfgjfgsdfsdfsdfgjhfgjhdfhdhd[9];
        int    AWERWQRWsdfgsdgfsdgsdQEREFRSF[8];
        long    gsdfsfwetwersdgsdfgsdgwertfwetfwefwefgUiet[9];
        int    WETWETWdfgdfgdfgfghERTFWEFTWEFTWEFGWE[8];
        long    SDFWETGfhdfhdfghERTGWETFWERFWRFWQRQWRQWRt[9];
        int    WETFWEWEfgsdsdhgsdsdghsdghsdTFGWETGWETGWEGWGWETGTG[8];

    Do you realize your login it's going to be very slow if that packet is large ? 

    And who the fuck said you can't find the key if it's stored in 250 bytes ? 

  5. 11 minutes ago, Mali said:

    also db check is fine for me. that channel may not be online at that time.

    Yeah, that's a good approach. I think it's about what you want to sacrifice 😂 time or player experience (also if a channel it's not online something is wrong and need to be fixed asap, a good server never crash or maybe once a year 😂)

    11 minutes ago, Mali said:

    trying to make gf style xd

    Yeah, I know, I just said things that can happen without proper checks.

    • Lmao 1
  6. Good job 👍

    The ideea with geting the port from db it's nice (I think wom started this ideea some time ago), but not very good when we speak about a big server that use the db a lot (longer times when changing the channel). My advice it's to send all other channels info to every channel at boot and that will help you with more than change channel (now the current channel recieve the info about ch99 and other cores of the current channel if I'm not mistaken).

    The IsHack check is bad placed there and it can cause big problem for the server (players start the timer and jump over the check but in those 10 seconds they can open safebox and other stuff), also I recommend you use both CanWarp and IsHack checks because people skip one or the other when they implement new stuff 😂

     

  7. Those ~5px are for the shadows if I'm not mistaken.

    Also the ideea made by Ymir to open the client in two diferent position is stupid.

    I consider opening the windowed client on the center it's the best solution:

    		if (Windowed)
    		{
    			m_isWindowed = true;
    
    			RECT rc;
    			GetClientRect(&rc);
    		
    			int windowWidth = rc.right - rc.left;
    			int windowHeight = (rc.bottom - rc.top);
    		
    			// 80 is the gap for the taskbar, you can increase it
    			CMSApplication::SetPosition((GetScreenWidth() - windowWidth) / 2, (GetScreenHeight() - windowHeight - 80) / 2);
    		}
    		else
    		{
    			m_isWindowed = false;
    			SetPosition(0, 0);
    		}

     

    • Metin2 Dev 1
    • Good 1
    • Love 2
  8. I think it's a compiling problem, not a source problem (I had a similar problem in the past) so try these things:
    1. Don't compile with -j flag when you move to production

    2. Try downgrade c++2a to c++14 or c++11

    3. If 1 and 2 don't work try to upgrade clang to version 10 (I think you use 9)

     

  9. For the mall the grid is placed on the db, check ClientManager.cpp bellow this line:

    CGrid grid(5, MAX(1, pi->pSafebox->bSize) * 9);

    screenshot-780.png

     

    screenshot-781.png

     

    Also try this (a common bug in metin2 source):

    In ClientManagerBoot.cpp search:

    sort(m_vec_itemTable.begin(), m_vec_itemTable.end(), FCompareVnum());

    And move it before the iterator is initialized like this:

    	m_map_itemTableByVnum.clear();
    	
    	// Now it's here
    	sort(m_vec_itemTable.begin(), m_vec_itemTable.end(), FCompareVnum());
    
    	itertype(m_vec_itemTable) it = m_vec_itemTable.begin();
    
    	while (it != m_vec_itemTable.end())
    	{
    		TItemTable * item_table = &(*(it++));
    
    		sys_log(1, "ITEM: #%-5lu %-24s %-24s VAL: %ld %ld %ld %ld %ld %ld WEAR %lu ANTI %lu IMMUNE %lu REFINE %lu REFINE_SET %u MAGIC_PCT %u", 
    				item_table->dwVnum,
    				item_table->szName,
    				item_table->szLocaleName,
    				item_table->alValues[0],
    				item_table->alValues[1],
    				item_table->alValues[2],
    				item_table->alValues[3],
    				item_table->alValues[4],
    				item_table->alValues[5],
    				item_table->dwWearFlags,
    				item_table->dwAntiFlags,
    				item_table->dwImmuneFlag,
    				item_table->dwRefinedVnum,
    				item_table->wRefineSet,
    				item_table->bAlterToMagicItemPct);
    
          	// Also you can insert these values after the sort but because we
            // already looping through the list of items once (for the syslog), it's better to 
          	// move the sort function above (the complexity is half this way)
    		m_map_itemTableByVnum.insert(std::map<DWORD, TItemTable *>::value_type(item_table->dwVnum, item_table));
    	}
    
    	// It was here
    	
    	return true;

     

    • Love 4
  10. 😂

    The code you posted can be explained like this: When I get a sash (mostly with /item command) I will get (1,2,3 or 4) absortion based on sash type (wtf???) and with that discrete_distribution I have a change to get +abs. Example: I have a small change to get a type 1 sash with 6 absortion 😂

    Please don't copy code from other files if you don't know what it does. Rubinum used discrete_distribution when you combine two level 4 sashes for the +abs

    PS: the code you posted is from item.cpp not char_item.cpp 

    • Metin2 Dev 1
    • Good 2
×
×
  • 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.