Commit Graph

236 Commits

Author SHA1 Message Date
Machiavelli
a093408360 Core/Player: Convert _SaveAuras to prepared statement format
--HG--
branch : trunk
2010-12-18 23:25:03 +01:00
Machiavelli
1cdeb4d057 Core/Player: Change equipmentset saving to use prepared statements.
Update issue #4550
Please try to re-reproduce

--HG--
branch : trunk
2010-12-17 17:29:16 +01:00
Machiavelli
d38b171391 Core/DBLayer: CharacterDB query CHAR_LOAD_PLAYER_ACTIONS_SPEC should be synchronous. Fixes a crash introduced in bd30ad7bd3
--HG--
branch : trunk
2010-12-17 16:54:38 +01:00
Machiavelli
04e5be6276 Core/DBLayer: Add some garbage collection on DatabaseWorkerPool shutdown (deleting SQLOperation objects)
--HG--
branch : trunk
2010-12-17 16:02:09 +01:00
Machiavelli
cb08ec0d74 Core/DBLayer: Don´t prepare asynchronous statements on synchronous connections and vice versa. Prevents allocating RAM that will never be used.
--HG--
branch : trunk
2010-12-17 15:55:16 +01:00
azazel
b39b8fdd0d DB Schema/Characters: removed columns auctionhouse.item_template, character_inventory.item_template, guild_bank_item.item_entry and mail_items.item_template and created item_instance.itemEntry column instead of them.
As a side effect moved related queries to prepared statements.
As one more side effect fixed not shown and lost mail items in returned expired mail (patch by Quriq14).

--HG--
branch : trunk
2010-12-15 14:08:12 +06:00
Machiavelli
80494d8f64 Core/DBLayer: Fix a possible crash in ProcessQueryCallback functions.
Closes issue #5095

--HG--
branch : trunk
2010-12-14 20:16:09 +01:00
click
2642894342 Core: Add new system for parallelizing client packet processing. Handle WorldSession updates in Map::Update() where we are safe to proceed. Patch by Ambal.
(And clean up tabs and whitespace while rummaging around in there)
Closes issue 5084.

--HG--
branch : trunk
2010-12-13 22:37:56 +01:00
Machiavelli
d5f5fa59ab Add missing declarations as of recent merge
--HG--
branch : trunk
2010-12-13 17:34:27 +01:00
Machiavelli
451159cac4 Fix possible compile error under linux
--HG--
branch : trunk
2010-12-13 17:21:06 +01:00
Machiavelli
bd77fb6d47 Fix a typo, thanks to sss.nevan
--HG--
branch : trunk
2010-12-13 17:05:01 +01:00
Machiavelli
976225a9dd Core/DBLayer: Implement global ExecuteOrAppend methods to DatabaseWorkerPool for executing queries in a diverse context (transaction or non transaction) - instead of local to Guild.cpp
--HG--
branch : trunk
2010-12-13 16:27:14 +01:00
Machiavelli
426b28e344 Fix wrong vsprintf parameter added in merge.
--HG--
branch : trunk
2010-12-13 16:18:07 +01:00
Machiavelli
f1a73e89b8 Merge
--HG--
branch : trunk
2010-12-13 16:13:32 +01:00
Machiavelli
ea29d87dcc Backed out changeset: 8326a2411148
--HG--
branch : trunk
2010-12-13 09:18:49 +01:00
azazel
d2d62eab50 Cleanup: implemented helper methods for manipulating percentage calculation and used it where appropriate (plus fixed some other warnings).
NOTE: Initially I just wanted to fix some warnings, but noticed that there is no common method for percentage calculation and various formulas are used many time in the code making it difficult to read and understand what the code actually does. So, I introduced several template methods for calculating percent values and adding those values to the original base. I replaced all the raw calculations throughout the code where found, but I could have missed something or could have made a mistake. So, please report any strange behaviour after this commit.
If you ask me why I did it: for the sake of consistency and exact understanding what code means. If you see CalculatePct method, you clearly understand, that it find the value of x percent of y. And you can easily express, for example, spell behviour "reduces smth by x%" by the means of a method instead of recalling school maths.

--HG--
branch : trunk
2010-12-11 20:37:38 +06:00
click
7e0dee8cb1 Fix build
--HG--
branch : trunk
2010-12-10 01:44:34 +01:00
Machiavelli
cac0664150 Fix linux compile.
Closes issue #5044

