Commit Graph

190 Commits

Author SHA1 Message Date
click
df66aee929 Yet more copyright header updates
--HG--
branch : trunk
2010-10-07 13:38:35 +02:00
click
8ea4b32fab Update copyright headers (following the same standard in all files = good)
--HG--
branch : trunk
2010-10-07 12:41:56 +02:00
Spp
952d3cf10e Core: Fix couple of warnings
--HG--
branch : trunk
2010-10-01 09:10:07 +02:00
Anubisss
84a29b2d35 Remove const from MySQLConnectionInfo, can't use non const functions in a const struct. This fixes the compile error.
--HG--
branch : trunk
2010-09-30 20:32:09 +02:00
click
b87d8f4700 Buildsystem: Overhaul of the CMake buildsystem:
- utilize CMake for completely generating revision.h (kills off genrev and revision.h targets):
  - pull and set correct revision-ID/hash from Mercurial (hg) when using regular repository sourcetree
  - pull and set correct revision-ID/hash from archived releases (when pulled from googlecode)
  - set and use _BUILD_DIRECTIVE definition (earlier part of revision.h) as compiletime definition
- delete genrev and related buildsystems
  (now deprecated)
- Move some files around to adhere to buildsystem structure
Thanks to Shauren for figuring out the definition-behaviour for MSVC while he was in the shower

--HG--
branch : trunk
rename : cmake_uninstall.cmake.in => cmake/platform/unix/cmake_uninstall.in.cmake
2010-09-29 23:42:09 +02:00
Machiavelli
fcec787e9c Core/DBLayer: Pass connection info down to lower level class MySQLConnection and use relevant data in logging messages in its methods
--HG--
branch : trunk
2010-09-29 15:29:57 +02:00
Machiavelli
d3b30e979a Fix linux compile. Thanks to click, hunshijie and tomkuzyno for spotting the culprits.
--HG--
branch : trunk
2010-09-29 14:59:05 +02:00
Machiavelli
bf72fa749f Core/DBLayer: Store MySQL connection details in a struct and print relevant data in sql driver messages
--HG--
branch : trunk
2010-09-29 08:48:06 +02:00
Shauren
665e7a06ce Core/Commands: Remove all active bans before adding new one, prevents multiple active bans for one character/account
Core/DBLayer: Converted most of ban related queries into prepared statement (might have missed some)

Closes issue #4218.

--HG--
branch : trunk
2010-09-28 21:30:05 +02:00
Spp
e27976102d Core/: Fix warnings
--HG--
branch : trunk
2010-09-28 14:48:17 +02:00
Machiavelli
7abe69b570 Core/DBLayer: Remove obsolete parameter in PreparedResultSet constructor.
Thanks to Spp for pointing out.

--HG--
branch : trunk
2010-09-28 14:03:35 +02:00
Shocker
78803c9f09 Magic numbers cleanup:
- Replace many magic numbers with constants
- Use enum for vehicle flags/seat flags
- Correct structure for ItemRandomSuffixEntry

--HG--
branch : trunk
2010-09-28 08:21:51 +03:00
Machiavelli
a9e9a2c884 Core/DBLayer:
- DB Threading model update
* Get rid of ThreadBundleMask and bundled connection
* Implement configurable amount of Synch threads for databasepools
* Use modulus based algorithm to check for free synchronous connections instead of previous ¨get connection by thread key or bundlemask¨ feature
* Locks on mysql context objects are now managed outside the mysql query methods

Fixes issue #4058
Fixes issue #4059
Introduces a ton of more issues. Use at own risk. You were warned. Really.

Don´t forget to update your worldserver.conf

--HG--
branch : trunk
2010-09-27 00:20:56 +02:00
Shauren
2e2951d037 Core/Players: Fixed action bar issues when changing active spec
--HG--
branch : trunk
2010-09-26 21:15:15 +02:00
click
461590832a Core: Generic cleanup (tab2spaces/whitespace removal)
--HG--
branch : trunk
2010-09-25 22:03:57 +02:00
click
f077277aa1 Buildsystem: Set revision.h as a required dependency build before building game, shared, worldserver and authserver
--HG--
branch : trunk
2010-09-25 21:42:11 +02:00
Rat
28e90bbb60 Core/Scripts/SmartAI: added SmartAI files
Core/DBLayer/Texts: added CreatureTextMgr files
BuildSystem: added cmake for above files
Note: these are still under development and NOT USABLE
should not effect anything now

--HG--
branch : trunk
2010-09-25 18:47:03 +02:00
Machiavelli
fec6143f42 Core/SocialMgr: Do not load recently deleted (but existant) characters to social (friend/ignore) lists.
Fixes issue #3870
Fixes issue #3610

