Commit graph

558 commits

Author SHA1 Message Date
VladimirMangos
3e0cacbdaf [11743] Fixed auction crash in case missing localization for only some items
Source crash in missing locale strings array size check before access
to it in locale structure.

Also move repeating code for access to wide used localization string arrays to ObjectMgr functions.
2011-07-19 02:34:16 +04:00
VladimirMangos
8e48e44c22 [11730] Move empty guid check into GetPlayerAccountIdByGUID code.
This cleanup small code and let catch some missing check cases
when 0 guid attempt searched by real DB query.

This also make function call more safe if it used with non-player guid by
some reason.
2011-07-10 05:57:37 +04:00
VladimirMangos
cc11366d6b [11702] Alsways attempt generate randomProperty for item in at create if value not pre-selected.
This resolve all existed cases when we miss assign random property id.

Also move random property/suffix check from item creating to server load time.
2011-06-30 19:19:02 +04:00
VladimirMangos
04a469f393 [11670] Implement in proper way ITEM_SPELLTRIGGER_ON_STORE (5)
Item spells with this trigger mode expected casted at item add
to inventory/equip slots (exclude bank), and spell auras (if any)
applied while item in like slots. Item expected destroyed at aura
remove by some reason.

Implementation note: because 2 step way item moves from slot to slot
related auras not removed at internal RemoveItem call and removed only
at directly item destroy/remove from player function calles, or at StoreItem
(if item added to not appropriate slot). So need in future careful with new
RemoveItem call cases.
2011-06-24 22:55:58 +04:00
cmaranec
2d7768a5ab [11646] Implement support item converting at expire
Example: items 44623->44625->44627 convertion chain

* New table `item_enchantment_template` store original->final item pairs
  Original item must have duration setup.
* Small change in GetItemConvert for consistence (now 0 returned if no convert pair instead original entry id)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2011-06-18 21:15:20 +04:00
VladimirMangos
02cbb905fa [11591] Apply spellLevel as reqlevel for non-prof. training spell only. 2011-06-03 12:28:01 +04:00
VladimirMangos
c870ef324d [11590] Cleanups for barGoLink
* Rename barGoLink -> BarGoLink as expected by mangos code style
* Add uint32/uint6 constructor versions for BarGoLink,
  and remove lot casts required before for BarGoLink use
2011-06-03 12:02:49 +04:00
VladimirMangos
108a167c46 [11587] Use SkillRaceClassInfo.dbc data for check spell training.
* Show race/class specific min level in trainer list (for weapon master for example)
  and use it for check spell traing possibility.
* Hide for specific race/class some spells marked by flag  ABILITY_SKILL_NONTRAINABLE
  This possible in cases when spell available for race/class but learned from talent/etc
  and then don't must be show for race/calss pair in trainer list. Single case in 3.3.5a.
* Add to code tables for profession ranks for seelct correct rank related reqlevel
  and check DB side data for it. Note: DB reqlevel values redundant for profession rank
  spells now.
* Use for reqlevel selection (if DB value not provided) learned spell insteed cast-spell
  spellLevel field. This let in more cases select training reqlevel without provided DB value.
  For LogFilter_DbStrictedCheck = 0 mode output data about like redundant reqlevel values
  in traner tables.
2011-06-02 09:55:25 +04:00
zergtmn
5cae1c2211 [11539] Implement group guids with HIGHGUID_GROUP 2011-05-25 19:55:35 +06:00
SilverIce
7d889c0821 [11527] Check rotation0 and rotation1 fields at gameobject data loading 2011-05-24 02:27:45 +03:00
VladimirMangos
719e298795 [11470] Final cleanup uint64 guid cases
Also drop logout player update fields cleanup that in any cases not saved.
2011-05-11 21:36:27 +04:00
zergtmn
6498941ead [11430] Introduce GuildMgr
Move all guild-related functions from our overpowered ObjectMgr to GuildMgr.
Thx leak for idea.
2011-05-06 19:27:36 +06:00
zergtmn
2835aa5f20 [11385] Add support for static vehicle spawns
Signed-off-by: zergtmn <zerg@myisp.com>
2011-04-20 23:23:47 +06:00
DasBlub
7b2308e483 [11372] Convert tabs to 4 spaces
Thanks to Darkknight900 for pointing out!

