Commit Graph

60 Commits

Author SHA1 Message Date
Machiavelli
d54225189e Core/DBLayer: Fix a warning
--HG--
branch : trunk
2010-09-06 17:55:12 +02:00
Spp
cdef980af4 Core: Fix some warnings
--HG--
branch : trunk
2010-09-06 15:23:08 +02:00
Machiavelli
1608ebf7bf Core/DBLayer: Move some syncrhonisation error prone methods into the guarded scope in MySQLConnection:Execute(PreparedStatement*)
--HG--
branch : trunk
2010-09-05 10:34:46 +02:00
Machiavelli
27c00a8cbb Core/DBLayer:
- Allow transactions to contain both raw ad-hoc queries and prepared statement elements
* When coding on high level code, just make sure you use the right argument type for Transaction::Append and the proper execution will be done automagically

--HG--
branch : trunk
2010-09-04 16:49:23 +02:00
Machiavelli
fd1c6c5440 Core/DBLayer: Add an assert in TransactionTask::Execute to make sure valid queries are held
Core/Logging: Tiny cleanup in sLog.outSQLDriver

--HG--
branch : trunk
2010-09-04 16:06:04 +02:00
Machiavelli
5469af3775 Core/DBLayer: Add an assert to detetct calls to invalid prepared statements.
--HG--
branch : trunk
2010-09-03 17:30:23 +02:00
Machiavelli
273679c5ba Core/DBLayer
- Store threadbundlemask internally per database pool and prevent direct access to config file post startup
- Fix threadbundlemask flag checking for ReactorRunnable, WorldRunnable
- Remove CLI threadbundlemask flag, CLI doesn´t need a seperate mysql connection nor thread
- Remove unused Character Database connection from WorldSocketMgr / ReactorRunnable
- Add proper LoginDatabase connection to RA Runnable (soon to be overhauled)

Note: still experimental and not tested for live use

--HG--
branch : trunk
2010-09-03 10:52:32 +02:00
Machiavelli
387ee751a9 Core/DBLayer
- Add some small documentation on prepared statement defines naming contention (placed in the 3 database implementation header files so it can´t be missed)
- Remove obsolete mutex declaration in DatabaseWorkerPool (was unused as of recently)

--HG--
branch : trunk
2010-09-03 09:21:28 +02:00
runningnak3d
7433768a55 Core/Build: Partial work of fixing non-PCH Linux compile
--HG--
branch : trunk
2010-09-02 17:19:53 -06:00
Machiavelli
7982cc0f7d Core/DBLayer:
- A few prepared statement implementations in authsocket as example.
- Add an ASSERT in MySQLConnection::Execute(PreparedStatement*) to catch faulty created statements

--HG--
branch : trunk
2010-09-03 01:00:49 +02:00
Machiavelli
2c1c391597 Core/DBLayer:
- Example implementation of prepared statement in ObjectMgr::SaveCreatureRespawntime
- #include "MYSQLThreading.h" -> #include "MySQLThreading.h" (*really* fixes Linux build)

--HG--
branch : trunk
2010-09-03 00:44:27 +02:00
Machiavelli
1e8a294659 Missing include from previous rev.
--HG--
branch : trunk
2010-09-03 00:08:20 +02:00
Machiavelli
39027133e4 Fix Linux build
--HG--
branch : trunk
2010-09-03 00:04:14 +02:00
Machiavelli
1198591bac Core/DBLayer:
- Add basic prepared statement interface (without implementation and thus without testing, without resultset support).
- Based on raczman/Albator´s work on TrinityCore3

Build:
- Add sLog define ¨hack¨ in DatbaseWorkerPool.h to fix some more sLog errors temporarily

FYI: Builds on windows

--HG--
branch : trunk
2010-09-02 20:54:43 +02:00
Shauren
cd182a1e8f Fixed build
Fixed wrong header includes in new database files, thx Thyros

--HG--
branch : trunk
2010-09-02 20:22:19 +02:00
Machiavelli
c47f45694f Core/DBLayer: Add Login-/Characters-/Worlddatabase class implementations
--HG--
branch : trunk
2010-09-02 17:56:49 +02:00
Machiavelli
5ef738c16e Core/DBLayer:
- Better way to shutdown worker thread, prevents a crash. Fixes issue #3696
- Delete missing file from previous rev

--HG--
branch : trunk
2010-09-02 17:55:03 +02:00
Machiavelli
0117af4c37 Core/DBLayer:
- Implement deriviate classes of MySQLConnection for every database type (world, realm, characters)
- Make DatabaseWorkerPool templatized and use the above mentioned classes as parameter
- Implementation of the new types in code
(This is in preparation of prepared statement interface)

