Commit Graph
72 Commits
Author SHA1 Message Date
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
Naios 151a0f5c5e Core/Shared: Hide the internal shared_ptr of the TaskContext
* use . operator instead of -> to access the TaskContext now.
* Add TaskContext::IsExpired to check whether the owner has expired.
2015-06-03 18:24:21 +02:00
Naios da77a90aa9 Shared/Util: Introduce a task scheduler which schedules task with c++11 techniques.
* Use std::function as callback (methods, lamdas & std::bind).
* Uses std::chrono::duration as duration type (Milliseconds, Seconds...)
  - With c++11 user defined literals we could just write "11s" for example (MSVS 2015, gcc & clang).
* Provides a lot of overloads for easier usage:
  - Static durations or random durations between min and max.
  - Named (with group ids - group id 0 is possible) or anonymous tasks.
  - Asynchronous tasks.
* Is adapted to the current needs of scripting:
  - Repeat tasks through the TaskContext
  - Schedule new tasks from the context.
  - Provides access to the times repeat counter of a task,
    this will help to schedule multi step events (dialogs for example).

See https://gist.github.com/Naios/6d143538abdc3d32fd2b for usage examples.
2015-05-31 19:32:09 +02:00
Naios 2592528741 Core/Log: Fix newlines when using dynamic log names
* thanks @Aokromes for reporting
* also removes an unnecessary std::move
2015-04-24 19:44:16 +02:00
Naios 66ce97c87e Dep/CppFormat: Update cppformat to cppformat/cppformat@fd53bb6fb8
* fixes /W4 warning spamming.
2015-04-05 21:30:22 +02:00
Naios de490674ff Core/DBUpdater: Exit clean if a query failed to apply.
* Fix some \W4 warnings about constructors.
2015-04-05 00:23:12 +02:00
Naios 85d6ff9570 Core/Log: Remove some unnecessary std::move's.
* This are r-value references already.
* Thanks @Shauren for noticing
2015-04-05 00:23:11 +02:00
Naios 1939367108 Core/Database: Remove va_list from PreparedStatement::PAppend. 2015-04-02 21:07:48 +02:00
Naios c9b0c8a0ca Core/World: Remove va_list from World::RecordTimeDiff.
* also split it in ResetTimeDiffRecord() and RecordTimeDiff() to avoid passing of null values.
2015-04-02 21:07:46 +02:00
Naios df4723af25 Core/Database: Remove va_args from DatabaseWorker::Execute methods.
* Also delegate SQLQueryHolder::SetPQuery into SetQuery.
2015-04-02 21:07:44 +02:00
Naios 589296da90 Dep/CppFormat: Update cppformat to cppformat/cppformat@aab64b55a4
* fixes argument limit, argument count is unlimited now.
2015-04-02 21:07:42 +02:00
Naios c386711972 CMake: Use source_groups to represent the source tree
* It let ide's (like vs) display the source tree.
* Disabled by default.
* Soft requirement is cmake >= 2.8.12 .
* Offers 2 modes: flat & hierarchical.
* For detailed description see #14471
* Thanks @click for help and advises.
* Closes #14471
2015-03-29 16:08:28 +02:00
Naios c61fac843b Core/Database: Return an unknown error code instead of false (0) if mysql_init failed.
* Thanks @et65 for noticing.
* ref #14139

(cherry picked from commit 83bbe00785a7ee7c8141d83bfe94a1415466c64d)
2015-03-29 15:04:51 +02:00
Naios 6486827204 Core/Database: Fix a mistake in 54ee5267244acac16
* Also use proper errno instead of 0 when reconnecting.
* Thanks @et65 for reporting
* ref #14139

(cherry picked from commit 47410157b1d1e51062732696ad5f457a69019ef4)
2015-03-29 14:28:18 +02:00
Naios 832234c47b Core/Log: Improve creation of log prefixes.
* this also fixes non whitespace seperated timestamps in logs after 95ebe4f31cba6b4772cfd19 @Aokromes
* remove an unnecessary stringstream in Log::outCommand
* delete copy constructor of LogMessage to prevent unwanted copies