Used this script on sql/ and src/: find . -iname *.h -o -iname *.cpp -o -iname *.inc -o -iname *.sql | xargs sed -i 's/\t/    /g'
2011-04-17 01:34:51 +02:00
NoFantasy
187a1916e3 [11371] Drop not needed MAX_CONDITION define
Signed-off-by: NoFantasy <nofantasy@nf.no>
2011-04-16 23:41:23 +02:00
NoFantasy
b39877f24a [11370] Implement CONDITION_LEARNABLE_ABILITY, check by spell and optionally item
The primary use are intended for items that teach spell, typically for primary/secondary tradeskills.

Condition is true when player does not know the spell already, has the needed corresponding skill (and skill level) and does not have the item already (when item is defined).

Signed-off-by: NoFantasy <nofantasy@nf.no>
2011-04-16 23:26:15 +02:00
VladimirMangos
6c8efb4458 [11343] Check creature*_addon.auras duplicates at loading.
This already checked at apply to creature but startup check more helpful for DB devs.
Also remove use single field structure use for store addon.auras data
2011-04-13 15:27:14 +04:00
zergtmn
0ceb42ff9a [11315] Fix typos in recent commit 2011-04-05 12:42:43 +06:00
VladimirMangos
b92ebd994f [11310] Make .npc add/.gobject add commands work safe.
Reserve at server startup some guods follow last used in static DB spawns guid
for creatures/gameobjects for use in .npc add/.gobject add commands.
This allow safe select guids not used in all map copies. Guids for temporary spawns
used from range frollow after reserved guids range.

This also let select new static spawns guids (added in game chat command) near to already used static guids.
So it let avoid gaps in static guids lists.

Amount reserved guids set in new GuidReserveSize.* config options.
2011-04-03 21:22:58 +04:00
NoFantasy
f9fb902f86 [11302] Fix false error at LoadTrainerTemplates
Signed-off-by: NoFantasy <nofantasy@nf.no>
2011-04-01 09:09:12 +02:00
VladimirMangos
3c9f268b53 [11263] Revert "[11262] Revert "[11261] Check gaps in quest RewChoiceItem* data.""
This reverts commit 714d48a99e2ccc9404b34ebcfec50b2d8300fc46.

Additiona reserch show that no any know cases when data in RewChoiceItem* have gaps
except detected wrong data cases. So check good have in 3.x/2.x for better data intergrity checks.
2011-03-18 18:57:26 +03:00
VladimirMangos
24545a6162 [11262] Revert "[11261] Check gaps in quest RewChoiceItem* data."
This reverts commit a2d5f153c2d0256ad943a48442535730894e5d5e.

Only 1.x client have this problem.
2011-03-18 01:42:40 +03:00
VladimirMangos
5fce047e69 [11261] Check gaps in quest RewChoiceItem* data.
Client can crash if data not continues.

Thanks Chero and Joey for help in research problem ^^
2011-03-17 21:47:29 +03:00
Vinolentus
dee6d712c4 [11258] Typo in ObjectMgr::LoadItemConverts()
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2011-03-16 16:50:24 +03:00
VladimirMangos
5aeda4f28b [11223] Replace direct auras adding from creature*_addon tables by cast spell. 2011-03-06 12:49:17 +03:00
zergtmn
02c1bc6557 [11217] Drop effect indexes from *_addon.auras field 2011-03-05 01:50:49 +05:00
VladimirMangos
3b6b6078d1 [11191] Fixed crash introduced in prev. pool commit.
Propertly exclude pool_*_template spawns from static world state.
2011-02-20 12:56:23 +03:00
VladimirMangos
8feaf211f1 [11168] Use MapPersistentState for access to Pool System dynamic data.
* Direct store pool system dynamic data in sPoolMgr replaced by
  shared pool system data object (for all non instanceable maps)
  into WorldPersistentState, and own copies of pool system data
  object in DungeonPersistentState/BattlegroundPersistentState.
  This let have pools with object at many non-instanceable maps,
  and single map pools with unique state for each instance.

