105 Commits

Author SHA1 Message Date
Shauren
d778d5ec7c Core/Misc: Include cleanup - remove MapUtils.h from Containers.h 2024-12-31 18:12:36 +01:00
Shauren
9894f6b802 Core/Random: Changed random functions returning doubles to return floats
* They were all cast to float at use anyway
* Improves roll_chance_f performance (rand32() is now called internally by uniform_real_distribution once instead of twice)
2023-10-31 20:20:00 +01:00
Jeremy
bb8f713d5f Core/Pools: Allow all gameobject types to be pool members (#28754) 2023-02-05 13:54:25 +01:00
Shauren
d791afae1d Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api) 2023-01-08 21:16:53 +01:00
Shauren
94d829c84f Core/Pools: Implemented pooling for instances 2022-06-11 14:04:56 +02:00
Giacomo Pozzoni
9c3dc31a37 Core/Pools: Fix pools with 1 member never spawning anything anymore (#26620)
* Core/Pools: Fix pools with 1 member never spawning anything anymore

Attempts to fix a 6 years old bug and never fixed by the original author.

* Remove respawn times from db once a respawn has been handled

* Allow to specify if Despawn1Object() should save or not the respawn time. We don't need to do that when respawning an object.

* Apply the same fix to GameObjects too

(cherry picked from commit c8ca48823d)
2022-03-11 13:39:15 +01:00
jackpoz
d0fe16b787 Core/Misc: Fix issues reported by static analysis
(cherry picked from commit 33dace231c)
2022-03-11 11:48:18 +01:00
Treeston
a8d00ddd69 Core/Maps: move pooling hand-off outside of Map::CheckRespawn (PR#25785)
fixes #25777

(cherry picked from commit f8afcec9f3)
2022-03-05 17:07:46 +01:00
Shauren
f8ad7017dd Core/Misc: Move (or delete) constructors and destructors to .cpp files (avoids compiling them in every file that includes them) 2022-02-12 21:36:46 +01:00
Giacomo Pozzoni
74923df35a Core/Pools: Attempt to workaround pools being broken since 2015 (#24949)
* Core/Pools: Attempt to workaround pools being broken since 2015

Attempt n°2

* Fix warning

(cherry picked from commit 8c0a315734)
2022-01-21 18:57:24 +01:00
jackpoz
68faf5bc4b Core/Common: Replace ASSERT(false, "...") with ABORT_MSG("...")
(cherry picked from commit 54c701cf0d)
2022-01-19 22:17:42 +01:00
jackpoz
7eff81f9db Core/Pools: Fix crash on startup
(cherry picked from commit 9cde3ffd14)
2022-01-01 14:34:20 +01:00
Giacomo Pozzoni
97c1d01cbb Core/Pooling: Remove respawn times from the database when despawning a pool (#24422)
* Core/Pooling: Remove respawn times from the database when despawning a pool

Remove respawn times from the database when despawning a pool. This is needed when a Game Event ends but there are still some respawn times saved in the database.

* Remove respawn time of active pool objects even if they are not spawned

(cherry picked from commit 4f33fd3932)
2022-01-01 14:02:00 +01:00
Matan Shukry
8fabe5a3aa Core/Phasing: Implemented db spawns in personal phases (#26345)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
2021-12-28 13:24:10 +01:00
Treeston
94a79bac7a Core/Misc: Some refactoring, #23603 prep: (#23676)
- Split SpawnMetadata off from SpawnData
- No longer allocate Creature/Gameobject objects in ObjectGridLoader just to check their typeid and delete them afterwards

Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
(cherry picked from commit 9304e496cb)
2021-12-21 15:16:26 +01:00
Treeston
51fbda4223 Core/Pooling: Quest pooling rewrite: (PR#23627)
- Split quest pooling from PoolMgr (into QuestPoolMgr)
- Proper saving/restoring on server restart
- No more hacking into sObjectMgr to insert/remove available quests

(cherry picked from commit a5e73e41c0)
2021-12-18 15:28:45 +01:00
Treeston
8b78f50556 Core/DB: Merge pool_creature, pool_gameobject and pool_pool into a single pool_members table.
(More pooling prep, I really don't want to have any sql update files in that PR if I can help it.)

(cherry picked from commit 45bc91c238)
2021-12-16 21:20:38 +01:00
Treeston
d5e58cef69 Core/Spawns: Exterminate CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY with extreme prejudice. (It didn't work anyway.)
(cherry picked from commit 26440857c1)
2021-12-16 01:18:15 +01:00
Aokromes
3ad5bc1e15 Core/Misc: More coding standards (#23519)
* Core/Misc: More coding standards

* revert part

* "void  " or more to "void "

* fix? reject

* remove more double whitespaces

* remove more double whitespaces

* more standards

* more coding standards

* More standards

* more coding

* more coding standards

* more coding standards

* And more standards

(cherry picked from commit 574a7c8d3d)
2021-12-14 23:04:29 +01:00
Shauren
3bf6698116 Core/Misc: Fix appleclang 12 warnings 2021-10-01 11:18:29 +02:00
lachtanek
5e774fc7f1 Core/Pools: Fixed spawning in pools with both explicitly and equally chanced entries (#21170)
(cherry picked from commit c50aefac96)
2021-05-29 21:27:11 +02:00
lachtanek
0099154316 Core/Pooling: Fixed less and less objects from pools being spawned the longer the server is running (#20949)
Closes #11141

(cherry picked from commit de80cd2e0d)
2021-02-15 19:13:25 +01:00
Shauren
b231903932 Core/Misc: Port all the refactors sneaked in master to 3.3.5 include cleanup port 2020-09-04 13:38:24 +02:00
r00ty-tc
03b125e6d1 Dynamic Creature/Go spawning:
- True blizzlike creature spawn/respawn behavior - new creature = new object
 - Toggleable spawn groups (with C++/SAI/command options to use them)
 - Custom feature: dynamic spawn rate scaling. Accelerates respawn rate based on players in the zone.
 - Backward compatibility mode (set via group and for summons)
   to support creatures/gos that currently don't work well with this
   (this should be removed once the exceptions are fixed)

Fixes and closes #2858
Tags #8661 as fixable.
Fixes and closes #13787
Fixes #15222.

(cherry picked from commit 59db2eeea0)
2020-08-22 12:59:57 +02:00
Shauren
1c52d5fff7 Core/Misc: Replace NULL with nullptr 2020-08-14 17:06:03 +02:00
Shauren
4c173e4b7b Core/Maps: Use FindMap instead of CreateBaseMap in places where the intent was to check for a existing map (and a loaded grid on that map) 2020-07-18 00:57:16 +02:00
Aokromes
b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
Shauren
f6e2b8cdc1 Core/DBLayer: Prevent committing transactions started on a different database 2019-07-27 10:52:33 +02:00
Shauren
e8e89f58fb Core/DBLayer: Prevent using prepared statements on wrong database 2019-07-27 01:00:37 +02:00
vincent-michael
5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
joschiwald
6226189a16 Core/Entities: Created factory methods to create new areatriggers, creatures and gameobjects 2018-01-27 23:02:46 +01:00
vincent-michael
7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
Rochet2
ff28ff500d Core/Pools: fix pool memory usage (#21138)
Change vector to unordered map to save memory and startup time
2017-12-30 16:15:41 +01:00
Shauren
52c7f12ed3 Core: Fix Winstantiation-after-specialization warnings
Closes #20211
2017-09-02 01:06:10 +02:00
Shauren
b453e12423 Core/Game: Include cleanup part 5
* ObjectMgr.h
* Player.h
* Unit.h
* G3D should no longer propagate everywhere from Spline/MotionMaster
2017-06-04 01:00:45 +02:00
Shauren
c5d3dd90be Core/Game: Include cleanup
* Mostly aimed at removing Log/DatabaseEnv includes from other headers
* Fix most packet headers including other packet headers - moved common structures such as ItemInstance to their own files
* Moved SAI function definitions to source files (massive or requiring many different dependencies)
2017-05-18 23:53:25 +02:00
Aokromes
26305cd5fb Core/Misc: Fix some false startup errors 2017-05-10 11:35:20 +02:00
vincent-michael
86b98686a9 Update copyright note for 2017
Happy new year
2017-01-01 16:23:13 +01:00
Naios
bf33159a70 Core/Game: Converted the game library to a shared library.
* There is still the possibility to static link against game.
2016-03-24 01:31:51 +01:00
Naios
329225b40d Core/Game: Move singleton instances into compilation units
* Fixes issues when building shared libraries
  (prevents gcc and clang from providing several instance)
2016-03-11 18:35:49 +01:00
Vincent-Michael
478cc756eb Update copyright note for 2016
Happy new year (Again new year with idiots ...)
2016-01-01 00:34:25 +01:00
Shauren
ee1c1b97be Core/Maps: Fixed invalid iterator usage
Closes #14687
2015-05-14 00:04:49 +02:00
Shauren
ca83e14f8b Core/Entities: Reworked guid scopes
* Added ObjectGuid traits to easily access whether guid type can be generated globally (ObjectMgr) or not
* This adds separate (per map) guid sequences depending on object type
* Ported map object container from cmangos/mangos-wotlk@a2d396eb0b
* Added type container visitor for TypeUnorderedMapContainer
* Implemented helper function to erase unique pairs from multimap containers
* Moved object storage of all objects except players and transports to map level
* Added containers linking database spawn id with creature/gameobject in world
* Renamed DBTableGuid to spawnId
* Added a separate spawn id sequence generator for creatures and gameobjects - this will be used in db tables
* Moved building SMSG_UPDATE_OBJECT - updatefields changes broadcast to map update
2015-04-28 21:19:46 +02:00
jackpoz
e6f26cfb1f Core/Misc: Fix static analysis issues
Fix some static analysis issues reported by Coverity.
Rename SpellMgr::EnsureSpellInfo() to SpellMgr::AssertSpellInfo() to be consistent with other similar methods.
2015-02-08 19:40:03 +01:00
Vincent-Michael
ab90f74486 Update copyright note for 2015
Happy new year
2015-01-01 00:28:09 +01:00
Shauren
15fbb6f46f Core/Entites: Updated GUID format 2014-10-29 21:13:21 +01:00
DDuarte
5bc823f5e7 Core: Even more warning fixes 2014-10-27 22:52:19 +00:00
Shauren
7afab9f783 Core/Entities: Updated HighGuid values 2014-10-27 12:03:35 +01:00
Shauren
9e1930959d Core/Entities: Changed object lowguid to uint64 2014-10-26 02:57:28 +02:00
Shauren
a0e50ea35f Core/Entities: Use ObjectGuid class in game project 2014-09-14 16:14:12 +02:00