Commit graph

62 commits

Author SHA1 Message Date
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
852c4ddf32 [11122] Create InstanceSave for non-instanceable maps.
This preparation for use structure for store another map persistance data like respawn times.
2011-02-09 04:00:14 +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
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
f2a8606b93 [11046] Optimize and make more safe some transactions in InstanceSaveMgr.
Signed-off-by: Ambal <pogrebniak@gala.net>
2011-01-19 22:25:24 +02:00
VladimirMangos
bf0ecf6e71 [10947] Update copyright notice for 2011 year. 2011-01-01 20:33:43 +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
Ambal
f67d89f109 [10727] Map system re-engineered. Special thanks to Blueboy for tests.
Signed-off-by: Ambal <pogrebniak@gala.net>
2010-11-16 21:08:28 +02:00
blueboy
ee8cc71e38 [10692] Fixed wrongly use %d for guids in DB queries.
This can affect correct result in cases big guid values
(out of range for possitive part of int32 range) at x86 platforms.

Some other cases addded in addition to original patch fixes
where %d wrongly/unsafe used for unsigned values.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-11-07 22:10:37 +03:00
Funkybit
dcb451e16a [10549] At schedule second reset update real reset time.
Missing part of prev. related commit.

Also without this code at second reset after restart server will go to infinity loop.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-09-26 23:58:44 +04:00
Funkybit
b531bcfee1 [10534] Fixed second and later resets schedule for raid/heroic after server restart.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-09-25 14:39:08 +04:00
zergtmn
20f4a16f01 [10503] Move *_respawn tables to characters DB.
This allow have in `mangos` DB only world static state data.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-09-19 00:45:21 +04:00
VladimirMangos
acd0716297 [10432] Rename ASSERT -> MANGOS_ASSERT and related fixes
ASSERT hard use in predictable way because diff. 3rd party libs code
redefine it inf different ways and hard make sure that used in end
of mangos define version. This is real detected problem make some
expected assert checks ignored and so bugs not detected as expected from code.

In addition made related changes:
* Common.h header expected to be first include in any src/game/header except most simple cases.
* Related FILE.h header expected to be first include in FILE.cpp
* Fixed some absent includes and type forwards for safe build without PCH enabled.
* Avoid using MANGOS_ASSERT in src/framework code
2010-09-02 05:13:16 +04:00
VladimirMangos
6d5559544b [10414] Constantify some functions in InstanceSave.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-08-28 01:44:23 +04:00
VladimirMangos
dcc9dc25ae Traditional post-commit typo fix. 2010-08-20 14:33:03 +04:00
VladimirMangos
920a36b3fd [10384] Fixed reset time calculation for some cases.
Most real fix suggested by Schmoozerd and  Toinan67
and some my code style part coding ;)
2010-08-20 14:32:11 +04:00
VladimirMangos
2284df7868 [10198] Partly revert old changes in load instance reset time.
* Its has been added for raid/heroic instances in time adding
  support MapDifficulty.dbc. Its wrongly assign reset events
  for each instance instaed use generic event for map/difficulty pair.
  In result at this event triggering instance can be attempt resetted
  multiply time.
* Also comment this in InstanceResetEvent fields notes
2010-07-16 01:28:38 +04:00
TGM
e4495d4c2d Fixed typo in enum value name.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-07-15 21:59:03 +04:00
VladimirMangos
f72b8e60a5 [10196] Use enum for instance reset event types, some related cleanup code. 2010-07-15 18:31:38 +04:00
VladimirMangos
67a7892075 [10114] Store associated InstanceSave for dungeon map in Map object 2010-06-27 21:11:26 +04:00
VladimirMangos
593f1e81b9 [10103] More cleanups in InstanceSave
* Use single function for erase element from save list.
* Make lock bool checks class local (it need be replaced by normal lock object in future)
* Remove redundent now friend class declarations.
2010-06-24 09:10:57 +04:00
Caskast
c2ae24c16c [10095] Fixed typo in function name.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-06-22 13:17:01 +04:00
VladimirMangos
e88a718c5d [10094] Extract instance reset scheduler from InstanceSaveMgr
Reset scheduler code not need explicit access to instance saves,
and no reson mix it with instance save managment code in single class
2010-06-22 04:40:33 +04:00
VladimirMangos
79f70e9a81 [10093] Sort functions and cleanup InstanceSave delete code. 2010-06-22 03:31:21 +04:00
VladimirMangos
1eed65d5ac [10082] Drop now unused dotconfpp lib code. 2010-06-20 02:20:51 +04:00
VladimirMangos
722135b326 [9838] More log filters and macro uses.
* LogFilter_Weather
* LogFilter_PeriodicAffects
* LogFilter_PlayerMoves
* LogFilter_SQLText
* LogFilter_AIAndMovegens
* LogFilter_PlayerStats
2010-05-05 18:46:10 +04:00
XTZGZoReX
51fd11c92c [9638] Replace all C assert()s with MaNGOS ASSERT() macro. 2010-03-29 19:29:42 +02:00
VladimirMangos
2a5ce2198c [9407] If instance have reset time not let rate make it less 1 day.
This also fix crash at instance reset data loading at server startup.
2010-02-18 16:17:08 +03:00
AlexDereka
ebfb0f9835 [9389] Cleanup config data. Use proper names and expected types. 2010-02-15 15:29:06 +03:00
AlexDereka
5368751c13 [9386] Store some config values in Rate emun. 2010-02-15 00:17:44 +03:00
VladimirMangos
f4c38044c4 [9384] Resore use uint64 instead time_t in query, some other fixes. 2010-02-14 21:35:03 +03:00
AlexDereka
ccfd42bf3e [9381] Fixed some compile warnings. 2010-02-14 18:16:07 +03:00
VladimirMangos
fe6e2e1746 [9122] Updated copyright notice for new year.
Also fix some lost in past cases.
2010-01-08 00:02:21 +03:00
balrok
1d362eace4 [8845] fixed some gcc warnings 2009-11-20 12:57:19 +01:00
VladimirMangos
37ba6623bb [8828] Independent instance reset time for different difficulties.
* Store reset time for map/difficulty pairs.
* Use DBC data for reset time and max players instead `instance_template` fields (dropped)
  for each existed map/difficulty pair.