* Avoid direct global grid data modify from pool system, and use for this also
  recently added local for MapPersistentState grid spawn data.

* Implemented proper API for update pool system data in MapPersistentStates
  from GameEvent system.

* Initialize pool system state at MapPersistendState creating.
  For shared pool system state for non-instanceable maps initilized at first map state
  creating.

Now pool system propertly work in instance also!
2011-02-15 14:40:56 +03:00
oceanor
85a8a3eed9 [11157] Fixed typo in m_GameObjectFirstGuid init.
In result typo new summoned/spawned GO can get unexpected
non-free guids with strange results dependent from load
status of related static GO spawn (low chance conflict in fact).

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2011-02-13 20:45:08 +03:00
VladimirMangos
cf685da47a [11139] Use for Creature/GameObject local per-map guids
* Creature/GameObject guid generators moved to Map
* For avoid wrong not converted cases generic function in ObjectMgr has been replaced by
  specilized guid generation function like sObjectMgr.GeneratePlayerLowGuid().
  This let catch all cases that need update in custom code or scripts.
* Drop many ObjectAcessor.h now dead code. This is also make mangos more thread safe.
* Restore one more time unix build broken in prev. commits.

Note: many cases when something not wotk in instance but work in continents
possible magicly start work after this commit. For example, some gm commands.
From large systems that need more chnages for start work in full power in instances
can be referecned pool/gamevent system. Last need just small hacks drop changes but
in will addded in independent commit.
2011-02-12 09:52:16 +03:00
VladimirMangos
108feb993d [11127] Rename src/game/InstanceSaveMgr.* -> src/game/MapPersistentStateMgr.* 2011-02-10 05:35:07 +03:00
VladimirMangos
dde16bc48c [11126] Rewrite InstanceSaveMgr related code.
* For better fit name to related map type class InstanceMap renamed -> DungeonMap.
  This clarify usage Instanceable()/IsDungeon() because BG/Arenas maps also instanceable maps.

* InstanceSave have many code related to only DungeonMap case, so it replaced by 3 new classes:
   - MapPersistentState as base class, used for non-instanceable maps (continents and some other) (!Instenceable())
   - DungeonPersistentState subclass of MapPersistentState, used for DungeonMap states (IsDungoen())
   - BattlegroundPersistentState subclass of MapPersistentState, used for BattlegroundMap states (IsBattleGroundOrArena())

   Now all dungeon resets code moved to subclass and all player/gpoup bound functions/structures also use it.

* Map::GetInstanceSave renamed to Map::GetPersistentState and DungeonMap have specialized version
  return DungeonPersistentState (same pointer in fact with proper subcalss type)

* InstanceResetScheduler renamed to DungeonResetScheduler
2011-02-10 05:20:56 +03:00
VladimirMangos
01178b69e5 [11124] Avoid save in DB instance/respawn data for BGs/Arenas.
* Fixed bug with not unloaded InstanceSave for BGs/ArenasPartly.
  This bug introduced with recent InstanceSave creating for all maps.
* Avoid save respawn data to DB for BGs/Arenas.
  No reason save to DB because BGs/Arenas reset at map unload.
* Always create InstanceSave for Map without recheck suggested data integrity.
  Map::GetInstanceSave expected always return != NULL value.
2011-02-09 18:34:29 +03:00
VladimirMangos
6cfa64db97 [11123] Move respawn data to InstanceSave.
This make prev commit more useful.
In future InstanceSave also planned store local pools state.
2011-02-09 06:09:32 +03:00
VladimirMangos
ad29153ee0 [11118] Not report empty world_template as error. 2011-02-08 04:40:16 +03:00
VladimirMangos
f73868a703 [11117] Allow for non-instancable maps have InstanceData and instance scripts.
* New table added for non-instanced maps (except BG/arena):
    - `mangos`.`world_template` (script mapping to non instanced data)
    - `characters`.`world` (saved script data string storage)

