Commit Graph

101 Commits

Author SHA1 Message Date
Anubisss
d9cb070215 Implement QueryResult_AutoPtr type which is ACE's reference counted auto_ptr(ACE_Refcounted_Auto_Ptr) for QueryResult pointers.
Use this auto_ptr for every DB queries(except QueryNamedResult yet).

This patch guarantees NO memory leaks from QueryResult pointers.

Thanks to raczman for the idea and for the helping to make this patch.

--HG--
branch : trunk
2010-01-23 14:45:58 +01:00
Rat
0cc053ea4d *Integrate Script system to Core
-added ScriptMgr for loading scripts
-removed bindings
-moved script system to src/game
-moved scripts to src/scripts
-VC project files updated
-cmakes updated (not 100% done yet)

NOTE to Devs:
-file locations changed
-precompiled renamed to ScriptedPch
-ecsort_ai renamed to ScriptedEscortAI
-follower_ai renamed to ScriptedFollowerAI
-guard_ai renamed to ScriptedGuardAI
-simple_ai renamed to ScriptedSimpleAI
-sc_creature renamed to ScriptedCreature
-sc_gossip renamed to ScriptedGossip
-sc_instance  renamed to ScriptedInstance

*use the new headers in scripts, thank you

NOTE to ALL:
cmake not fully tested, please report any errors with it
could make creashes, incompability
USE AT YOUR OWN RISK before further tests!!

--HG--
branch : trunk
2010-01-19 11:36:05 +01:00
n0n4m3
99f66a6bc9 Updated copyright for new year.
--HG--
branch : trunk
2010-01-16 20:19:18 +03:00
Rat
5b6079ea67 *cleaned up SharedDefines
--HG--
branch : trunk
2010-01-10 16:27:47 +01:00
QAston
8e9d2cdf01 Update aura system:
* Change system logic - unify Auras, AreaAuras and PersistentAreaAuras:
  * Aura has now its owner - which is the WorldObject, which applies aura (creates AuraApplication object) dependant on aura radius, and effect type
  * Owner can be Dynobj (DynObjAura class) for PersistentAreaAuras, or Unit (UnitAura class) for Area and nonArea auras
  * Aura data is shared for all units which have AuraApplication of the Aura
   * Because of that AuraEffect handlers , and periodic tick functions can't modify AuraEffect object (they are const now)
  * Remove spell source and AreaAuraEffect classes
  * Add AuraEffect::UpdatePeriodic function, to allow periodic aura object modification (target independant)
  * Add AuraEffect::CalculateAmount and AuraEffect::CalculateSpellMod function, to allow non-default amount calculation
  * AreaAura updates are done in owner _UpdateSpells cycle
  * Since now you don't need to wait an aura update cycle to get area aura applied on it's correct target list
  * And you can access area aura target list
  * Add basic support for aura amount recalculation
  * Save recalculation state and base amount of auras to db
  * Add AuraEffect::CalculatePeriodic function to determine if aura is periodic, and to set correct tick number after aura is loaded from db
  * Add ChangeAmount function in addition to SetAmount function, to allow easy reapplication of AuraEffect handlers on all targets
  * Sort aura effect handlers in SpellAuras.cpp and .h by their use
  * Add check for already existing aura of that type to some AuraEffect handlers, to prevent incorrect effect removal
  * SPELL_AURA_CONVERT_RUNE and MOD_POWER_REGEN and MOD_REGEN hacky handlers are now implemented correctly
  * Send aura application client update only once per unit update - prevent unnecesary packet spam
 * Fix ByteBuffer::appendPackGUID function - it added additionall 0s at the end of the packet
 * Fix memory leak at player creation (not deleted auras)
 * Updated some naming conventions (too many to mention)
 * Added Unit::GetAuraOfRankedSpell() function
 * Remove procflags on aura remove, use Aura::HandleAuraSpecificMods instead
 * Added functions to maintain owned auras (GetOwnedAuras, GetOwnedAura, RemoveOwnedAura, etc)
 * Implement AURA_INTERRUPT_FLAG_LANDING
 * Implement EffectPlayerNotification (thanks to Spp)
 * Remove wrong aura 304 handler
 * Add better handler for death runes
 * Remove unnecesary variables from DynamicObject class, and cleanup related code, link dynobj duration with aura
 * Add GetAuraEffectTriggerTarget function in CreatureAi for special target selection for periodic trigger auras used in a script
 * Add many assert() procection from idiots using some functions in wrong way
 * I am to lazy to write here anything more
Thanks to Visagalis for testing this patch
PS: Do not make patches like this, please

