100 Commits
Author SHA1 Message Date
Naios 7f4a7cbb17 Dep/fmt: Update fmt to fmtlib/fmt@5f39721c0a
* Rename cppformat to fmt in the PackageList.txt
2017-10-16 21:48:44 +02:00
Naios ba524f140f Dep/efsw: The current version is equal to the one we have in the source tree 2017-10-16 21:48:36 +02:00
Naios 1ba5ab263e Build: Require CMake 3.2
* This is below current package version of
  debian stretch stable CMake on which we
  orientate at.
* Required for CMake target features
2017-10-16 21:48:28 +02:00
Naios 60e6fcfa62 Misc: Add an editorconfig
* This is a platform independent config which is
  supported in many editors to set the charset and intendation
  automatically on a per project basis.
* The latin1 charset is a workaround for the MSVC
  editorconfig support which stores utf-8 with bom
  instead of none.
2017-10-16 21:48:22 +02:00
Naios c54237c6f1 Build: Fix the in-source build prevention 2017-10-16 21:47:39 +02:00
Naios 2985952a49 Build: Fix a build error which happened on unix debug builds
* Thanks DDuarte for the fix
* Closes #19786
2017-05-26 14:24:23 +02:00
Naios 3eb8f457e8 Dep: Use the anonymous namespace free definition of boost::none.
* Fixes MSVC linking errors after the recent changes:

    "class boost::none_t const & const boost::`anonymous namespace'
    ::none" (?none@?A0x518851d0@boost@@3AEBVnone_t@2@EB)
    already defined in scripts_commands.lib...

* Sets the required version of boost on windows to 1.59
  according to the wiki.
2017-03-03 01:29:48 +01:00
Naios 0c0f613acd Dep: Update efsw to version 1.0.0 2017-03-03 01:29:14 +01:00
Naios 803ec1d5ab Core/Scripts: Fix a crash when swapping creatures with pending vehicle join events.
* Closes #17833
2016-09-15 17:08:45 +02:00
Naios dcea4223dd Core/Scripts: Fix a crash when adding/removing objects from the map while swapping
* Ref #17833
2016-09-15 17:08:30 +02:00
Naios f0e47a27f9 Core/Define: Remove the conditional macro for constexpr.
* Not needed anymore since the requirements were raised to MSVC 2015.
2016-08-29 22:08:31 +02:00
Naios 65e2355c8f Core/Common: Correct the linking of localeNames 2016-08-29 22:08:15 +02:00
Naios 2f22212d0d Core/Unit: Force cancel unit events before invalidating the object on destruction
* Closes #16675
2016-08-29 22:08:02 +02:00
Naios efa3d00ebf Core/Scripting: Fix acquiring of references between script swaps
* Delay unloading of shared libraries to the next update tick
  to prevent crashes in the destructor of the last referenced
  script instance.
* Closes #17557
2016-08-10 09:05:43 +02:00
Naios a354feb48b Core/EventProcessor: Check whether an event was aborted before aborting it.
* Fixes an assertion introduced in commit 1ad73212dca0cf.
* Use itr = std::unordered_map<...>::erase for updating the iterator.
2016-08-10 09:05:17 +02:00
Naios 80d77dfb46 Core/EventProcessor: Wait for non deletable events to get deletable.
* Immediate deletion caused issues with the SpellEvent,
  so we delete it at one of the next update ticks now.
* Only affects the unforced cancellation of events.
* Ref #16675
2016-08-10 09:04:55 +02:00
Naios 4065ba87c6 Core/Scripting: Don't force event cancellation when swapping creatures.
* EventProcessor::KillAllEvents(force = false) should only be used
  by the EventProcessor.
2016-08-10 09:04:38 +02:00
Naios b64cddabaf Build: Throw a fatal error when the SCRIPTS variable isn't a valid option.
* Catches issues early that are caused through a wrong configuration.

(cherry picked from commit 2b97b32d810d105070124b1008723c756589c719)
2016-08-10 09:04:13 +02:00
Naios d4e76b75dc Core/Common: Add the linkage type to the version string
* Add platform strings for intel and apple
* Remove usage of underscore uppercase identifiers because
  those are reserved for the compiler.