--HG--
branch : trunk
2010-09-02 17:47:50 +02:00
Machiavelli
d2edf39feb Core/DBLayer: Remove as of recent redundant DatabaseWorkerPoolEnd operation
--HG--
branch : trunk
2010-09-02 16:45:33 +02:00
Spp
b9e19572c4 Core: Fix more warnings (very few left under linux 32)
--HG--
branch : trunk
2010-08-31 11:39:51 +02:00
Machiavelli
175fece073 Core/Logging:
- Implement sLog.outSQLDriver that will log SQL driver related events (non-content related).
- Queries will now be logged into this file as well instead of normal log file (requires debug build).
- Don´t forget to update your authserver.conf and worldserver.conf
Core/build:
- Fix non-PCH build

--HG--
branch : trunk
2010-08-26 21:50:54 +02:00
Machiavelli
082592034f Core/DBLayer:
- Add a better way to shutdown async threads in the threadpool (with thanks to Derex)
- Move mysql_library_end() to DatabaseWorkerPool destructor to prevent a crash accessing mysql context from other pools after closing one pool.
- Add some debug output to Init/End_MySQL_Connection functions

--HG--
branch : trunk
2010-08-26 20:55:09 +02:00
click
3c027962ba Buildsystem/Core: Adjust MySQL headers on relevant files to use simplified #include <mysql.h> instead of <mysql/mysql.h>
+ add support for compiling under MacOSX (thanks to elegos for the research)
NOTE: G3D requires a redefinition-hack under OSX, please see wiki for this info (dep-sources will not be changed)

--HG--
branch : trunk
2010-08-26 16:40:28 +02:00
Spp
16d95d3115 Core: Fix some warnings
--HG--
branch : trunk
2010-08-23 07:51:19 +02:00
click
670964803f Core: Fix more warnings, add new function sLog.outStaticDebug() that replaces DEBUG_LOG
--HG--
branch : trunk
2010-08-22 01:57:04 +02:00
Spp
c3343638cb Core: Remove lots warnings:
- All "'xxx' will be initialized after 'yyy' when initialized here"
- Some "unused variable"
- Some "enumeration value 'xxx' not handled in switch"

--HG--
branch : trunk
2010-08-21 20:08:47 +02:00
click
3febdd7884 Core: Remove warning-ignores from Common.h, and fix a shitload of retarded warnings that was hidden by it - NO MORE HIDING IN CORE THANKYOU!
--HG--
branch : trunk
2010-08-21 19:40:05 +02:00
click
50789b0461 Core: Remove already defined FD_SETSIZE (picked up from Common.h)
--HG--
branch : trunk
2010-08-21 16:37:30 +02:00
click
f7ad5b2624 Core/Build: Clean up more nonPCH-issues + fix a warning in Timer.h (unsigned/signed cast)
--HG--
branch : trunk
2010-08-21 09:53:04 +02:00
click
71b48cadc2 Core: Make shared build happily without PCH (there are still issues with game ++)
--HG--
branch : trunk
2010-08-21 08:08:49 +02:00
Machiavelli
994186f267 DB Layer:
- Make SQL Transactions actual objects used in code. (Thanks to Derex for the idea)
* Uncommitted transactions will be automatically rolled back and cleaned up using ACE_Refcounted_Auto_Ptr, so no need to call Rollback() in the code.
* Prevents recursive transactions and makes developers aware of transactions going on.
* Gets rid of unneccesary overhead iterating over a concurrent map.
- Some cleanups in affected code, including better usage of transaction control in AH / mail related code to prevent data loss.

*** Experimental, use at own risk, recommended to backup your DBs. ***

--HG--
branch : trunk
2010-08-21 03:19:25 +02:00
Machiavelli
a3270e79e3 Return proper MySQL connection for syncrhonous requests based on calling thread instead of bundled connection.
--HG--
branch : trunk
2010-08-20 12:44:08 +02:00
click
24d752e782 Core/Build: Fix non-PCH build, again... :P
--HG--
branch : trunk
2010-08-20 11:48:12 +02:00
Machiavelli
17d0382cd4 Fix a crash in transaction commands.
Fixes issue #3495

--HG--
branch : trunk
2010-08-19 16:41:43 +02:00
Machiavelli
46438f9f92 - Call mysql_thread_end() for every deleted MySQLConnection instance, should fix the ¨Error in my_thread_global_end(): X threads didn't exit¨ issue. (Thanks to Aokromes for testing)
- Add some debug info to help trace down the other causes of the shutdown crash.

--HG--
branch : trunk
2010-08-19 16:35:52 +02:00
Machiavelli
7d915911f9 Properly end mysql connections and libraries on exit.
--HG--
branch : trunk
2010-08-19 15:47:29 +02:00
Machiavelli
7bac588be2 Solve one of the few culprits that cause authserver and worldserver to exit improperly after the recent database layer changes.
--HG--
branch : trunk
2010-08-19 15:37:53 +02:00
Machiavelli
3932fc8c83 - Fix Linux build (huge thanks to Aokromes for testing as always)
- Some work towards resolving the crash on shutdown by implementing a shutdown task