* InstancedData created for any map types including BGs/arenas, that allow have scripts
  state for any maps, but BG/arena instance data not saved.

Note: Possible structures will renamed later for clarify apply to any type maps,
but avoid for now for simplify changes and hard affect to script library sources.
2011-02-08 04:15:13 +03:00
VladimirMangos
2fd536fe43 [11077] Game event fixes and condition improvments.
* At game events table loading checked not only allowed event ids range but also event existance.
* Renamed CONDITION_ACTIVE_EVENT -> CONDITION_ACTIVE_GAME_EVENT
* Implemented new conditions:
   - CONDITION_NOT_ACTIVE_GAME_EVENT
   - CONDITION_ACTIVE_HOLIDAY
   - CONDITION_NOT_ACTIVE_HOLIDAY

Recomended use holiday version where possible as more portable.
2011-01-28 23:48:52 +03:00
Schmoozerd
21cc7cd179 [11067] DB error text for creaure difficulty checks misleading.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2011-01-25 00:27:28 +03:00
Skirnir
75b4f75f4d [11066] Remove tail whitespaces.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2011-01-25 00:22:29 +03:00
Ambal
07c9f0cbb8 [11054] Do not allow async transaction execution while server is loading. Call Database::InitDelayThread() function explicitly to create async DB worker thread after server initialization is complete.
Signed-off-by: Ambal <pogrebniak@gala.net>
2011-01-20 23:46:51 +02:00
Ambal
2890e0f45a [11047] Execute transactions in ObjectMgr::PackGroupIds() synchronously on server startup
Signed-off-by: Ambal <pogrebniak@gala.net>
2011-01-19 22:56:36 +02:00
Ambal
631ce36680 [11045] Rewrite internals of DB layer. Simplify code and use less locking. Spawn and use separate connections for sync and async DB requests. Implement database connection pool for SELECT queries. Up to maximum 16 connections supported. Disable 'autocommit' mode for MySQL.
UPDATE YOUR CONFIGS!

Defaults:
LoginDatabaseConnections = 1
WorldDatabaseConnections = 1
CharacterDatabaseConnections = 1

If you are not using <mtmaps> patch do not change the default settings - this is useless. You can try following option in your MySQL config to squeeze even more performance from your DB:

[mysqld]
transaction-isolation = READ-COMMITTED

Great thanks to Undergarun, kero99 and selector for making tests and providing very useful feedback and DB statistics! Have fun :)

Signed-off-by: Ambal <pogrebniak@gala.net>
2011-01-19 22:05:20 +02:00
Schmoozerd
54cb8f1a63 [11032] Implement CREATURE_FLAG_EXTRA_AGGRO_ZONE.
This let control zone wide aggro in DB data instead
need special script code.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2011-01-18 13:48:46 +03:00
VladimirMangos
fda171d6bd [10961] Avoid use scripting support wrappers for internal server code. 2011-01-04 22:48:04 +03:00
VladimirMangos
a0e298179c [10952] Don't use singleton to access static functions. 2011-01-03 14:55:55 +03:00
VladimirMangos
bf0ecf6e71 [10947] Update copyright notice for 2011 year. 2011-01-01 20:33:43 +03:00
VladimirMangos
7a2478ff4f [10942] Implement .reload npc_text. 2010-12-30 23:41:54 +03:00
VladimirMangos
16768da053 [10941] More strict check player race/class allowed values. 2010-12-30 06:53:06 +03:00
zergtmn
0d6f990e4e [10912] Move scripting related functions from ObjectMgr to ScriptMgr 2010-12-24 00:23:37 +05:00
zergtmn
f61166c2bf [10911] Fix GCC warning 2010-12-23 23:31:31 +05:00