Commit graph

222 commits

Author SHA1 Message Date
Schmoozerd
314c448a3d [12023] Enable SQL-Storage to work with entries of value zero 2012-06-25 21:12:44 +02:00
Schmoozerd
969c10a8d9 [11999.5] Support loading tables with default filling into SQL-Loader
* Add special field markers to fill a column in SQLStorage with default values
* Add a safeguard to DBCStorage::EraseEntry, Add helper function DBCStorage::InsertEntry to store content

Note: If required similar adjustments to DBCStorage might be reasonable if required
2012-06-12 23:09:16 +02:00
zergtmn
c6a751134c [11928] Some warning fixes 2012-02-16 20:32:17 +06:00
Schmoozerd
8068dcf6dd [11875] Update Copyright notice to year 2012
Start timemachine and a Happy new year to all!
2012-01-16 17:43:59 +01:00
Vinolentus
63f9e43385 [11835] Fix SqlStatement::addBool
MYSQL_TYPE_BIT is not one of the allowable input values, so we have to pass it using an integer variable

Signed-off-by: SilverIce <slifeleaf@gmail.com>
2011-10-25 20:41:01 +03:00
stfx
09e331767d [11833] remove trailing whitespaces
Signed-off-by: SilverIce <slifeleaf@gmail.com>
2011-10-18 15:17:54 +03:00
VladimirMangos
a0ff5f4536 [11736] Hide passwords from logs
* DB connection
* chat/console password changes commands.
2011-07-13 05:40:02 +04:00
VladimirMangos
c870ef324d [11590] Cleanups for barGoLink
* Rename barGoLink -> BarGoLink as expected by mangos code style
* Add uint32/uint6 constructor versions for BarGoLink,
  and remove lot casts required before for BarGoLink use
2011-06-03 12:02:49 +04:00
Ambal
43db4eaaa2 [11305] more safe code in vmaps and Field class
Signed-off-by: Ambal <pogrebniak@gala.net>
2011-04-02 17:31:13 +03:00
zergtmn
37fd225a89 [11292] Strip trailing whitespace after [11284] 2011-03-27 23:40:42 +06:00
Ambal
40ef9cbf2f [11284] Implement prepared statements for INSERT+DELETE+UPDATE SQL requests. Should improve player save performance + lower MySQL server CPU usage.
Note: PostgreSQL does not have prepared statements implemented using native APIs.

Huge thanks to Undergarun, kero99 and Vinolentus.

Signed-off-by: Ambal <pogrebniak@gala.net>
2011-03-25 22:17:59 +02:00
zergtmn
df89544baa [11261] Get rid of two const_casts by storing const char* instead of char* 2011-03-17 12:17:31 +05:00
Vinolentus
a6bab82c72 [11248] Clarify and check DBC/SQL storage format field types.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2011-03-15 02:55:10 +03:00
cipherCOM
c9942fb0cc [11166] Removed old autoconf files
(based on cipherCOM's repo commit 7b5a932)
2011-02-14 12:56:11 +03:00
VladimirMangos
ad29153ee0 [11118] Not report empty world_template as error. 2011-02-08 04:40:16 +03:00
VladimirMangos
b120464db7 [11111] Missing end lines in 2 files. 2011-02-07 00:57:11 +03:00
Ambal
49810598c6 [11063] Convert Database::DirectExecute() method to more effective form due to change [11061].
Signed-off-by: Ambal <pogrebniak@gala.net>
2011-01-22 02:25:44 +02:00
Ambal
fce48282ad [11061] Bring 'autocommit' mode for MySQL back. This MySQL feature operates in so frustrating way so it is better to keep it ALWAYS ENABLED!!!
Signed-off-by: Ambal <pogrebniak@gala.net>
2011-01-21 23:45:59 +02:00
Ambal
d67219e327 [11059] Fix crash in [11054]. As it turned out - we use not only async transactions but async queries too during server startup =/
Signed-off-by: Ambal <pogrebniak@gala.net>
2011-01-21 22:11:35 +02:00
Ambal
07c9f0cbb8 [11054] Do not allow async transaction execution while server is loading. Call Database::InitDelayThread() function explicitly to create async DB worker thread after server initialization is complete.
Signed-off-by: Ambal <pogrebniak@gala.net>
2011-01-20 23:46:51 +02:00
Ambal
e6e7bf8573 [11053] Process all SQL requests upon SqlDelayThread object destroying which might have been added while thread was stopping.
Signed-off-by: Ambal <pogrebniak@gala.net>
2011-01-20 23:06:38 +02:00
Ambal
4ddedf0804 [11049] Fix mangos and SD2 compilation after commits [11045] and [11047].
Signed-off-by: Ambal <pogrebniak@gala.net>
2011-01-19 23:50:40 +02:00
Ambal
631ce36680 [11045] Rewrite internals of DB layer. Simplify code and use less locking. Spawn and use separate connections for sync and async DB requests. Implement database connection pool for SELECT queries. Up to maximum 16 connections supported. Disable 'autocommit' mode for MySQL.
UPDATE YOUR CONFIGS!

Defaults:
LoginDatabaseConnections = 1
WorldDatabaseConnections = 1
CharacterDatabaseConnections = 1

If you are not using <mtmaps> patch do not change the default settings - this is useless. You can try following option in your MySQL config to squeeze even more performance from your DB:

[mysqld]
transaction-isolation = READ-COMMITTED

Great thanks to Undergarun, kero99 and selector for making tests and providing very useful feedback and DB statistics! Have fun :)