--HG--
branch : trunk
2010-08-19 00:13:09 +02:00
Machiavelli
d845a903b1 DBLayer:
- Use ACE_Future and ACE_Future_Set for async SQL queries with callback
* Callbacks will now be executed from the thread and object that scheduled the request, instead of the world runnable thread (and thus are no longer dependent on the 50ms forced sleep time).
* This design gets rid of a potential DOS loophole in the resultqueue system - unique requests will be cancelled when re-requested.
- Drop now redundant SQLQueryTask, SQLResultQueue, SQLResultQueueTask operations.
- Drop now redundant CharacterHandler class
- Change static callback functions in WorldSession to normal functions.

Thanks to Derex and Zor for advice along the way.

--HG--
branch : trunk
2010-08-18 19:48:51 +02:00
click
7d8146f989 Buildsystem/Core: Adjust header locations in CMake for collisions and shared + clean up includes from re26dbe6981
This sorts out issues with non-PCH compiles on supported platforms.

--HG--
branch : trunk
2010-08-18 07:17:04 +02:00
Machiavelli
6818c8b0ba Remove redundant files that I overlooked in my previous commit.
--HG--
branch : trunk
2010-08-18 02:39:24 +02:00
Machiavelli
87218eadcd * HIGHLY EXPERIMENTAL - USE AT OWN RISK *
Database Layer:
- Implement connection pooling: Instead of 1 delay thread per database, you can configure between 1 and 32 worker threads that have a seperate thread in the core and have a seperate connection to the MySQL server (based on raczman/Albator´s database layer for Trinitycore3)
- Implement a configurable thread bundle for synchroneous requests from seperate core threads (see worldserver.conf.dist for more info)
- Every mapupdate thread now has its seperate MySQL connection to the world and characters database
- Drop inconsistent PExecuteLog function - query logging will be implemented CONSISTENTLY later
- Drop current prepared statement interface - this will be done *properly* later
- You´ll need to update your worldserver.conf and authserver.conf
- You´re recommended to make a backup of your databases before using this.
* HIGHLY EXPERIMENTAL - USE AT OWN RISK *
* HIGHLY EXPERIMENTAL - USE AT OWN RISK *
etc.

--HG--
branch : trunk
2010-08-18 02:25:52 +02:00
click
1f80c7b3c0 Sourcefile sleanups -> tabs to spaces, remove whitespace - also update the cleanupscripts very slightly
--HG--
branch : trunk
2010-08-08 19:45:53 +02:00
click
9a8342abb7 Buildsystem: Make core buildable under Windows again
- changed OpenSSL detection of headers around slightly
- changed paths to MySQL-headers on Windows in a few files
- removed precompiled header for scripts being built when building game
- added requirement of building revision.h to be built before building shared
- added some generic buildfixes (thanks zor)
- use resource-files, allowing for icons to show up on windows

--HG--
branch : trunk
2010-08-08 03:33:21 +02:00
click
6baf3f9a59 Buildsystem/CMake: Adjust headerlocations on Windows so that they are correctly detected.
- Remove caching of OpenSSL info (for you, zor!)
- Adjust MySQL header-location in a DB-file (haha to Machiavelli, more work for you!)
- Add OpenSSL-header location to the shared-library (Fixes build)

--HG--
branch : trunk
2010-08-07 21:48:20 +02:00
Shauren
fda697a1e7 Implemented ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS
Fixed timed achievements timer restarting on every map change
Added missed change in instance_template format

--HG--
branch : trunk
2010-08-06 14:56:41 +02:00
click
3296a944e7 Convert to using ACE for reading configurationfiles, and remove dependency on dotconfpp configuration library and related files
(patch by astellar - and a thankyou to vladimir for being a russian teddybear)

--HG--
branch : trunk
2010-07-29 01:22:45 +02:00
Machiavelli
b6e180c17c Add PreparedStatementHolder class that will be used for registering and calling prepared statements on the MySQL server.
Information about prepared statements can be found here: http://dev.mysql.com/tech-resources/articles/4.1/prepared-statements.html
In short: better performance shall ensue.

--HG--
branch : trunk
2010-06-28 16:09:06 +02:00
Machiavelli
0f7657b68c Get rid of Trinity Singleton and Threading patterns and replace them with ACE_Singletons and ACE_GUARD_x macro´s with ACE_Thread_Mutex´es respectively.
Also get rid of unused CountedReference class that used Trinity threading pattern.

--HG--
branch : trunk
2010-06-25 00:18:01 +02:00
Xanadu
ffaffe3fd7 * Renamed several VS projects and the executables they produce to reflect the new naming convention.
* Cleaned up some useless and redundant preprocessor definitions.
* Fixed the win build so that it correctly uses the mysql lib it built from the sources.
* Note that you still need to use 8615_mysql_openssl_libs.zip for the OpenSSL binaries.
* Also note that Win x64 build from the existing VS files is still fubar (mysql lib...).

--HG--
branch : trunk
2010-06-23 01:47:41 +02:00