* Requested by Aokromes

(cherry picked from commit afa0bac669ac787e6bd35273c967a58b3e4e2196)
2016-08-10 09:03:50 +02:00
Naios a682a01270 Core/Common: Move the query callback header to the database project
* Also renames the header to it's correct name QueryCallback
2016-08-10 08:59:35 +02:00
Naios c4e7dcc04d Core/Scripting: Kill pending unit events when swapping AI's 2016-08-10 08:58:56 +02:00
Naios 2cd46f6f05 Core/Utilities: Inherit env vars when starting external processes 2016-08-10 08:58:38 +02:00
Naios 176f3f1a87 Core/Common: Fix a std::string -> char* -> std::string conversion
* Thanks jackpoz for noticing
2016-08-10 08:58:09 +02:00
Naios 2ec212fdd1 Core/Scripting: Use the systems temporary path for caching shared libs
* Disables the shared library caching on platforms completely which
  never block files on usage (like linux).
2016-08-10 08:57:12 +02:00
Naios 7a827fe435 Core/Cryptography: Move the SHA1 calculate helper to the SHA1 header 2016-08-10 08:56:37 +02:00
Naios 8289ed64d6 Core/Scripting: Add the info how much time the system took to reload 2016-08-10 08:56:11 +02:00
Naios 7da338e282 Core/Scripting: Change the INFO logger of the hotswap system to enabled 2016-08-10 08:55:43 +02:00
Naios b7ca3ad47d Core/Scripting: Improve the error message when the script reloader fails to create a cache entry
(cherry picked from commit 8fa52860ab666c95579f6c44bca26a49f7414b14)
2016-08-10 08:55:12 +02:00
Naios d1e5084c27 Core/Scripting: Fix a typo in b970a684 2016-08-10 08:54:52 +02:00
Naios 65feb528e5 Core/Scripting: Wait until the debugger is detached before rebuilding scripts.
* Thanks Shauren for the IsDebuggerPresent() hint.
2016-08-10 08:54:26 +02:00
Naios 3c4f4a9473 Core/Worldserver: Correct the default comment of HotSwap.EnableReCompiler
* Thanks jackpoz for noticing
2016-08-10 08:54:03 +02:00
Naios 9eab8427cc Core/Scripting: Fix detection of source changes when using inotify.
* This fixes the source change detection in linux.
* Also simplifies the detection of observed modules
* Fixes the script rebuilding on linux
* Escape windows paths to (maybe) fix paths with spaces (#16947)
2016-08-10 08:53:38 +02:00
Naios 273ee4f87f Core/Scripting: Fix an assertion which was triggered at lazy unloading
* Also fixes 2 warnings
2016-08-10 08:53:09 +02:00
Naios 785c17381c Core/Scripting: Fix loading of spell/aurascripts
* Broken since 9cc97f226d
* There is still a crash when using lazy unloading which I
  will fix in a later commit (this commit should fix at least
  the static build and normal usage of the dynamic build).
* Closes #16948
2016-08-10 08:52:30 +02:00
Naios a75d2b01fb Core/Common: Capsule boost process into helper functions
* For easier usage, the processes output it routed
  correctly to the TC logger line by line now.
* Add support for asynchronous process execution
  and process termination.
2016-08-10 08:51:52 +02:00
Naios 0b82bc2d0d Core/Database: Converted the database library to a shared library.
* There is still the possibility to static link against database.

(cherry picked from commit 6cfea2d8f7de3de8206a1f4cf23a6d653814afe1)
2016-08-10 08:45:27 +02:00
Naios 293d51c8b0 Core/Scripting: Fix another warning when building statically 2016-08-10 08:43:32 +02:00
Naios e23d063f5a Core/Game: Rewrote the ScriptMgr to support script reloading.
* Finally this commit enables dynamic script hotswapping
  and finished the PR #15671.
* Split the storage layout to use optimized storages
  for database bound and unbound scripts.
* Add several unload workers to reload scripts correctly
  -> Requires further investigation.
* Fixes memory leaks in ScriptMgr when dropping invalid scripts.
* Fixes VehicleScripts
* Makes OutdoorPvP scripts reloadable
* Makes InstanceMapScripts reloadable
* Makes CommandScripts reloadable
2016-08-10 08:40:44 +02:00
Naios 3957fbf176 Core/Scripting: Fix a warning when building statically 2016-08-10 08:25:28 +02:00
Naios aece2b85da Core/Scripts: Link the script project always statically
(cherry picked from commit 428908b8dbeee69f43e23a086f29d99bbdf05563)
2016-08-10 04:18:41 +02:00
Naios 3d25c14e74 Core/Build: Enable /bigobj for most MSVC builds.
* exluding 32 bit when dyynamic linking is disabled.

(cherry picked from commit 183f97005573f499d486613119e7bbb3d5d5318b)
2016-08-10 01:34:43 +02:00
Naios dc4ff7a9f2 Dep: Add efsw (entropia file system watcher)
* Uses system API's which reduces the overhead
  instead of checking periodically for changes.
* Will be used in the hotswap system to reload
  shared libraries on changes.
2016-08-08 21:51:31 +02:00
Naios 29eed2c20f Core/Scripts: Move the ragefire chasm scriptloader into the correct file
(cherry picked from commit 4710b1c8fe89e6cdd98f1a4645edd93d05033fa7)
2016-07-19 14:18:42 +02:00
Naios 74a588b462 Core/Misc: Replace tc's optional with boost::optional. (very partial cherry-pick)
* benefits from empty optimization (objects are only constructed if needed).
* supports r-value references (move semantics) (boost >= 1.56.0).
* preparation for c++14/17's std::optional and std::none_t.
* add move constructor to CompactArray.

(cherry picked from commit 800d5d893964a82265577d3352d683035b589f78)
2016-07-19 13:37:37 +02:00
Naios 071382aac1 CMake: Disable incremental linking in msvc debug builds
* Requested by Shauren
2016-06-01 02:49:23 +02:00
Naios e3e6940ba9 CMake/Revision: Use a raw string literal in cmake command define
* Ref 849c906014b98f
2016-06-01 02:49:11 +02:00
Naios 7cc2825399 CMake: Fix detection of AppleClang
* Since CMake 3.0 CMAKE_<LANG>_COMPILER_ID is set to "AppleClang"
2016-06-01 02:48:51 +02:00
Naios 321eb5fdd8 Core/Shared: Fix no PCH build 2016-06-01 02:48:32 +02:00
Naios 5601b1d963 CMake: Add jemalloc when tools are enabled too
* Since jemalloc is linked by common which is used by tools
2016-06-01 02:48:18 +02:00
Naios beade4616a CMake: Add inherited include directories and definitions to precompiled headers 2016-05-23 05:57:51 +02:00
Naios b94c28beb1 Dep: Fix an oversight in f52495c6
* Thanks dobrMAN for noticing
2016-05-16 22:39:01 +02:00
Naios 9ac55d9181 Dep/CppFormat: Update cppformat to cppformat/cppformat@5174b8c
Conflicts:
	src/server/worldserver/CMakeLists.txt
2016-05-16 22:37:02 +02:00
Naios b823c06973 Core/Updater: Correct the config key hint of a log message 2016-05-12 09:05:56 +02:00
Naios 62815c6e1c Core/Database: Use RAII for resource management in MySQLConnection
* Prevents double deletion of MySQLConnection after errors
* The object stays valid after an error and will wait for a reconnect
* Also crash the server if 5 reconnects fail
* Corrects an issue where the server was crashed after one reconnect
  because mysql_thread_id was invoked with an invalid handle
2016-03-03 01:19:58 +01:00
Naios 09fa0ab46a Core/Database: Move DatabaseWorkerPool into it's own translation unit 2016-03-03 01:06:13 +01:00
Naios 5ed0180994 Core/Database: Use RAII instead of raw pointers for resource management
* Corrects dirty usage of vectors with array indexes
* Removes _connectionCount which is now handled through the vector size
* Rename magic identifier "t" to "connection"
2016-03-03 01:06:13 +01:00
Naios 7d3cffc297 Core/Database: Close the databases correctly when the DBUpdater fails
* Also fixes a memory leak spotted by Aokromes
2016-03-03 01:06:13 +01:00
Naios eee75b80ac Core/Scripts: Prepare commands once
* Thanks @joschiwald pointing this out
2016-02-24 23:26:11 +01:00
Naios ecd74a8ccc Core/Scripts: Remove the npc_netherweb_victim script which is handled through sai now
* Ref 546c8a5b8e
2016-02-22 16:47:42 +01:00
Naios a974574d6e CMake: Add the possibility to pass an arbitrary count of targets to add_cxx_pch.
* A PCH is still generated for every target which was passed to the macro
* Resolves naming conflicts when using the same PCH header from multiple projects
* Ref #15671
2016-02-22 16:25:54 +01:00
Naios 9e43365b3d Core/Scripts: Split the huge scriptloader into smaller pieces
* Each subdirectory contains it's own translation unit now
  which is responsible for loading it's directory
* Improves merging & decoupling between 3.3.5 <-> 6.x
* Removes unused Battleground loader
* Ref #15671

(cherry picked from commit 5534915f743c707c07cb977bca67c2ff15487597)
2016-02-22 16:25:54 +01:00
Naios b5369b7d87 Core/Common: Add a generic config helper to access built-in overwriteable paths.
* Adds CMAKE_COMMAND and CMAKE_BINARY_DIR to revision_data.h
* Move the source and mysql exe path handling out of the DBUpdater.
* Make some Config methods const for correctness.
* Remove C & CXX flags from revision_data.h
 (was unused and didn't capture all cxx vars)
* Reorder the link order to prevent `ld` from ignoring the file
* Ref #15671

(cherry picked from commit 719159e2074ac2d0902c70bdd3c7a39e0d311bbe)
2016-02-22 16:25:47 +01:00
Naios f2233f5d14 Core/Updater: Convert an assertion into a fatal error
* The error is triggered when it fails to open an update for hashing
* See 'https://community.trinitycore.org/topic/12352-worldserver-crashes-on-database-update/'
  for details
* And a minor cleanup in the UpdateFetcher

(cherry picked from commit c43b80866593af3e9743fb55a395508c7dfb5d71)
2016-02-22 16:01:27 +01:00
Naios ae1a5c6c2b Core/Updater: Use a different method for file reading
* Current method causes issues under CentOS 6 and could possibly
  lead to cutted buffer content when reading in textmode.
* Closes #16209
2016-02-20 20:18:42 +01:00
Naios 6b5817d4a6 Dep/CppFormat: Update cppformat to cppformat/cppformat@5c76d107cb
(cherry picked from commit aa3020c26d54fa63fde16c5a765b1d72649c7e30)
2016-01-11 01:51:39 -03:00
Naios 7773984f94 Dep/CppFormat: Update cppformat to cppformat/cppformat@5c76d107cb
(cherry picked from commit aa3020c26d54fa63fde16c5a765b1d72649c7e30)
2015-12-08 16:46:15 +01:00
Naios 1ce5a62feb Core/Worldserver: Enable the database updater by default.
* Seems like this feature is stable enough to enable it by default
  since the last missing bugs were fixed some months ago.
* The database updater is the preferred method to update the databases
  as described in the wiki: http://collab.kpsn.org/display/tc/Databases+Installation

(cherry picked from commit 25185967e8df949e0f13ec0a7ff45b14ba977c76)
2015-11-14 17:08:01 +01:00
Naios 97dd18cb78 Core/ScriptMgr: Improve commit 155a289f052b3a48caade
(cherry picked from commit 30c421bf57c8d4c1000f8690d439283b858d485d)
2015-11-07 13:10:21 +01:00
Naios d81784194c Core/ScriptMgr: Fix "conditional expression is constant" warning.
* introduced in commit 12d1993994b11785

(cherry picked from commit 155a289f052b3a48caadebafe587c0e66685857f)
2015-11-07 13:10:04 +01:00
Naios 3a3a6bbfd2 Core/Globals: Use std::string rather than char* to pass script names around.
(cherry picked from commit b7b49fe35f87e83813466cb302ff17381792e607)

Conflicts:
	src/server/game/Battlegrounds/BattlegroundMgr.cpp
	src/server/game/Globals/ObjectMgr.cpp
2015-11-07 13:09:10 +01:00
Naios 23153c8bf1 Core/ScriptMgr: Replace IsDatabaseBound() methods through traits.
(cherry picked from commit 12d1993994b11785174c7caa7d7f9b5aa87d8411)
2015-11-07 12:34:15 +01:00
Naios 570e6baa09 Core/AI: Cleanup in CreatureAISelector
(cherry picked from commit 6fa45881914e0961c6c971d2c5e78fa3c712c5fb)
2015-11-01 15:05:16 +01:00
Naios 105f624763 Core/AI: Convert the hardcoded variadic RAND functions into one C++11 variadic template version.
(cherry picked from commit 0b6f7845911c41dcc175996816abc2e06f7dadbd)
2015-11-01 15:03:02 +01:00
Naios d96db56f03 Core/Tools: Fix brutal linking in mmaps extractor.
* caused warnings with shared linking
* ref #15671

(cherry picked from commit 13654bac2c41b2971915e706b5304a3ce6089a47)
2015-10-29 18:56:25 +01:00
Naios 5736deb854 Core/Build: Never overwrite the msvc cxx flags in the cache
* Setting all compiler flags in the cache led to circular bloating of
  msvc cxx parameters (was visible in console) which caused MSVC to
  rebuild the whole solution even on a small CMake change.
  It's not neccessary anyway to set the cxx parameters to the cache
  to take effect.
* I'm not sure if the workarround is still needed for MSVC 12+.
* Cleaning the CMake cache is recommended!
* ref #15671

(cherry picked from commit 0946fcf2aa35ebe0b8db07813315e3d6546b9d31)
2015-10-29 18:56:24 +01:00
Naios 5a71eb7384 Merge pull request #15711 from ShinDarth/bg-leave
Core/BG: Improved Battleground.InvitationType = 2
2015-10-13 21:18:30 +02:00
Naios f179c4180f Merge pull request #15676 from ShinDarth/bg2
Core/Battlegrounds: implement even BG teams configuration
2015-10-12 21:26:18 +02:00
Naios 2fe35e5896 Merge pull request #15695 from tkrokli/contrib_check_updates
contrib/script: error text corrections in check_updates.sh
2015-10-10 16:26:11 +02:00
Naios 2b041266a3 DB/Auth: Add missing update 2015_08_21_00_auth.sql to the auth base. 2015-10-05 23:30:24 +02:00
Naios 4dd6070c79 Travis: Add check for update entries not listed in base dumps.
* Will mark the travis build as failed when the database updater is broken.
2015-10-05 23:29:34 +02:00
Naios 45a60c2d22 CMake: Fix bad generation of "revision_data.h" not including MYSQL_EXECUTABLE.
* was caused through invoking "FindMySQL" after using ${MYSQL_EXECUTABLE}.
* better re-run CMake if you are affected by the mysql exe wasn't found issue.
2015-10-05 17:12:00 +02:00
Naios a561edefb9 Core/Updater: Fix mysql in path check/search. 2015-10-05 17:11:59 +02:00
Naios 73212c2b09 Core/Utilities: Add std::chrono::duration overloads to EventMap.
* makes it possible to write:
```c++
events.ScheduleEvent(1, Seconds(10));
// ... or ...
events.ScheduleEvent(2, Minutes(1) + Seconds(20));
// ... or with C++14 support:
events.ScheduleEvent(2, 45s);
```

(cherry picked from commit e4e55a3dcbd846fd583b4fc86344d88ca63588d7)
2015-07-22 02:18:41 +02:00
Naios 510194d6ba Core/Database: Enable perfect forwarding for chat format calls.
(cherry picked from commit 4904318c43567277f2d32c758724e82874f29849)
2015-07-22 02:18:39 +02:00
Naios 7f377a4f1b Core/Database: Enable perfect forwarding for database format calls.
(cherry picked from commit ca16dc8c1b8da86f55a790a5f8cc6913dd005fcc)
2015-07-22 02:18:38 +02:00
Naios e011ae63d5 Core/Logging: Enable perfect forwarding for logging format and args.
* Handle timestamp parsing though cppformat.
* Change a wrong forward -> move

(cherry picked from commit 026ceb85b9e0e870d95cea42895e867198c156dd)
2015-07-22 02:18:36 +02:00
Naios 09d34e0a9b Core/Utilities: Move EventMap into its own source file.
* Move implementation details to .cpp.

(cherry picked from commit 11bfead40b431cf7bb8e86c4cada059ed614344b)

Conflicts:
	src/server/game/Battlegrounds/Battleground.h
	src/server/shared/Utilities/Util.cpp
2015-07-22 02:02:51 +02:00
Naios 1741bfc64e Core/Utilities: Forward parameters of StringFormat correctly to fmt::sprintf.
(cherry picked from commit 11dfd9e7d4967aaa2dcecc6d4f7a8ac21b4013fd)
2015-07-22 02:00:05 +02:00
Naios 45058990e2 Core/Utilities: Remove global using of std::chrono namespace.
* never use "using namespace" in header files!

(cherry picked from commit 6bf10c2b83063147737aee68d3b40a6d67e49d53)
2015-07-22 01:59:57 +02:00
Naios 4c0c634814 Core/Utilities: Seperate std::chrono::duration typedefs into its own file.
* add std::chrono_literals using decl. comment for future usage.

(cherry picked from commit 6e4a1b3e1e5a735f26284c560b1463cdd527b2fe)
2015-07-22 01:59:50 +02:00
Naios 5ceb3fd0ab Core/Globals: Rename AddCreData -> AddCreatureData and MoveCreData -> MoveCreatureData 2015-07-18 18:21:56 +02:00
Naios 93d1028d75 Dep/CppFormat: Update cppformat to cppformat/cppformat@7859f81233
* clean up our custom CMakeList.txt
2015-07-01 21:18:38 +02:00
Naios e142c3b873 Cleanup duplicated names from contributors list.
* ref 1a7a9619d8
2015-06-30 23:39:31 +02:00
Naios 4335611010 Core/Updater: Fix mysql cli password prompt when password is empty.
* ref: http://community.trinitycore.org/topic/11510-world-server-bug-enter-password-to-update/
2015-06-30 23:33:07 +02:00
Naios 836ec5a6e6 Core/Utilities: Fix callback invokation when there are no tasks present.
* thx @joschiwald for noticing.
2015-06-30 23:29:19 +02:00
Naios 1a34fde96b Merge pull request #14971 from ShinDarth/fix_char_upd
DB/Characters fix auto updater
2015-06-29 00:11:08 +02:00
Naios 3d95aba2b3 Core/Utilities: TaskScheduler: add a task validator and on update success callback.
* makes it possible to block tasks if there is an active spellcast.
* requested by @joschiwald
2015-06-21 18:19:17 +02:00
Naios bd661b58fd Core/Updater: Fix a wrong formatter introduced in 0d095109eec31
* thanks @Aokromes for noticing
2015-06-21 18:13:01 +02:00
Naios a5b3862bc1 Core/Updater: Add some info about the count of applied updates.
* some minor improvements
* add a log message when database updates are disabled.
2015-06-20 14:33:31 +02:00
Naios 1a7a9619d8 Update contributors list (THANKS file)
* See https://gist.github.com/Naios/25810829e66b7ddd8b82 for the full procedure & sources.
* Most names were taken from commits (3.3.5 & 6.x branch)
* Also contributors who were mentioned in commits were included (@, thx, thanks, Author:, author:)

(cherry picked from commit 5b64df1a26d8b521282ffa41a17ad49a2e99558c)
2015-06-13 00:56:24 +02:00