Commit graph

546 commits

Author SHA1 Message Date
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
zergtmn
a1e0111638 [10909] Code style cleanups in scripting related functions 2010-12-23 19:01:30 +05:00
VladimirMangos
4a7638c80e [10905] Fixed vendor templates work.
* Avoid unexpected errors at template loading for shared templates for many npc.
* Really use vendor template in work.
2010-12-21 19:39:43 +03:00
VladimirMangos
1d84a8de1d [10897] Small typos in error message. 2010-12-20 23:03:13 +03:00
VladimirMangos
add4ceb999 [10896] Detect self-referenced model info in creature_model_info. 2010-12-20 20:33:31 +03:00
Warlord123
3e1c04fc6e [10893] Speedup check code at gossip_menu_option loading.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-12-19 21:54:00 +03:00
NoFantasy
f59edc66ad [10882] No error output for empty npc_trainer* tables
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-12-17 12:28:37 +01:00
VladimirMangos
1d8f222621 [10867] Implement templates for trainer spell data in npc_trainer_template.
New table let avoid duplication similar trainer spells for different trainers.
2010-12-13 16:39:53 +03:00
Quriq14
c7205a6837 [10862] Fixed not show and lost mail items in returned expire mails.
Also
* Use typename for mail item info vector.
* Include tools/characters_mail_items_cleanup.sql for cleanup lost mail items.
  It also included as sql update part. Sql update also fix receiver for stored
  in DB expired mail items.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-12-12 09:10:08 +03:00
VladimirMangos
80712b928a [10825] Move specific SQLStorage defines to game dir
This let have in shared dir only generic declarations of class SQLStorage
Not game specific details.
2010-12-05 03:29:11 +03:00
VladimirMangos
938622bedc [10802] Use ObjectGuid in Mail code.
Some catched bugs fixed in mixed uint32/guid values using cases.
2010-12-01 15:11:08 +03:00
NoFantasy
afe50cd549 [10797] Check for valid sheath state in creature addon at startup.
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-11-30 09:42:51 +01:00
VladimirMangos
abc6dfca98 [10792] Fixed warnings and need in redundent char* casts in database access code. 2010-11-29 00:47:11 +03:00