--HG--
branch : trunk
2010-01-10 01:23:15 +01:00
Anubisss
df88de1f2a Fix 3 memory leakz.
--HG--
branch : trunk
2009-12-29 16:02:40 +01:00
n0n4m3
250a00cc1c Temporary revert 6743 commit. I fix this patch across 1-2 days.
--HG--
branch : trunk
2009-12-24 10:20:15 +01:00
n0n4m3
3fe0bc5254 Replaced time(NULL) on sGameTime.GetGameTime() this is used for better performance.
Original Timer.h divided into 2 parts. Shared project has no need to know about GameTime Singleton.
2 Identical structures with different types are now replaced with one generic templated structure and 2 typedefs.

--HG--
branch : trunk
2009-12-23 08:04:10 +01:00
n0n4m3
a7c0f6beb3 Update CharacterHandler, Channels System for 322a
--HG--
branch : trunk
2009-12-17 10:49:15 +01:00
Kudlaty
379cbb72af Mangos merge: [8874] Extract player skills from data blob. #526
Converted by Azazel.

--HG--
branch : trunk
2009-12-14 20:47:43 +01:00
maximius
3f338cc1c3 *Massive cleanup redux.
--HG--
branch : trunk
2009-10-17 16:20:24 -07:00
maximius
e585187b24 *Backed out changeset 3be01fb200a5
--HG--
branch : trunk
2009-10-17 15:51:44 -07:00
maximius
26b5e033ff *Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget

--HG--
branch : trunk
2009-10-17 15:35:07 -07:00
maximius
906b00465a *add 11 new event hooks to the OnEvents system, by Hawthorne
--HG--
branch : trunk
2009-09-23 20:19:21 -07:00
maximius
333f1c9d72 *[8475] fixed some gcc-warnings Author: balrok
*[8476] Revert some recent cleanup changes, some other fixes and cleanups. Author: VladimirMangos
*[8489] Fixed player visibility update in case view point different from player itself. Author: SilverIce
*[8493] Avoid unexpected multiply error messages at wrong `quest_template`.`RewSpell*` Author: VladimirMangos
*[8496] Resolve some #include cycles and unsafe code.
* Common.h -> Threading.h -> Errors.h -> Common.h
* Remove reduncdent #include "ByteBuffer.h" in headers
* Remove redundent #include "Auth/BigNumber.h" in headers
* Avoid multyply data copy at use some now dropped functions in BigNumber.
* Avoid copy fixed byte count from byte arrays with unknown real size created from BigNumber.
* Avoid possible problems for build mangos at different platform or compilers. Author: VladimirMangos.
*[8501] Apply code style and cleanups to some Player functions. Author: VladimirMangos.
*[8502] Disable quests related to specific game events at startup if event not active. Also rename member boolean variable. Author: NoFantasy
*[8506] Add check for IsAutoComplete() in SendPreparedQuest().
For cases where quest is repeatable but has Method!=0, QuestDetails must be sent instead of RequestItems.
Some additional code cleanup. Author: NoFantasy
*[8507] Check amount of spawned pools before decrement to avoid unexpected result. Also rename variable to more meaningful name. Signed-off-by: NoFantasy <nofantasy@nf.no>

Thanks to Stryker and onkelz28!

--HG--
branch : trunk
2009-09-18 14:10:37 -07:00
maximius
eef5abe6e1 *Event Hooks (OnLogin, OnLogout, OnPVPKill) by Hawthorne
*Boss Emote Command for DB Scripts by XTElite1

--HG--
branch : trunk
2009-09-13 00:01:35 -07:00
megamage
790c5348a3 [8445] Fixed redundant calculation of v and s on every login Author: arrai
The SRP-6 specifications clearly say, that v and s are only to be
    calculated on registering a user and changing his password; calculating
    them on every login is plain waste.

--HG--
branch : trunk
2009-09-02 16:22:32 -05:00
megamage
dc68c2b269 [8433] Implement proper store and use character specific account data.
* Base at TOM_RUS reseach save/load character specific account data in new table `character_account_data`
    * Move its in sql update from `account_data` to new table.
    * For client packets that can be send in loggined state or just after logout but assocualted
      with recently logout character add new login status STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT
    * Store low guid for loggedin player or recently logout into WorldSession.

Author: VladimirMangos, TOM_RUS