(cherry picked from commit a2e280c8a8478bbe0652c1850b1a435abba79f93)
2015-03-28 17:29:56 +01:00
Naios 71c0d4f792 Core/Log: Fix linker errors that occur on msvc 12 lower then update 4
* http://stackoverflow.com/questions/4891067/weird-undefined-symbols-of-static-constants-inside-a-struct-class
* http://www-01.ibm.com/support/knowledgecenter/SSGH3R_8.0.0/com.ibm.xlcpp8a.doc/language/ref/cplr038.htm%23cplr038
* closes #14463
* ref #14317

(cherry picked from commit 9b0b1185e4f9eb48cd16237f7622204687b9c01a)

Conflicts:
	src/server/game/Server/WorldSocketMgr.cpp
2015-03-28 17:29:43 +01:00
Naios 11e1f4af60 Core/Database Improve commit 39bdd06446dc
* found a better way where no cast is needed.
* ref #14430

(cherry picked from commit 54ee5267244acac16e4b56342e64c0235ee0599b)
2015-03-28 17:25:16 +01:00
Naios 62a5ee8e2c Core/Database: Prepare statements at reconnect.
* Closes #14430

(cherry picked from commit 39bdd06446dc8ae6f19e017e4390bd2aa7834d03)
2015-03-27 15:38:58 +01:00
Naios 0778cc3332 Core/DBUpdater: Use correct formatter for size_t
* thanks @DDuarte pointing this out.

(cherry picked from commit b2b8de5786364d81fbce643e8f00bcc0129ed760)
2015-03-24 22:02:08 +01:00
Naios 4201ca021b Core/DBUpdater: Add the possibility to limit the remove of orphaned entries.
* This will save you from loosing your update history if you use a repository in bad state (revision or branch) by mistake.
* Also turned 1 error message into a warning

(cherry picked from commit 966282fbed24a0d0cf8cb3e05b1849c3e6a0d1d6)
(cherry picked from commit 3ad7776d5061308d3e2b4ff9e3cbf67d48bffdd6)
2015-03-24 13:03:55 +01:00
Naios 4fd51ab3b9 Core/DBUpdater: Use correct uint64 to store timestamps.
* Thanks @Shauren for pointing out.
* Also removes an invalid argument thanks @jackpoz for noticing.

(cherry picked from commit 8e48ef7863c5018aa185913ce6a616e46ef5b17e)
2015-03-22 01:33:58 +01:00
Naios 93457ac9d8 Core/Database: Fix some warnings on gcc
* warning: when initialized here [-Wreorder]
* thanks to @Vincent-Michael

(cherry picked from commit cff3910ec82b9f5ebc462a756ce39cc062120cfa)
2015-03-22 00:34:07 +01:00
Naios 2bd1c8541d Core/Updates: Add an automatic database update system. Automatically detects new and edited sql updates through file lists and hashing. Detects renames, deletes and is able to create and auto import full databases. * cleanups in main.cpp of world & bnetserver * refactoring in DatabaseWorkerPool.h & MySQLConnection.cpp
Make sure you re-run cmake, because boost::iostreams was added as dependency.
Maybe you need to install libboost-iostreams1.55-dev on unix as well.

Import every update manual until (included) those INSERT IGNORE updates for each database.

Thanks DDuarte and Shauren for your amazing ideas, help and advises.

In hope that nobody gets a "Your database structure is not up to date..." anymore ,-)

(cherry picked from commit 352012e53173372ebc82898e1b6854c983b01b25)
(cherry picked from commit 1f7f9feafc3f5017d617634ae993d2cdf4430920)

For 3.3.5:
* Synchronized ConfigureBoost.cmake with 6.x, libboost-filesystem1.55-dev also added as dependency!

Signed-off-by: Naios <naios-dev@live.de>
Signed-off-by: Nayd <dnpd.dd@gmail.com>
2015-03-21 20:54:54 +00:00
Naios 5a8cc94d36 DB/Misc: Rename an pr update to match its merged date 2015-03-19 10:51:53 +01:00
Denis 9a1db399d9 Merge pull request #14405 from ariel-/gpsfix
Crash fix in .gps command
2015-03-19 10:49:21 +01:00
Naios e96676aedd Core/Misc: Fix some issues detected by static analysis
* Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
  -> This argument is passed by value, it makes no sence so set it to null here.