Signed-off-by: Ambal <pogrebniak@gala.net>
2011-01-19 22:05:20 +02:00
Ambal
b89e531fee [10982] Optimize memory usage of Field class used in DB code. Should also slightly speedup server startup time.
Signed-off-by: Ambal <pogrebniak@gala.net>
2011-01-07 18:54:06 +02:00
VladimirMangos
bf0ecf6e71 [10947] Update copyright notice for 2011 year. 2011-01-01 20:33:43 +03:00
Ambal
b11820593c [10924] Send time diff between Update() calls for object - should help with mob respawn on inactive grids etc. Based on patches by VladimirMangos and cipherCOM. All issues from previous patches should be finally fixed now.
Signed-off-by: Ambal <pogrebniak@gala.net>
2010-12-27 22:27:20 +02:00
Ambal
af66b470a8 [10865] Make DB code thread-safe. Original patch by Machiavelli and Kero99.
Signed-off-by: Ambal <pogrebniak@gala.net>
2010-12-12 11:34:57 +02:00
VladimirMangos
80712b928a [10825] Move specific SQLStorage defines to game dir
This let have in shared dir only generic declarations of class SQLStorage
Not game specific details.
2010-12-05 03:29:11 +03:00
VladimirMangos
abc6dfca98 [10792] Fixed warnings and need in redundent char* casts in database access code. 2010-11-29 00:47:11 +03:00
VladimirMangos
0c8a7c3826 [10788] Replace bytes in single field bytes2 by independent fields for creature_addon. 2010-11-27 23:56:08 +03:00
alien
9460ed0494 [10787] Add explicitly header dependences for Database/QueryResult.h
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-11-27 22:59:46 +03:00
narma
06b382abb9 [10772] Fixed build for different PostgreSQL version at diff platforms.
* Fixed Problem in different place define OID enums.
  Enums hardcoded in mangos code now as done for many other projects using PostgreSQL

* Other PostgreSQL detection fixes.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-11-22 02:00:20 +03:00
VladimirMangos
10d3d3ce24 [10692] Fixed some GCC warnings and code errors.
Thanks to freghar for provide cleaned list of warning messages.
2010-11-07 21:30:55 +03:00
VladimirMangos
315da014af [10685] Fixed creature_template loading after vendor changes.
Thanks to insider42 for problem research.
2010-11-05 22:04:45 +03:00
VladimirMangos
0bf8b0aa79 [10679] New table npc_vendor_template for comon item data for diff vendors.
In vendor list show own vedor items + template ites if any.
Vendor template item lists selected by id stored in creature_template.vendor_id
2010-11-04 20:22:47 +03:00
narma
5dbb561b50 [10451] Replace ASSERT by MANGOS_ASSERT
Signed-off-by: Laise <fenrisse@gmail.com>
2010-09-07 14:27:30 +03:00
VladimirMangos
acd0716297 [10432] Rename ASSERT -> MANGOS_ASSERT and related fixes
ASSERT hard use in predictable way because diff. 3rd party libs code
redefine it inf different ways and hard make sure that used in end
of mangos define version. This is real detected problem make some
expected assert checks ignored and so bugs not detected as expected from code.