* Fix some "heroic" related checks in spells/etc.
2009-11-18 10:08:41 +03:00
XTZGZoReX
b3f3ffa885 [8793] Don't do operations through singleton if already in singleton context.
* Also, some minor things:
   - Remove duplicate sWorldLog define.
   - Add sRealmList macro for RealmList::Instance().
   - Use sLog macro in scripting log functions.
2009-11-08 19:32:59 +01:00
XTZGZoReX
0734adb746 [8789] Rename several singleton macros to use more consistent names.
* objmgr -> sObjectMgr
 * spellmgr -> sSpellMgr
 * WaypointMgr -> sWaypointMgr
 * poolhandler -> sPoolMgr
 * objaccessor -> sObjectAccessor
 * mapmgr -> sMapMgr
 * sInstanceSaveManager -> sInstanceSaveMgr
 * ticketmgr -> sTicketMgr
 * CreatureEAI_Mgr -> sEventAIMgr
 * auctionmgr -> sAuctionMgr
 * achievementmgr -> sAchievementMgr
2009-11-08 12:11:34 +01:00
XTZGZoReX
dc725ad6b8 [8785] Use macro instead of explicit call to singleton Instance().
* For: ObjectAccessor, MapManager.
2009-11-08 03:54:41 +01:00
XTZGZoReX
1f23884757 Don't use singleton to access static functions.
* This affects especially ObjectMgr functions:
   - GetCreatureInfo
   - GetGameObjectInfo
   - GetInstanceTemplate
   These are in fact static functions.
2009-11-08 03:54:27 +01:00
VladimirMangos
a9af7f2b1c Use reset time for normal/heroic from new DBC. Improve basic support for raid difficalties. 2009-10-06 02:12:02 +04:00
VladimirMangos
a75d9893a6 [8106] Revert "Fixed instance heroic/raid reset cooldown at switch normal/heroic difficalty."
This reverts commit 655bb6125abcba28318b2074e1624bb4eb21cadd.

After discussion with Wyk3d fix considered as wrong way.
2009-07-02 09:20:45 +04:00
BonDit
ae0cb69135 Fixed instance heroic/raid reset cooldown at switch normal/heroic difficalty.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2009-07-02 09:20:13 +04:00
tomrus88
02bcc56919 Added placeholders for new battlegrounds, some other stuff. 2009-06-25 19:08:53 +04:00
Ambal
b76c4c2f3c [8026] Obtain object's map directly by calling appropriate WorldObject::GetMap()/GetBaseMap() functions instead of accessing MapManager. Code cleanups. Big thanks Infinity for tests.
Signed-off-by: AlexDereka <dereka.alex@gmail.com>
2009-06-16 12:47:02 +04:00
VladimirMangos
2a27a44e2a [7918] Improve portability in work with uint64 string format specifiers and in code literals.
* 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
2009-05-30 22:44:20 +04:00
AlexDereka
9ab8c6edd3 [7727] Use more simple code for element erase. 2009-04-28 00:00:19 +04:00
AlexDereka
995988039b [7726] Fixed memory leak in InstanceSaveMgr. 2009-04-27 21:57:11 +04:00