* Member variable 'instance_violet_hold_InstanceMapScript::bWiped' is not initialized in the constructor.

(cherry picked from commit 433bc289c2c82b7377ad0189e415a3ca070d220f)
2015-03-18 20:23:47 +01:00
Naios f25666375e Dep/CppFormat: Update cppformat to cppformat/cppformat@bf8636c959
* fixes detecting support of <initializer_list>
* fixes build on solaris

(cherry picked from commit e40a5bf0b1483ce4275464a0a75a3d99035ca71c)
2015-03-18 20:12:20 +01:00
Naios dfe5e1e561 Core/RemoteAccess: Remove an unused define in RASession
* probably fixes gcc compile after adding cppformat

(cherry picked from commit a610dea85c77da9ce6c2be5b10f8259e3f315227)
2015-03-18 16:38:38 +01:00
Naios fc665b14dc Core/Log: Readd include of <stdarg.h> to fix compile issues under gcc
(cherry picked from commit d64e6ffade392be32f634b32658a6e0353f369c1)
2015-03-18 15:37:43 +01:00
Naios 301ec0be56 Core/Game: Fix some issues detected by static analysis.
* Possible inefficient checking for 'list' emptiness.

* Variable '_scheduledScripts' is assigned in constructor body.
  Consider performing initialization in initialization list.

* Variable 'Text' is assigned in constructor body.
  Consider performing initialization in initialization list.

* Possible inefficient checking for 'm_loadedScripts' emptiness.

(cherry picked from commit 9a61049f88835fd6bdb75905f042583d038d0667)

Conflicts:
	src/server/game/Server/Packets/TicketPackets.cpp
2015-03-18 01:13:47 +00:00
Naios a38945a3b3 Core/Log: Fix some issues detected by static analysis.
* Either inefficient or wrong usage of string::find(). string::compare() will
  be faster if string::find's result is compared with 0, because it will not scan the whole string.
  If your intention is to check that there are no findings in the string,
  you should compare with std::string::npos.

* C-style pointer casting detected. C++ offers four different kinds of casts as replacements:
  static_cast, const_cast, dynamic_cast and reinterpret_cast.

(cherry picked from commit 8882a6ca78e90d2980a3cd8d53acea9d2137f8b8)
2015-03-18 01:13:46 +00:00
Naios 642ed8a5d2 Core/PhaseMgr: Fixed an updateleak that occured if the rewarded quest hadn't requirements
* Fixed the range for phase ids in the phase_definition table
* solves http://www.trinitycore.org/f/topic/8737-condition-quest-rewarded-dosnt-work-instantly/
2013-06-29 15:44:32 +02:00
Naios 6191642e59 Core/SmartScripts: Check Conditions also for timed Events
* some cleanup work in SmartScripts.cpp

Core/SmartScripts: Some Corrections to last commit
2013-01-17 20:25:29 +01:00
Naios 978611d7dd Core/DataStores: Upgraded achievement_dbc db storage to 4.3.4 2012-12-27 15:42:55 +01:00
Naios 33ce380c12 Core/DataStores: Upgraded spelldifficulty_dbc db storage to 4.3.4
* Update 2012_12_27_00_world_spelldifficulty_dbc_434.sql is required
2012-12-27 15:42:42 +01:00
Naios 38b5a6c7be Core/Spells: On Dismount use the amount to get the MountCapabilityEntry to remove related mount auras #8123 2012-10-22 20:12:46 +02:00
Naios 61dce1a02e Core/PhaseMgr: Implemented Phase Definitions, Terrainswap and multiphasing
* fixes cataclysm aura effect SPELL_AURA_PHASE without phasemasks defined in miscValueA
* implements CONDITION_SOURCE_TYPE_PHASE_DEFINITION

Thanks to:
 - Cyberbrest: For the hard research work about multiphasing.
 - Venugh: He helped me with a lot of strange compile Errors.
 - Shauren: For the 4.3.4 phaseshift packet.
 - Booksize: He showed me how terrainswap works

Signed-off-by: Naios <naios-dev@live.de>
2012-10-15 20:31:41 +02:00