--HG--
branch : trunk
2010-12-06 20:06:31 +01:00
Machiavelli
f35c85acbe Core/DBLayer: Optimization in transaction code, and prevent a crash and memleak on shutdown.
--HG--
branch : trunk
2010-12-06 19:52:37 +01:00
Machiavelli
988a6f5c93 Core/DBLayer: Simplify template usage for DatabaseWorker
--HG--
branch : trunk
2010-12-06 19:28:05 +01:00
Spp
408fce1de6 Core: Some optimizations
- Declare some functions const
- Fix some mem leak
- Fix some resource leak
- Remove unused variables and functions
- Remove duplicate functions
- Reduce the scope of some variables
- Remove unused file

--HG--
branch : trunk
2010-12-06 02:07:53 +01:00
Machiavelli
b845b9d0fd Core/DBLayer:
- Make time format of MaxPingTime consistent between authserver and worldserver. Note that the value is in minutes, update your config files accordingly if needed.
- Remove obsolete atomic uint32 and prevent concurrent calls to vector::size() in DatabaseWorkerPool

--HG--
branch : trunk
2010-12-05 16:48:47 +01:00
Machiavelli
82ccfa9830 Really fix nonPCH build. With thanks to Aokromes
--HG--
branch : trunk
2010-12-04 23:42:23 +01:00
Machiavelli
533f27e732 Core: Fix non-PCH build (sorry)
--HG--
branch : trunk
2010-12-04 23:14:37 +01:00
Machiavelli
f5d6319d4d Core/DBLayer:
- Make the mysql connectionpool shared for async and syncrhonous connections.
- Allow configurable amount of connections for the pool
- Allow configurable amount of delaythreads
Note that delaythreads now only represent in-core threads. Whenever they execute a task they will pick a free connection from the pool instead of using their previously unique assigned connection.
The purpose of this design change is better distribution of SQL requests (no bottlenecks paired with idling) among available resources.
This also prevents a ¨memory waste¨ of preparing async prepared statements on synchronous connections (that were never called) - and vice versa. Now, connections aren´t explicitly async or synchronous, they serve both purposes.

Use at own risk, might cause instabilities.
Don´t forget to update your config files and clear your cmake cache.

--HG--
branch : trunk
2010-12-04 21:50:36 +01:00
click
bc098658c6 Core/Chat: Configure automatic owner declaration for custom chat channels (patch by leak)
Closes issue 4974.

--HG--
branch : trunk
2010-12-02 03:54:52 +01:00
Spp
6b5ff1ca25 Core: Fix some warnings
--HG--
branch : trunk
2010-11-22 10:10:46 +01:00
Machiavelli
733b72d29c Core/DBLayer: Add method DirectExecute for synchronous execution of prepared statements (without resultset)
Author: [M]axx

--HG--
branch : trunk
2010-11-21 18:50:11 +01:00
click
5cd3904059 Core/DBLayer: Move tables reserved_name, gameobject_respawn and creature_respawn from WORLD database to CHARACTER database as it's content is realm-specific and should be preserved (thanks to leak for the cleanup)
*** TO PRESERVE (COPY) THE DATA CONTAINED IN THE OLD TABLES, YOU MUST FOLLOW THE FOLLOWING SQL-RECIPE (REPLACE DATABASENAMES WHERE NEEDED!) ***