In addition made related changes:
* Common.h header expected to be first include in any src/game/header except most simple cases.
* Related FILE.h header expected to be first include in FILE.cpp
* Fixed some absent includes and type forwards for safe build without PCH enabled.
* Avoid using MANGOS_ASSERT in src/framework code
2010-09-02 05:13:16 +04:00
NoFantasy
d0df25fd8c [10381] Implement generic system for racial model selection
Table creature_model_info store creature entry to use model from (or explicit model). The selection is based on a base modelId and racemask.

Hacks for shapeshift models removed (data included in SQL update)
Dropped no longer needed creature_model_info.modelid_other_team, as creature_model_info can and should be used instead (sorry, this is what happen when author doesn't do full research :) )

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-08-19 16:58:53 +02:00
VladimirMangos
acdaac3587 [10370] Rename UnorderedMap.h -> UnorderedMapSet.h 2010-08-18 04:54:25 +04:00
NoFantasy
25d9fd265b [10293] Correct a not exitan...non-existin... a word that is often spelled wrong
Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-07-30 18:26:08 +02:00
NoFantasy
2ae0badf48 [10289] Adjust creature models system
This change will:
* make it easier to use cached data directly without any modifications
* correct issues regarding invisible models
* simplify certain aspects of model selection itself and make it somehow easier to control and maintain special cases.

Two new fields added to creature_model_info, to store modelid_alternative and modelid_other_team
* _alternative holds an alt. model, for cases where gender are the same, or is not male/female.
* _other_team is generally used for totem models, but may have future use.

This commit will possibly break a few things (visually) and will require DB projects to update their creature_template models data.
It is advised to use cache data as-is, and in addition fill creature_model_info for certain models, totems in particular, for expected appearance.

Signed-off-by: NoFantasy <nofantasy@nf.no>
2010-07-30 16:40:17 +02:00
VladimirMangos
d81c9175d8 Update build checks for mangosd/realmd. 2010-07-02 05:34:27 +04:00
Grinder
f244e68c59 [10102] Rename loginDatabase for consistence with other global db object names
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-06-24 02:55:26 +04:00
VladimirMangos
1eed65d5ac [10082] Drop now unused dotconfpp lib code. 2010-06-20 02:20:51 +04:00
VladimirMangos
e431ab55cc [10025] Fixed unexpected C++ code parsing with *FILTER_LOG in 'if' 2010-06-03 16:47:17 +04:00
Patman128
2ee1bb5219 [9906] More user friendly output at DB version check fail.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
2010-05-16 03:03:25 +04:00
tomrus88
ff2cda6af1 [9861] Backporting some code chnages from 400 branch.
(based on 400's commit 0f37423)
(based on 400's commit 636cfef)
(based on 400's commit 0bbe3a7)
(based on 400's commit ce86b56)
(based on 400's commit b74c6a8)
2010-05-10 23:45:49 +04:00
VladimirMangos
722135b326 [9838] More log filters and macro uses.
* LogFilter_Weather
* LogFilter_PeriodicAffects
* LogFilter_PlayerMoves
* LogFilter_SQLText
* LogFilter_AIAndMovegens
* LogFilter_PlayerStats
2010-05-05 18:46:10 +04:00
VladimirMangos
48254e3879 Cleanups in instance_template and map entrance DBC data. 2010-04-17 15:24:49 +04:00
VladimirMangos
43cc07fbbc Possibility drop (hide infact) records from DBStore/SQLStorage. 2010-04-17 14:56:46 +04:00