--HG--
branch : trunk
2010-09-25 17:34:26 +02:00
Machiavelli
477b30a1ad Core/DBLayer: Fix a memory leak in Field class, properly clear buffer before repopulating it.
Fixes many issues (from wrong subnames on NPCs to absent GO/Creature spawns)
Thanks to Rat for helping find the issue

--HG--
branch : trunk
2010-09-25 13:12:12 +02:00
Machiavelli
62946f9ef6 Core/DBLayer:
- Rewrite KeepAlive method for DatabaseWorkerPool. Use mysql_ping instead of explicit select queries, and also schedule KeepAlives for asynchronous threads.
NOTE: While the function is implemented and previous keepalive calls were transformed, it´s possible the keepalive call will need to be placed in several other locations in the code. Please leave feedback on whether or not this fixes your timeout issues.

Update issue #4062

--HG--
branch : trunk
2010-09-25 01:05:24 +02:00
Machiavelli
154d11acc0 Core/DBLayer:
- Fix another pesky linux specific compile error. (Thanks to Derex/Aokromes)
- Fix a typo in an assertion. (Thanks to Derex/Aokromes)
- Add proper zero termination in SetStructuredValue to get rid of memory issues that arose in the last few commits.
- Fix a crash caused by vsprintf´ing std::string in SystemMgr::LoadVersion()

--HG--
branch : trunk
2010-09-25 01:02:40 +02:00
Machiavelli
09aeff1027 Core/DBLayer: Return proper connection handle from DatabaseWorkerPool<T>::GetConnection
Updates issue #4062
Updates issue #4058

--HG--
branch : trunk
2010-09-24 22:41:24 +02:00
Machiavelli
e3bf89b6f7 Core/DBLayer:
- Fix memory leak introduced in previous rev
- Fix linux compile, thanks to Playon for reporting

--HG--
branch : trunk
2010-09-24 22:36:35 +02:00
Machiavelli
3c6dc32030 Core/DBLayer:
- Rewrite Field class to be able to store both binary prepared statement data and data from adhoc query resultsets
- Buffer the data of prepared statements using ResultSet and Field classes and let go of mysql c api structures after PreparedResultSet constructor. Fixes a race condition and thus a possible crash/data corruption (issue pointed out to Derex, basic suggestion by raczman)
- Conform PreparedResultSet and ResultSet to the same design standards, and using Field class as data buffer class for both
* NOTE: This means the fetching methods are uniform again, using ¨Field* fields = result->Fetch();¨ and access to elements trough fields[x].
* NOTE: for access to the correct row in prepared statements, ¨Field* fields = result->Fetch();¨ must ALWAYS be called inside the do { }while(result->NextRow()) loop.
* NOTE: This means that Field::GetString() returns std::string object and Field::GetCString() returns const char* pointer.

Still experimental and all that jazz, not recommended for production servers until feedback is given.

--HG--
branch : trunk
2010-09-24 22:16:21 +02:00
Shauren
d8ddf38453 Core/Items: Implemented trading soulbound loot items
Core/DBLayer: Converted more more player-related queries into prepared statements
Core/Items: Fixed loading of enchantments

Closes issue #4130.

--HG--
branch : trunk
2010-09-21 21:55:16 +02:00
Machiavelli
ce2d4e9a20 Core/DBLayer: Correctly print relevant mysql prepared statement creation error to give the end-user an idea of what exactly went wrong (missing SQL updates are the culprit of creation failure 99% of the time)
--HG--
branch : trunk
2010-09-20 20:53:32 +02:00
Shauren
a509976369 Core/DBLayer: Converted player login queries into prepared statements
Core/DBLayer: Added missing implementation for SQLQueryHolder::SetPreparedQuery

--HG--
branch : trunk
2010-09-20 18:20:40 +02:00
click
907203fdd9 Core/DBLayer: Shuffle an #include-statement around (initialize mysql connections before working on the rest) - Fixes nonPCH-builds.
--HG--
branch : trunk
2010-09-19 17:53:45 +02:00
Shauren
97aeb251b8 Core/Players: Added support for single character bans
Core/Commands: Renamed .ban character to .ban playeraccount (.ban character will ban only the player, not account)

This revision reaches 10000, congratulations and thanks to everyone who contributed!

--HG--
branch : trunk
2010-09-19 17:02:14 +02:00
Machiavelli
019103cb5a Core/DBLayer: Correct size for storing MYSQL_TYPE_FLOAT
--HG--
branch : trunk
2010-09-19 15:28:35 +02:00
Machiavelli
22571e9443 Core/DBLayer:
- Allow storing floats in prepared statements explicitly (previously would be casted to double)
- Add GetBool ¨wrapper/hack¨ to PreparedResultset class.

