Jump to content

MysteriousDev

Premium
  • Posts

    7
  • Joined

  • Last visited

  • Feedback

    0%

About MysteriousDev

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

MysteriousDev's Achievements

Enthusiast

Enthusiast (6/16)

  • Conversation Starter
  • Very Important Person Rare
  • First Post
  • Dedicated
  • One Year In

Recent Badges

10

Reputation

  1. Nothing wrong with the fix. Just saying about another bug (or should I say bad design) which is somehow related to the /inv command.
  2. There is still issue with insert packet - cheaters can see if you're there. Also /observer is broken on warp, cause it sends insert packet before the observer mode is turned on (which trigger is sent by client).
  3. I guess the original thought behind this was to not reward a player that has dealt only 1 hit to the boss/metin. The best way to fix that is to rewrite the item drop to make it prioritize the damage dealt with no artificial thresholds. This would reward the best player with the best DPS. But it makes a gameplay impact. Or just make an exception for a world boss to not account the 10% range.
  4. There is a very old bug, most known on servers where players can deal absurd amount of damage or there is a world boss and many players can join the fight. So the issue is that mobs can drop items without ownership, and if there is a lot of players the drop just instantly disappears cause everyone is spamming the pick up key. How is it possible? The main issue is in CHARACTER::Reward (check comments): std::priority_queue<std::pair<int, LPCHARACTER> > pq; int total_dam = 0; for (TDamageMap::iterator it = m_map_kDamage.begin(); it != m_map_kDamage.end(); ++it) { int iDamage = it->second.iTotalDamage; if (iDamage > 0) { LPCHARACTER ch = CHARACTER_MANAGER::instance().Find(it->first); if (ch) { pq.push(std::make_pair(iDamage, ch)); // first issue here total_dam += iDamage; } } } std::vector<LPCHARACTER> v; // second one here while (!pq.empty() && pq.top().first * 10 >= total_dam) { v.emplace_back(pq.top().second); pq.pop(); } so when the total damage (int total_dam) of all players exceeds INT_MAX, guess what happens? It overflows to values below 0. Another risk is that pq.top().first * 10 will exceed the INT_MAX if the fight is long enough and the player has really good DPS. How do we fix it? It's trivial easy: @@ -812,7 +812,7 @@ void CHARACTER::Reward(bool bItemDrop) std::priority_queue<std::pair<int, LPCHARACTER> > pq; - int total_dam = 0; + long long total_dam = 0; for (TDamageMap::iterator it = m_map_kDamage.begin(); it != m_map_kDamage.end(); ++it) { @@ -830,8 +830,7 @@ void CHARACTER::Reward(bool bItemDrop) } std::vector<LPCHARACTER> v; - - while (!pq.empty() && pq.top().first * 10 >= total_dam) + while (!pq.empty() && static_cast<long long>(pq.top().first) * 10 >= total_dam) { v.emplace_back(pq.top().second); pq.pop(); -- The topic covers the case which can occur on base Metin2. There is nearly 0% chance to reach INT_MAX in total damage per Mob as a normal player. However, 30 players fighting with world boss are able to exceed the INT limit. If you assume that a player himself is able to exceed INT_MAX in total damage per mob you should consider changing the type of iTotalDamage in TBattleInfo struct. This of course comes with more editions, wherever the damage map is changed or read.
  5. Hello. I have a really easy fix for the default CBanwordManager::CheckString implementation. So the issue is: lets say we have a word "bitch" defined in banword. If we pass string "Bitch" through the CheckString it will return false which is not a proper behaviour. Players can remove insult.txt content from the client and name their characters with profane words avoiding the proper check. Lets get into it. diff --git a/game/src/banword.cpp b/game/src/banword.cpp --- a/game/src/banword.cpp +++ b/game/src/banword.cpp @@ -39,8 +39,11 @@ __typeof(m_hashmap_words.begin()) it = m_hashmap_words.begin(); + std::string input(c_pszString, _len); + std::transform(input.begin(), input.end(), input.begin(), ::tolower); + while (it != m_hashmap_words.end()) { const std::string & r = it->first; - const char * tmp = c_pszString; + const char * tmp = input.c_str(); ssize_t len = _len;
      • 3
      • Metin2 Dev
      • Love
  6. default MINMAX will round the fRatio value to 0. The result is that effects are updated in the same rate as always.
  7. I got interested in this topic so I tried it myself. What I've found you can pretty easily enable antialiasing on dx9. Search for: int CGraphicDevice::Create Now scroll down where the parameters of ms_d3dPresentParameter are set. Add those two lines ms_d3dPresentParameter.MultiSampleType = D3DMULTISAMPLE_8_SAMPLES; ms_d3dPresentParameter.MultiSampleQuality = 0; And now that's a riddle. I haven't got too much time for a research, but ms_lpd3d->CheckDeviceMultiSampleType tells that multiSampling is indeed available, and it sets the quality to 1. But I can't get it working with it, so I left the quality set to 0, it still looks good enough, IDK what would be the difference. Also there's one more thing to set in the parameters, and I don't know the long term effects of this change, but it looks like it works just fine, like I said I don't have too much time for doing research atm. You'll be having a "D3DERR_INVALIDCALL" error if ms_d3dPresentParameter.Flags are set to D3DPRESENTFLAG_LOCKABLE_BACKBUFFER, and I don't know the answer for now, maybe I'm missing something, but setting the flag to 0 does the job. After the device is created with success you must write last line to make it work: ms_lpd3dDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, TRUE); And now you can enjoy those SMOOTH EDGES:
×
×
  • 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.