--HG--
branch : trunk
2009-09-01 16:47:49 -05:00
Machiavelli
e71f5e474e * Add debug message for HandleCharCreateOpcode in the hope to pinpoint bug that prohibits character creation for no apparent reason.
--HG--
branch : trunk
2009-08-24 02:41:01 +02:00
megamage
e954904e6d [8378] Use exceptions instead of explicit size checking for each packet Author: arrai
CHECK_PACKET_SIZE was pretty error prone; once it was forgotten mangosd
    could crash due to the asserts in ByteBuffer.h. That was exploitable by
    malicious players.
    Furthermore, there were duplicate checks: Additionally to
    CHECK_PACKET_SIZE, the ByteBuffer assertions keept an eye
    on not exceeding the packet boundaries - just to crash the server for
    sure in such a case.
    To prevent memory leaks or other undesirable states, please read in
    every handler all variables _before_ doing any concrete handling.

--HG--
branch : trunk
2009-08-19 16:26:22 -05:00
megamage
7ca0f5b721 *Fix the crash caused by client customize log.
--HG--
branch : trunk
2009-08-16 16:32:11 -05:00
maximius
2fd68eab44 *Add Dual Spec support, original by EnderGT, thanks to Thyros and XTElite1 for helping me test :)
--HG--
branch : trunk
2009-08-14 17:24:52 -07:00
megamage
6890d8aedb *Log old name for customize request
--HG--
branch : trunk
2009-08-14 18:55:35 -05:00
megamage
4f4775a31b [8339] Improved storing/restoring BG entry point
* Introduced new table character_battleground_data
    * Entry point is now stored on BG enter event not join event
    * Entry point for dungeons is now correctly set to nearest graveyard
      (this prevent well known assert in GetInstance because of porting to already destroyed instance)
    * Teleporting from BG correctly restore mount state
    * Teleporting from BG correctly restore taxi flight
      (in multipath flight you will end up in nearest transition point on the route)

    Signed-off-by: ApoC <apoc@nymfe.net>

--HG--
branch : trunk
2009-08-12 20:27:00 -05:00
QAston
bee1dff87f *Use #defines instead of spellids for often used spells.
*Make recently broken talent Improved Healthstone work again - by iadus3.

--HG--
branch : trunk
2009-08-12 18:51:19 +02:00
megamage
47e36000cb [8304] Move standup code to login, remove other not needed data change at save. Author: VladimirMangos
Now players saved as-is without any modifications.

--HG--
branch : trunk
2009-08-05 16:03:33 -05:00
megamage
793ec8c97d [8286] Correctly show talent points after talents reset at login by "at login" flag. Author: redcore
--HG--
branch : trunk
2009-08-02 10:11:48 +08:00
QAston
1d96091d2a *Improvements in map managing.
--HG--
branch : trunk
2009-08-01 00:20:32 +02:00
megamage
0fcadd9d25 *Replace "LoginDatabase" with "loginDatabase"
--HG--
branch : trunk
2009-07-31 11:29:28 +08:00
megamage
6976043e22 [8126] Improvemets in player/pet/charter name checks. Author: VladimirMangos
* Implement new config options for minimal player/pet/charter name length (2 by default)
    * Better error reporting at problems in names.
    * Add check from max pet/charter name length (same as for player names at client side)

--HG--
branch : trunk
2009-07-10 08:25:33 +08:00
megamage
e1d93bd00f *Backup your DB!
[8098] Support uint32 spell ids in code. Author: VladimirMangos

    * Propertly work with uint32 spell ids in player action bar
    * Fix in same time bug with not save equipment set button with id==0
    * Merge misc field in character_action and playercreateinfo_action to action field as 3 byte
    * Propertly load uint32 spell ids from character_spell
    * Fixed types for some pet/creature related structure for spell id storing.

--HG--
branch : trunk
2009-07-01 18:07:20 -05:00
megamage
d9ec2d2196 [8072] First step to get rid of data blob.
Adds new fields gender, level, xp, money, playerBytes, playerBytes2 and playerFlags to characters table.

    The update will not work if your database contains characters with an old data field (not fitting to the actual client version).

    It's recommended to backup your character database before applying this patch.

--HG--
branch : trunk
2009-06-27 17:39:51 -05:00
QAston
ad91c6b1e2 [8052] Fixed typo in error log output. Author: The_Game_Master
[8049] Added energize effect after last heal tick for 33763 and ranks. Author: bobaz
[8053] At character talents reset using chat command also reset talents
for all character pets. Author: VladimirMangos

--HG--
branch : trunk
2009-06-23 13:05:15 +02:00
megamage
572a9191d9 *Some creature display id update. By VladimirMangos and GriffonHeart
--HG--
branch : trunk
2009-06-15 18:02:12 -05:00
megamage
9d670fe6f5 *Switch to support client version 3.1.3
*I strongly recommend you not to use this until you get the 313 db. Now all destructible buildings cause client crash.