--HG--
branch : trunk
2010-09-19 15:25:50 +02:00
Machiavelli
b50c931d6e Core/DBLayer: Move QueryHolder and BasicStatement operations to their own file and remove SQLOperation.cpp from revision control
--HG--
branch : trunk
2010-09-19 12:36:48 +02:00
Machiavelli
0982719f5f Core/DBLayer:
- Declare the datatypes used to determine transaction element data (prepared statement/adhoc query string) on a generic level in SQLOperation.h
- Implement variable SQL element data for SQLQueryHolder class so it can execute both prepared statements and adhoc queries
- Make MySQLConnection::Query for adhoc queries return pointer to type instead of an autopointer, the autopointer is now applied on higher level code just like the function for querying prepared statements

--HG--
branch : trunk
2010-09-19 12:16:29 +02:00
Machiavelli
12acb7dd8f Core/DBLayer: Fix syntax of some recently added prepared statements that might have caused statement creation failure on certain platforms
--HG--
branch : trunk
2010-09-19 10:40:10 +02:00
Machiavelli
27dd112c97 Core/DBLayer: Add an assert to trace down when a prepared statement creation has failed (99% it will be because of a bad query) - to prevent crashes at a later stage
--HG--
branch : trunk
2010-09-19 10:36:48 +02:00
silinoron
65a50ed3a2 Core/DBLayer: Some more prepared statements in ObjectMgr.
Core/ObjectMgr: Some additional cleanup.

--HG--
branch : trunk
2010-09-18 19:49:17 -07:00
silinoron
1e127eef73 Core/DBLayer: Change some regular statements to prepared statements.
Patch by thyros82@gmx.de.
Fixes issue #3774

--HG--
branch : trunk
2010-09-18 19:21:03 -07:00
linencloth
ae13e7354a Core/DBLayer: Fix a typo. Author: 41782992@qq.com
Fixes issue 4071.

--HG--
branch : trunk
2010-09-18 15:34:01 +02:00
Machiavelli
49dc1e55de Core/Utils: Fix a crash in vutf8printf. Author: Vladimir
--HG--
branch : trunk
2010-09-18 11:29:09 +02:00
Shauren
6ba1aec80c Core/Pools: Converted quest-related pool queries into prepared statements
--HG--
branch : trunk
2010-09-17 21:01:58 +02:00
click
726e5cf466 Buildsystem/Core: Add new build-flag WITH_SQLDEBUG - adds support for enabling/disabling SQL-query logging
--HG--
branch : trunk
2010-09-17 20:36:29 +02:00
linencloth
d8a854d6e0 Core: Cleanup locale handling.
It also fixes the recent problem of strange strings.

--HG--
branch : trunk
2010-09-17 07:04:29 +02:00
Shauren
102e51d620 Core/Pools: Implemented quest pooling
Core/DBLayer: Added GetNumRows() method to PreparedResultSet

--HG--
branch : trunk
2010-09-14 13:56:27 +02:00
Machiavelli
88f378e7ae Core/DBLayer: Fix a memory leak in prepared statement parameter/result binds. Original author: raczman
--HG--
branch : trunk
2010-09-13 17:07:27 +02:00
Shauren
e0ffae436c Core/Quests: Fixed remaining issues with quest crediting (note: previous commits did not introduce issues, only revealed them)
Core/DBLayer: Fixed more compile warnings
Core/Spells: Corrected code style from revision 634af79146

Closes issue #3956.

--HG--
branch : trunk
2010-09-12 19:17:58 +02:00
click
976cc3f8c4 Core/DBLayer: Make GCC happy (initialize variables in the correct order in ResultBind()
--HG--
branch : trunk
2010-09-12 18:52:06 +02:00
Machiavelli
123163dc41 Core/DBLayer: Check for potential mysql client/server version mismatch. Version mismatch may lead to undefined behaviour with prepared statements.
--HG--
branch : trunk
2010-09-12 15:57:36 +02:00
Machiavelli
bb8438c09b Core/DBLayer: Add GetCString method for PreparedResultSet (dynamic copy is responsibility of the high level code)
--HG--
branch : trunk
2010-09-12 15:11:08 +02:00
Machiavelli
6a4c798867 Core/DBLayer: Replace all ad-hoc queries in AuthSocket with prepared statements
--HG--
branch : trunk
2010-09-12 11:06:26 +02:00
Machiavelli
0612359f4b Core/DBLayer:
- Fix a crash related to prepared resultset bind buffering. Fixes issue #3975
- Implement 64bit int fetching functions for preparedresultset
NOTE: *Still* experimental, use at own risk.

--HG--
branch : trunk
2010-09-12 11:02:58 +02:00