Jump to content

therapist

Members
  • Posts

    16
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by therapist

  1. Really good job with this m8 Looks fine to me just looked over the code
  2. Tested Works good I like the better idea on a way to load it
  3. Hello on my server Mining skinning is bugged etc They carn't get past 350 or 310 on some Rates SkillGain.Crafting = 15 SkillGain.Defense = 15 SkillGain.Gathering = 15 SkillGain.Weapon = 15 SkillChance.Orange = 300 SkillChance.Yellow = 95 SkillChance.Green = 45 SkillChance.Grey = 0
  4. Wat does this Patch do Adds Multi threaded support to Acution house diff --git a/src/game/AuctionHouseMgr.cpp b/src/game/AuctionHouseMgr.cpp index ed8a059..95a94b6 100644 --- a/src/game/AuctionHouseMgr.cpp +++ b/src/game/AuctionHouseMgr.cpp @@ -35,6 +35,11 @@ #include "Policies/SingletonImp.h" +#ifdef WIN32 +#include "ServiceWin32.h" +extern int m_ServiceStatus; +#endif + INSTANTIATE_SINGLETON_1( AuctionHouseMgr ); AuctionHouseMgr::AuctionHouseMgr() @@ -47,6 +52,40 @@ AuctionHouseMgr::~AuctionHouseMgr() delete itr->second; } +void AuctionHouseMgr::run() +{ + ACE_DEBUG + ((LM_DEBUG, ACE_TEXT ("(%t) Handler Thread running\\n"))); + + runUpdate = false; + initLoading = false; + + LoadAuctionItems(); + LoadAuctions(); + + initLoading = true; + + while (!World::IsStopped()) + { + if (runUpdate) + { + Update(); + runUpdate = false; + } + + #ifdef WIN32 + ACE_Based::Thread::Sleep(50); + #else + ACE_Based::Thread::Sleep(100); + #endif + + #ifdef WIN32 + if (m_ServiceStatus == 0) World::StopNow(SHUTDOWN_EXIT_CODE); + while (m_ServiceStatus == 2) Sleep(1000); + #endif + } +} + AuctionHouseObject * AuctionHouseMgr::GetAuctionsMap( uint32 factionTemplateId ) { if(sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) @@ -278,6 +317,8 @@ void AuctionHouseMgr::SendAuctionExpiredMail( AuctionEntry * auction ) + void AuctionHouseMgr::Update() +{ + mHordeAuctions.Update(); + mAllianceAuctions.Update(); + mNeutralAuctions.Update(); + + if((++loopcount % 100)) + return; + + vector<AuctionHouse*>::iterator itr = auctionHouses.begin(); + for(; itr != auctionHouses.end(); ++itr) + { + (*itr)->UpdateDeletionQueue(); + + // Actual auction loop is on a seperate timer. + if(!(loopcount % 1200)) + (*itr)->UpdateAuctions(); + } +} void AuctionHouseMgr::LoadAuctionItems() { + ACE_DEBUG + ((LM_DEBUG, ACE_TEXT ("(%t) LoadAuctionItems Thread running\\n"))); // data needs to be at first place for Item::LoadFromDB QueryResult *result = CharacterDatabase.Query( "SELECT data,itemguid,item_template FROM auctionhouse JOIN item_instance ON itemguid = guid" ); @@ -331,6 +372,8 @@ void AuctionHouseMgr::LoadAuctionItems() void AuctionHouseMgr::LoadAuctions() { + ACE_DEBUG + ((LM_DEBUG, ACE_TEXT ("(%t) LoadAuctions Thread running\\n"))); QueryResult *result = CharacterDatabase.Query("SELECT COUNT(*) FROM auctionhouse"); if( !result ) { diff --git a/src/game/AuctionHouseMgr.h b/src/game/AuctionHouseMgr.h index 2775838..164f637 100644 --- a/src/game/AuctionHouseMgr.h +++ b/src/game/AuctionHouseMgr.h @@ -114,7 +114,7 @@ class AuctionHouseObject AuctionEntryMap AuctionsMap; }; -class AuctionHouseMgr +class AuctionHouseMgr : public ACE_Based::Runnable { public: AuctionHouseMgr(); @@ -152,7 +152,12 @@ class AuctionHouseMgr +~AuctionHouseMgr() +{ +vector<AuctionHouseMgr*>::iterator itr = auctionHouses.begin(); +for(; itr != auctionHouses.end(); ++itr) + delete (*itr); +} void Update(); + bool runUpdate; + bool initLoading; + private: + void run(); + Mutex lock; + uint32 loopcount; + AuctionHouseObject mHordeAuctions; AuctionHouseObject mAllianceAuctions; AuctionHouseObject mNeutralAuctions; +#define sAuctionHouseMgr AuctionHouseMgr::getSingleton() +#endif diff --git a/src/game/World.cpp b/src/game/World.cpp index bf20ccf..7bf2501 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -1309,8 +1309,13 @@ void World::SetInitialWorldSettings() ///- Load dynamic data tables from the database sLog.outString( "Loading Auctions..." ); sLog.outString(); - auctionmgr.LoadAuctionItems(); - auctionmgr.LoadAuctions(); + ACE_DEBUG + ((LM_DEBUG, ACE_TEXT ("(%t) Main Thread running\\n"))); + ACE_Based::Thread t(*new AuctionHouseMgr); + while(auctionmgr.initLoading == false) + ACE_Based::Thread::Sleep(100); + //auctionmgr.LoadAuctionItems(); + //auctionmgr.LoadAuctions(); sLog.outString( ">>> Auctions loaded" ); sLog.outString(); @@ -1529,7 +1534,8 @@ void World::Update(uint32 diff) } ///- Handle expired auctions - auctionmgr.Update(); + auctionmgr.runUpdate = true; + //auctionmgr.Update(); } /// [*] Handle session updates when the timer has passed My c++ ain't that good but i have tested this works fine so far if people cud post fixes for this that would be great
  5. Good job tested carn't see any major issues with this
  6. M8 put this is under review this should be applied i put it on standard settings and the server works perfectly no crashes with this on
  7. This is not bad. They just don't want to go subbmiting every patch people do as people need to test it first otherwise there will be quite a lot of stablilty issues
  8. i tried it works fine I am useing centos 5.3 i retried it and it works fine now
  9. root@server1 [~/mangos]# autoreconf --install --force Putting files in AC_CONFIG_AUX_DIR, `aux_config'. configure.ac: installing `aux_config/install-sh' configure.ac: installing `aux_config/missing' ace/Makefile.am: installing `aux_config/compile' ace/Makefile.am: installing `aux_config/depcomp' Putting files in AC_CONFIG_AUX_DIR, `..'. configure.ac: installing `./install-sh' configure.ac: installing `./missing' dep/src/g3dlite/Makefile.am: installing `./depcomp' configure.ac:70: installing `./config.guess' configure.ac:70: installing `./config.sub' Makefile.am: installing `./INSTALL' configure.ac:70: required file `./ltmain.sh' not found autoreconf: automake failed with exit status: 1 Any idea is that failed or can it sitll build
  10. Rev 8342 DB YTDB 506 Script2dev 1380 Patches Grid speed up Branch 320 Hello when players log into my server they get unknown area 5 mins later server crash Deleting expired bans... Calculate next daily quest reset time... Starting objects Pooling system... Starting Game Event system... GameEvent 5 "Darkmoon Faire (Mulgore)" started. GameEvent 16 "Gurubashi Arena Booty Run" started. GameEvent 21 "Call to Arms: Eye of the Storm!" started. GameEvent 38 "Edge of Madness, Wushoolay" started. WORLD: World initialized PLAYER: Player 4385 discovered unknown area (x: -2557.479980 y: -2293.870117 map: 1 PLAYER: Player 4110 discovered unknown area (x: -10620.900391 y: -2942.840088 map: 0 And says segmenation error i am running linux Bascailly it did work and then it messed up any idea i really need help asap by the way everything worked fine i recompiled and this started but i recompiled quite a lot and recheckedout and no look maybe somebody ca help
  11. Hello Everyone Know Catasylm the new patch Well here is some things i have found out from leak of the alpha client. they have totally changed login packets they have messed with matrix login is this true Wat about fishing zones and stuff this is gonna be a big job
  12. Latest rev Branch Master My server keeps getting major lag spikes cpu goes to 25% and then freezes happens a lot with 80 on
×
×
  • 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