Source: Mangos
Thanks to TOM_RUS for most work to make this switch possible ;)

--HG--
branch : trunk
2009-06-11 00:45:59 -05:00
megamage
ebfb4c0558 [7971] Implement support exotic pets limtations related to hunter telent 53270. Author: VladimirMangos
Note: before this commit hunters can tame exotic pets like any other.
          After patch like not propertly contriolled pets will auto-dismiss at loading
          if talent not learned.

--HG--
branch : trunk
2009-06-06 20:31:23 -05:00
panaut0lordv
f6447e8f34 *Including style fixing - part 1
--HG--
branch : trunk
2009-06-04 21:41:07 +02:00
megamage
f92e8315cf [7918] Improve portability in work with uint64 string format specifiers and in code literals. Author: VladimirMangos
* Replace platform seelction MaNGOS code for select format descriptor for uint64 by using ACE define.
      I64FMTD renamed to UI64FMTD for more clear name.
    * Add new define UI64LIT (base at ACE seelction) for build portables uint64 literals.
      Please always use UI64LIT(0x00001) instead less portable 0x00001LL

--HG--
branch : trunk
2009-05-31 16:15:12 -05:00
megamage
5ed5513ca8 Mangos [7911]. Author: tomrus88
Very big patch. May cause bugs.

--HG--
branch : trunk
2009-05-31 15:56:51 -05:00
megamage
ce0feb36ea [7841] Fixed: Prevent loading maps/vmaps when building enum. Author: SilverIce
--HG--
branch : trunk
2009-05-17 18:41:16 -05:00
megamage
e4456ae9f8 *Fix an exploit that instance can be reset when there are logged-out players in it.
--HG--
branch : trunk
2009-05-16 14:52:41 -05:00
megamage
9831dab114 [7822] Avoid declined names form show in case disabled config option with russian client at non-russian realm. Author: Foks
--HG--
branch : trunk
2009-05-14 11:59:15 -05:00
megamage
f5bae4d5ae *Init player motionmaster after field value are initialized.
--HG--
branch : trunk
2009-05-09 10:48:55 -05:00
megamage
7277ddd114 [7797] Use DBC data for mount model selection in more cases. Author: VladimirMangos
* Use alt.team mount data for take player team model id if DB not provide own team creature id in spell taxi call case.
    * Remove unddeded hacks for model ids from Spell::EffectSendTaxi
    * Provide spell target for SPELL_EFFECT_SEND_TAXI for spell with target mode 0 for this effect.

--HG--
branch : trunk
2009-05-08 18:49:07 -05:00
megamage
de11b9e901 [7730] Some optimizantion and code style. Author: zhenya
--HG--
branch : trunk
2009-04-29 00:26:07 -05:00
megamage
3120221deb *Note: this patch may do not have any use for TC.
[7645] Fixed problems wit temporary unsummoned pets and cleanup code. Author: VladimirMangos

    * Save temporary unsummoned pet to current slot (instead non_in_slot mode) and
      prevent save as current pet summoned while temporay unsummon (arena)
    * Prevent overwrite temporary summoned pet data
    * At player loading set temporary unsummoned pet data instead pet loading
      if pet expected to be temporary unsummoned in current player state (loading in taxi flight/etc)
    * Restore proper pet at arena leave and unsummon in arena summoned.

--HG--
branch : trunk
2009-04-11 14:47:38 -05:00
megamage
4d277430c5 [7644] Fixed pet slot values using in pet save. Author: VladimirMangos
Problem exist from client version switch when stable slot amount changed.
    In result this has been source problems with stable use (3-4 slots) and possible pet lost in some cases
    or "not save state" for summoned pets.
    Use enums to avoid repeating problem, use more safe value for not-in-slot save (for summoned pets)
    Fixed data preparing for MSG_LIST_STABLED_PETS.

--HG--
branch : trunk
2009-04-10 18:18:44 -05:00
megamage
5acc0c057b [7612] Move SMSG_TRIGGER_CINEMATIC and SMSG_TRIGGER_MOVIE to functions and use its instead explicit packet creating. Author: NoFantasy
--HG--
branch : trunk
2009-04-05 16:25:00 -05:00
QAston
20c02ef760 *Update of aura system.
--HG--
branch : trunk
2009-04-06 13:31:14 +02:00
megamage
68c3039715 *Move most reputation/force faction reaction code to new ReputationMgr. Author: VladimirMangos
--HG--
branch : trunk
2009-03-26 13:53:32 -06:00