Jump to content

Abel(Tiger)

Active+ Member
  • Posts

    196
  • Joined

  • Last visited

  • Days Won

    14
  • Feedback

    0%

Everything 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. 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. Did you try to click on the line of the item before you click on "Buy" ?
  4. 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) And this is how it looks if it's 250+ bytes
  5. 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 ?
  6. If the argument have a default value and you don't need that argument you can skip it. And if you need let's say the last argument (which have a default value) you can use it like this : self.AddItemData(itemVnum, metinSlot, attrSlot, preview = 1)
  7. I think that's the effect from Rubinum server but colored diferent. Contact Rubinum admins and maybe they will give it to you. (or stole it )
  8. You can't just to get them, there are some operations made to get those values. Here is the entire documentation of granny (search GrannyUpdateModelMatrix): [Hidden Content]
  9. // Search: if (40.0f < fabs(modelMatrix[3][1])) bIsAccumulationMotion = true; // Add this line before that if: modelMatrix[3][1] = animation->TrackGroups[trackIndex]->LoopTranslation[1];
  10. 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 ) Yeah, I know, I just said things that can happen without proper checks.
  11. 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
  12. If I'm not mistaken the exchange info is in the leaked rubinum source. The trade chat is easy to made.
  13. 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); }
  14. From what I know you can't set two counters on the same quest. Official server has some quests where you need to kill multiple monsters but the counter is set when you kill one of the monsters. Example: you kill Wild Dog and it will apear wild dog counter, you kill hungry wild dog and it will apear the counter for that one.
  15. 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)
  16. What compiler do you use for compiling the db, what freebsd for compiling and what freebsd for runing, also do you compile with -j ?
  17. That variable it's always 1 for the mall window, my advice is to compare all the code from function CClientManager::RESULT_SAFEBOX_LOAD with a clasic one and solve the bug with the addresses I told you about.
  18. 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); 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;
  19. Or you can call the accept button event like this: def OnIMEReturn(self): if self.acceptButton: self.acceptButton.CallEvent() return True
  20. Right, uiPrivateShopBuilder.py -> class PrivateShopAdvertisementBoard(ui.ThinBoard): add these:
  21. 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
  22. Take this: [Hidden Content] Compare the folders and copy the changes in your root source. PS: you might already have interface binded
  23. Yes. Save them in a file inside the folder of the client and hash them somehow with a unique identifier (like mac address, or something like that) so only that computer can acces them in case of stolen.
  24. It get's random stuff from the memory but because it's a gm command don't stress about it. But if you really want that gone try a lenght check: ACMD(do_notice) { if(strlen(argument) < 2) return; BroadcastNotice(argument + 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.