Jump to content

balrok

Members
  • Posts

    222
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by balrok

  1. if someone wants to port the bg_event-patch from battleground to mapclass it will speed up the progress very much.. but i currently don't have enough time for it.. i think next year it will get better if someone is interested: here is my first work on this: http://github.com/balrok/mangos/commits/map_move2 it needs some compile-testing and some hacks must get removed sql stuff must get renamed (battleground_creature event_creature or map_creature.. i don't know.. it's always the hardest thing to get good sounding names, which will describe everything well enough^^) if this is done the spawnsystem of outdoorstuff must get rewritten and then it will work again.. (also after this sd2-code can maybe be simplified, since no spawncoords must be inside the scripts and spawning inside scripts will get as easy as in battlegrounds then.. )
  2. again an updated version.. player gets the itemloot if the bag closes where his loot is inside, when moving the bags around so i came to this: diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 5e88703..debcd56 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -10073,7 +10073,10 @@ uint8 Player::CanBankItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *p return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND; if (pItem->m_lootGenerated) - return EQUIP_ERR_ITEM_LOCKED; + { + GetSession()->DoLootRelease(GetLootGUID()); + return EQUIP_ERR_OK; + } uint32 count = pItem->GetCount(); @@ -11493,7 +11496,7 @@ void Player::SwapItem( uint16 src, uint16 dst ) // bag swap (with items exchange) case if(emptyBag && fullBag) { - ItemPrototype const* emotyProto = emptyBag->GetProto(); + ItemPrototype const* emptyProto = emptyBag->GetProto(); uint32 count = 0; @@ -11504,7 +11507,7 @@ void Player::SwapItem( uint16 src, uint16 dst ) continue; ItemPrototype const* bagItemProto = bagItem->GetProto(); - if (!bagItemProto || !ItemCanGoIntoBag(bagItemProto, emotyProto)) + if (!bagItemProto || !ItemCanGoIntoBag(bagItemProto, emptyProto)) { // one from items not go to empty target bag SendEquipError( EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG, pSrcItem, pDstItem ); @@ -11559,6 +11562,38 @@ void Player::SwapItem( uint16 src, uint16 dst ) else if (IsEquipmentPos(src)) EquipItem(eDest2, pDstItem, true); + + // if player is moving bags and is looting an item inside this bag + // release the loot + if (GetLootGUID()) + { + bool released = false; + if (IsBagPos(src)) + { + Bag* bag = (Bag*)pSrcItem; + for(int i=0; i < bag->GetBagSize(); ++i) + if (Item *bagItem = bag->GetItemByPos(i)) + if (bagItem->m_lootGenerated) + { + m_session->DoLootRelease(GetLootGUID()); + released = true; // so we don't need to look at dstBag + break; + } + } + if (!released && IsBagPos(dst) && pDstItem) + { + Bag* bag = (Bag*)pDstItem; + for(int i=0; i < bag->GetBagSize(); ++i) + if (Item *bagItem = bag->GetItemByPos(i)) + if (bagItem->m_lootGenerated) + { + m_session->DoLootRelease(GetLootGUID()); + released = true; // not realy needed here + break; + } + } + } + AutoUnequipOffhandIfNeed(); } but (and this problem is very often inside mangos) player will lose his loot with this patch.. but player actually should just get all loot.. somebody knows how to force the looting?
  3. and how does the new method with wpe work now? i think something like this will be good: diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 5e88703..1ba65c3 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -10073,7 +10073,10 @@ uint8 Player::CanBankItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *p return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND; if (pItem->m_lootGenerated) - return EQUIP_ERR_ITEM_LOCKED; + { + GetSession()->DoLootRelease(GetLootGUID()); + return EQUIP_ERR_CANT_DO_RIGHT_NOW; + } uint32 count = pItem->GetCount(); @@ -11273,6 +11276,12 @@ void Player::SwapItem( uint16 src, uint16 dst ) if( !pSrcItem ) return; + if (pSrcItem->IsBag() && GetLootGUID()) + { + SendEquipError( EQUIP_ERR_CANT_DO_RIGHT_NOW, pSrcItem, pDstItem ); + return; + } + sLog.outDebug( "STORAGE: SwapItem bag = %u, slot = %u, item = %u", dstbag, dstslot, pSrcItem->GetEntry()); if(!isAlive() ) it won't fix the describe bug (is already fixed) but i think this is the way it works on retail.. but it will be good if someone can try to reproduce the guide leak posted above me to confirm this..
  4. hello, this doesn't happen through speedhacks i think.. it happens when a player for example charms a creature the creature get's deleted but players m_mover variable will still point to the "Unit*" which doesn't exist anymore.. my ideas for a solution were: 1. use Unit-guid instead of pointer (this will make the code slow and you have to do much rewritings) 2. store guid (safe but slow)/pointer(fast but might point to invalid memory later) to the charmed creature so at: plr->SetMover(unit); also add unit->SetMovementOwner(plr); and inside Unit::RemoveFromWorld() { add if(m_movementowner)m_movementowner->SetMover(NULL); ... also inside Unit::SetMovementOwner(Player* plr) { add if(m_movementowner)m_movementowner->SetMover(NULL); cause Unit gets now moved through another player so the current mover now can't move this creature around.. --- problem is that i myself haven't looked at the whole mover-stuff already.. and i also don't understand the problem fully.. what i've wrote here are just my thoughts about this.. it's possible that they are wrong or hacky.. but maybe also can give a hint to this problem.. edit: crash happens cause m_mover points to some random garbage and then we try: random_garbage->GetGUID() (just if this wasn't that clear from my post) random garbage happens cause the place where m_mover pointed at, got deleted somewhere else, but we haven't set m_mover to something valid after the deletion
  5. i think this is exactly what i did.. or? http://github.com/mangos/mangos/commit/5006c3892658cd1ba8afbb4d168434a542d08e73 sorry i added another patch right into the revert to avoid the spamming if bug was still present you can pm me the guide.. also i have another way for bugging (not duping) with items if you're interested in this field..
  6. balrok

    anti WPE

    ban them - and promise that you unban if they tell you the guide how to do it.. edit: btw pushing this thread without giving more information doesn't help.. i doubt someone wants to look at all opcodehandlers related to items.. and fix wild things without knowing how to reproduce..
  7. hello - i found out that openmp didn't work.. it just spawns as many threads as it wants.. and disabling it helped to make the server at least playable with around 1300 users (lag ~400-600) ace-mtmaps seems to produce some deadlocks or other errors - therefore i can't realy use it.. i will look soon if i can fix some of those.. cause the load gets realy nice divided between all cpu and for installing ace: you either can copy the ace-version over that in mangos.. or you install ace as system library and then configure mangos, that it uses your system-ace.. i've added an ace-version output at mangos-start - so you can check if all was succesful (cause i like the system-library method quite much - since compiling ace takes hours..) ps: i also hope to see some good mysql/mangos configs and/or a working ace-mtmaps patch
  8. balrok

    Death Bug

    cause this is a hack.. would be good if we can find out why the ghostflag isn't set.. btw: this patch works fine here.. don't know if any side-effects (like this arena-death-bug) are caused through this one
  9. balrok

    anti WPE

    would be nice if someone can give more information.. als per query it's ok (then i can post it in our internal forum) and i at least have seen this on our server too.. but i thought it's just some internal mangos error and added nice asserts - but with no effect ^^ i think an hotfix for this is no big work if we know the cause
  10. maybe this helps: diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index e3f2865..f7b9bb4 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -1417,12 +1417,28 @@ void WorldSession::HandleSetDungeonDifficultyOpcode( WorldPacket & recv_data ) if(Difficulty(mode) == _player->GetDungeonDifficulty()) return; - // cannot reset while in an instance - Map *map = _player->GetMap(); - if(map && map->IsDungeon()) + // cannot reset while in an instance - or groupmembers are inside instance + if(Group *pGroup = _player->GetGroup()) { - sLog.outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow()); - return; + for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) + { + + Map *map = itr->getSource()->GetMap(); + if (map && map->IsDungeon()) + { + sLog.outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow()); + return; + } + } + } + else + { + Map *map = _player->GetMap(); + if(map && map->IsDungeon()) + { + sLog.outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow()); + return; + } } if(_player->getLevel() < LEVELREQUIREMENT_HEROIC) @@ -1461,12 +1477,28 @@ void WorldSession::HandleSetRaidDifficultyOpcode( WorldPacket & recv_data ) if(Difficulty(mode) == _player->GetRaidDifficulty()) return; - // cannot reset while in an instance - Map *map = _player->GetMap(); - if(map && map->IsDungeon()) + // cannot reset while in an instance - or groupmembers are inside instance + if(Group *pGroup = _player->GetGroup()) { - sLog.outError("WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow()); - return; + for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) + { + + Map *map = itr->getSource()->GetMap(); + if (map && map->IsDungeon()) + { + sLog.outError("WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow()); + return; + } + } + } + else + { + Map *map = _player->GetMap(); + if(map && map->IsDungeon()) + { + sLog.outError("WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow()); + return; + } } if(_player->getLevel() < LEVELREQUIREMENT_HEROIC) and i haven't tested if this bug exist.. also i've never seen this error-message here..
  11. hello i currently run http://github.com/balrok/mangos/commits/322_server BUT mtmaps isn't working here.. there are insanely huge (constant) lags at 900 players. (~1000ms) and all mtmaps patches posted in this thread don't work.. they crash very often so i took my own mtmaps-solution (almost the same as posted in this thread but i removed playerupdate-multithreading and some locks) http://github.com/balrok/mangos/commit/039cf325b03adef046ee3c0f196a96e587a130a4 but this looks quite the same as the patch i used in 313.. so in 313 everything was running smooth so i compare them: with 313 i had this htop: http://balrok.ath.cx/htop.png with 322 this: http://balrok.ath.cx/htop2.png in 313 first thread was running 9.20, 2nd 4.11 and all other around 2.. so almost 1:2:4:4:4:4.. ratio.. with 322 first thread runs 5.19 2nd,3rd: 1.04 and all other 0.45 so around 1:5:5:6:6:6:6... ratio also with 322 i have the problem that i can't change the number of running threads through the config anymore and there is now an additional thread compared to 313-htop for me it looks a bit like openmp is gone crazy if you have any suggestions you are more than welcome.. as you might have seen last commits from me in mangos were all dedicated to performance but no luck yet
  12. hello - openmp crashed like hell here.. i added back the critical section at playerupdate - then it went fine again this is what we used: http://github.com/balrok/mangos/commit/e571922be2aeb58288b7ffcf3d82f47de6aec6d6 only problem it started to lag with around 800 players (there seems to be a change between 313 and 322 which has broken openmp performance) now i'm going to try ace - at a first glance it looked very good.. let's see how it behaves under high load but currently received one freeze after only 15minutes with ace - i'm trying now your recommended ace-version cause we still used the systems default
  13. 0 = var works? - or better question: what should this do? and why compiler should notice something there.. Player* player = 0; what are you doing there? and also for pointers using NULL is good codestyle.. in general i don't realy know what you want
  14. fixed now - sorry i just took the first part of the patch and copy/pasted it to all other places
  15. i added it now.. big thx for finding such formulas..
  16. remove the code which logs out those debug-text search for "CMSG_HEART_BEAT" in all files and you surely find a line slog.outDebug("CMSG_HEART_BEAT: blabla")
  17. thank you very much.. sounds like you're pretty sure (and yes, you are mad - but all mathematicians are mad anyway.. ^^) i will wait some days with implementing it this time.. so maybe other users have better ideas and so on for implementation: float K = (m_stats.rating<1000) ? 48.0f : 32.0f; and great that you've found this.. i don't have any idea how to get those formulas (:
  18. dasblub he breaks when user has more than 254 mails.. so seems like the bug is - if user has 255 mails it won't display anything.. but don't know.. some more information might be helpful.. also mangoscodestyle is: if (blabla) break; having everything on one line makes it easier to read.. edit: ah sorry now i understand your question.. not sure.. more information about this would be really useful
  19. thank you very much for this.. i just don't know how arena works now on offi that's why i repeated the typo ^^ edit: yesterday you had 1500 inside it, today 1000 and now triply told me 1500 is right.. i hope it's ok now.. else the next commit would be "fix the fixed typofix from last commit" ^^ edit2: "All arena teams that are below a 1500 arena rating will always earn arena points as a 1500 rated team." directly from wowwiki (while triply feared me that last commit realy was wrong^^) 1000 is used for new members, if arenateam has more than 1000 rating edit3: i think this change will be needed.. "if a player joins a team that has a team rating of 1000 or higher, the player’s personal rating will start off at 1000 instead of 0."
  20. thx applied both of your typofixes.. (+ hijacked your commit for my mangoscode-style stuff )
  21. patch for master is broken today i did some work for better setting map-pointer.. but there is a problem with spawning creatures and gameobjects.. maybe best thing is just using the bg-spawnsystem for those maps.. but this will need some more time just wanted to inform you that you don't need to report bugs about this
  22. i don't think anyone will write you the complete code.. why don't you just try it and ask questions here?
  23. so i pushed a commit for testing if RemoveWorldStates is needed.. if some bugs appear i will remove this change then..
  24. if getzoneid() causes crashes we also can replace it with "0" there.. it's just there to call ClearWorldStates funcion, which isn't needed at logout.. also we should look if this function (clearworldstates) is needed at all.. at least battlegrounds don't have this.. and afaik in mangos without outdoorpvp, the worldstates are already sent, but not cleared at zonechanges with such functions..
  25. sorry, now i pushed a better version.. i hope it fixes that bug..(at least it was good codecleanup) else i need some crashdumps :>
×
×
  • Create New...

Important Information

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. Privacy Policy Terms of Use