-- Move creature_respawn from world to characters db
INSERT INTO `characters`.`creature_respawn` (`guid`, `respawntime`, `instance`)
SELECT `guid, `respawntime` `instance` * FROM `world`.`creature_respawn`;
-- Remove creature_respawn table from world db
DROP TABLE `world`.`creature_respawn`;

-- Move gameobject_respawn from world to characters db
INSERT INTO `characters`.`gameobject_respawn` (`guid`, `respawntime`, `instance`)
SELECT `guid`, `respawntime`, `instance` FROM `world`.`gameobject_respawn`;
-- Remove creature_respawn table from world db
DROP TABLE `world`.`gameobject_respawn`;

-- Move reserved names from world to characters db
INSERT INTO `characters`.`reserved_name` (`name`)
SELECT `name` FROM `world`.`reserved_name`;
-- Remove reserved_names table from world db
DROP TABLE `world`.`reserved_name`;

*** THE ABOVE MUST BE DONE, OR EXISTING INSTANCES WILL BE FULLY RESPAWNED - YOU HAVE BEEN WARNED ***
Closes issue 4842. Closes issue 4849.

--HG--
branch : trunk
2010-11-19 15:53:14 +01:00
click
67fade84d3 Core/Commands: Enable SQL query logging by config and command )patch by leak)
Closes issue 4853.

--HG--
branch : trunk
2010-11-19 13:13:07 +01:00
click
67cd8d18e1 Core/Utilities: Fix ACE gettimeofday(); issue whe compiling without PCH on Windows platforms (thanks to leak)
--HG--
branch : trunk
2010-11-18 23:37:49 +01:00
click
b2f3b3d329 Core: Use portable ACE-methods to do millisec time-value calculation (patch by SilverIce)
(also avoids some unsafe code on non-Windows platforms)

--HG--
branch : trunk
2010-11-08 17:24:16 +01:00
Rat
57661c6d54 Core/SmartAI: swap menuid/actionid params in GOSSIP_SELECT event
- use proper sql ORDER to order script lines

--HG--
branch : trunk
2010-11-04 22:08:15 +01:00
Machiavelli
05a292633c Core/DBLayer:
- Fix a race condition in KeepAlive() when connections are using mysql context when ping is called.
- Don´t wait for locks to be released on a connection when pinging, this means the connection is not idle and locking is redundant.

Patch by admin@****.net

Fixes issue #4599

--HG--
branch : trunk
2010-10-31 10:55:29 +01:00
Rat
5cb119e617 Core/AI: implemented SmartScripts System (still beta) not 100% complete
WARNING: Use scripts at own risk. You were warned.
NOTE0: creature, gameobject, areatrigger type scripts should be fully functional
NOTE1: has no effect on any core related stuff if not using any SmartScript
NOTE2: all event/action/etc descriptions can be found in SmartScriptMgr.h

SmartScripts is a reloadable DB-Sript system, with full control for special scripting,
like escorting, following, complex combat handling, pre-stored AI templates(caster, turret, etc) and much more
with a total of 66 events, 78 actions, 22 target types, and can be easily extended

--HG--
branch : trunk
2010-10-27 21:01:47 +02:00
Rat
62739ed26f Core/AI: implemented basic class for GameObjectAI
--HG--
branch : trunk
2010-10-23 23:31:37 +02:00
click
ea847598d0 Buildsystem: Add initial support for Intel C++ Compiler (patch by Leak)
Note: Intel C++ Compiler for Windows is not supported in this change
Closes issue 4361

--HG--
branch : trunk
2010-10-21 22:00:12 +02:00
linencloth
d9d1ec3670 Core: optimize string splitting
- Mainly affects item loading performance
  - Reduces guild loading time a lot

--HG--
branch : trunk
2010-10-21 16:56:51 +02:00
Xanadu
1e101ed785 Core/Utils: Fixed some unsafe calls to utf8 translation functions.
--HG--
branch : trunk
2010-10-17 20:35:11 +02:00
azazel
c0faed2251 Core/Guilds: guild code was completely refactored and rewritten.
* OOP desing and implementation;
* all the queries are moved to prepared statements;
* guild loading is optimized;
* all the possible interaction with guild's data is done inside the guild class;
* added more hooks to GuildScript class;

WARNING: Make sure you backup your characters database before applying this change (just in case).

Known problems with guilds:
* when new member is added to the guild, MOTD is not displayed for him in guild tab of social window;
* if you add item with random property to guild bank visual representation of item below it becomes wrong (it displays wrong stack number);
* packets order differs from official: currently guild bank packet traffic is twice as more than on offy.

--HG--
branch : trunk
2010-10-17 19:54:13 +06:00
azazel
3bd1ee0665 Fix most of the recently introduced warnings
--HG--
branch : trunk
2010-10-16 13:32:30 +06:00
click
0509a780c8 Core/Entities: Ensure that pets retain their XP-points when dismissed in any form or way (outrunning/riding/mounting/flying)
Also clean up the logic a bit - pet stats initialization initializes hp/mana/powers on pets, while they should only be initialized/changed on pet call/creation.
Fixes issues 4284

--HG--
branch : trunk
2010-10-10 01:03:21 +02:00
click
613b81f36f REALLY fix the CRLF-crap...
--HG--
branch : trunk
2010-10-07 15:54:07 +02:00
click
f0c4241ea4 Remove the accidental additions of CRLF-crap from the header updates
--HG--
branch : trunk
2010-10-07 15:35:36 +02:00
click
dd29d9e422 More copyright header updates (will this ever end?)
--HG--
branch : trunk
2010-10-07 14:50:05 +02:00
click
a67d7c9afd Copyright header updates - part 3... (and some whitespace cleanups)
--HG--
branch : trunk
2010-10-07 14:00:52 +02:00
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