Commit Graph

440 Commits

Author SHA1 Message Date
Machiavelli 1ee7196ec0 Core/DB Layer: Fix helgrind errors on some concurrent access to resultset auto pointers.
Example:
==8753== Possible data race during read of size 8 at 0x2e803e60 by thread #8
==8753==    at 0xDD0FFC: PreparedResultSet::operator[](unsigned int) const (QueryResult.h:83)
==8753==    by 0x131D82D: WorldSession::HandleCharEnum(Trinity::AutoPtr<PreparedResultSet, ACE_Null_Mutex>) (CharacterHandler.cpp:217)
==8753==    by 0x118F8C3: WorldSession::ProcessQueryCallbacks() (WorldSession.cpp:1087)
{..}
==8753==  Address 0x2e803e60 is 0 bytes inside a block of size 16 alloc'd
==8753==    at 0x4C28B75: operator new(unsigned long) (vg_replace_malloc.c:261)
==8753==    by 0x137D515: __gnu_cxx::new_allocator<Field*>::allocate(unsigned long, void const*) (new_allocator.h:92)
==8753==    by 0x137D378: std::_Vector_base<Field*, std::allocator<Field*> >::_M_allocate(unsigned long) (in /home/aokromes/bin/bin/worldserver)
==8753==    by 0x137CEC6: std::vector<Field*, std::allocator<Field*> >::_M_fill_insert(__gnu_cxx::__normal_iterator<Field**, std::vector<Field*, std::allocator<Field*> > >, unsigned long, Field* const&) (vector.tcc:416)
==8753==    by 0x137CB27: std::vector<Field*, std::allocator<Field*> >::insert(__gnu_cxx::__normal_iterator<Field**, std::vector<Field*, std::allocator<Field*> > >, unsigned long, Field* const&) (stl_vector.h:944)
==8753==    by 0x137C964: std::vector<Field*, std::allocator<Field*> >::resize(unsigned long, Field*) (stl_vector.h:632)
==8753==    by 0x137BFCA: PreparedResultSet::PreparedResultSet(st_mysql_stmt*, st_mysql_res*, unsigned long, unsigned int) (QueryResult.cpp:98)
==8753==    by 0x137A12B: MySQLConnection::Query(PreparedStatement*) (MySQLConnection.cpp:493)
==8753==    by 0x137F663: PreparedStatementTask::Execute() (PreparedStatement.cpp:412)

Have a feeling this is a false positive, though. Nevertheless good to get rid of.
2012-03-27 13:33:02 +03:00
Machiavelli 88d81d27cf Core/DB Layer: - Fix "Thread #1 unlocked a not-locked lock at 0x6D56E90" helgrind error (thanks to Aokromes for logs). Cause was unlocking MySQL connection on shutdown, but concurrent access at this point is not required.
- Remove redundant locking in PingOperation. Since these are delayed to async threads with their own MySQL connection, no concurrent access here either.
- Codestyle cleanup
- Documentation refining
2012-03-27 11:50:03 +02:00
click 6afaed4a02 Core: Remove the MersenneTwiser-library (SFMT is now considered stable enough for full deployment) 2012-03-27 02:27:12 +02:00
leak 830a7fb08b Core/DBLayer: Restore pet loading
closes #5878
2012-03-26 18:58:24 +02:00
leak b1ca1ee5ec Core/DBLayer: Convert PAppend() queries to prepared statements No.4 NOTE:
Most of the cores queries have been converted to prepared statements now. If your code contains queries, please either use the exiting or implement new statements.
The only exclusions are one-time queries (e.g. for core startup) and queries that can't be prepared due to limitations.
2012-03-26 15:47:37 +02:00
Machiavelli e960016dc4 Partial revert of "Core/DB Layer: Fix a memory leak.", mysql library related stuff. Original memory leak fix is still in place. 2012-03-26 13:33:47 +02:00
Machiavelli 70ee37f3b4 Core/DB Layer: Fix a memory leak for synchronously executed prepared statements. 2012-03-26 08:58:21 +02:00
Machiavelli 43048afc7e Core/DB Layer: Fix a memory leak. 2012-03-26 08:29:41 +02:00
kaelima 19f821d00a Auth/Realmlist: Make use of RealmFlags and rename color to flag (core- and dbwise)
Also fix connecting with realmflag & 4
2012-03-26 05:14:10 +02:00
Machiavelli 3f61bd0a26 Core/DB Layer: Make SQLTransaction AutoPtr thread safe (valgrind caught a race condition) 2012-03-26 02:56:43 +03:00
Machiavelli fa1d3f305b Core/Misc: Implement Trinity::Auto_Ptr. Ditches ACE_Refcounted_AutoPtr (we strongly suspect it does NOT clean up the underlying pointer properly). Underlying type is now ACE_Strong_Bound_Ptr 2012-03-25 21:21:23 +02:00
leak eb1af30399 Core/DBLayer: Convert PAppend() queries to prepared statements No.3 2012-03-25 20:20:25 +02:00
leak 71c02fb54d Core/DBLayer: Convert PAppend() queries to prepared statements No.2 2012-03-25 18:32:26 +02:00
leak 4e6fce1112 Core/DBLayer: Typo on query conversion 2012-03-25 16:34:09 +02:00
leak c6cbe4c77c Core/DBLayer: Convert PAppend() queries to prepared statements No.1 2012-03-25 16:25:06 +02:00
Machiavelli eda06321b9 Update src/server/shared/Database/Field.h 2012-03-25 14:11:24 +03:00
Machiavelli 87176c84d3 Core/DBLayer: Refine field type checks in Field::GetXXX methods. Should give us logs of wrong GetXXX calls for a certain type without having to dig trough valgrind logs. 2012-03-25 14:10:06 +03:00
leak 61691d7698 Core/DBLayer: Restore pinfo timestamp output (Prepared statment results don't deliver TIMESTAMP as string) 2012-03-25 00:00:16 +01:00
click cbcd4e6afb Core: Fix .pinfo handling of player level and securitylevel after recent cleanups (and clean up my last commit) 2012-03-24 22:59:23 +01:00
click eb3305932c Core/DB layer: Change functionality in previous memoryleak-fix (Patch by raczman) 2012-03-24 22:34:33 +01:00
Machiavelli 0eb3ffca41 Core/DB Layer: Fix a memory leak. Author: raczman (yes, you read correctly) 2012-03-24 19:24:36 +01:00
leak 47a597d406 Core/DBLayer: Query should actually be available on both sync and async mysql connections 2012-03-24 17:32:00 +01:00
leak cddf1dcf03 Core/DBLayer: Prepare statement on the right connection
fixes #5862
2012-03-24 14:54:24 +01:00
leak 12e55a04bb Core/DBLayer: Convert PQuery() queries to prepared statements 2012-03-24 01:25:08 +01:00
leak 4665d5bfc4 Core/DBLayer: Remnant cleanups 2012-03-19 18:09:14 +01:00
leak 178c658363 Core/DBLayer: Convert DirectExecute() queries that are not runtime relevant back to regular queries 2012-03-19 18:09:13 +01:00
leak 847b4366f3 Core/DBLayer: Convert PExecute() queries to prepared statements 2012-03-19 16:48:08 +01:00
click 593d003b7c Core. Fix non-PCH build 2012-03-09 21:53:47 +01:00
leak 700203ad1e Core/Shared: Add thread-safe access to BigNumber::AsByteArray()
fixes #5469
2012-03-06 17:22:58 +01:00
click 45946e23ba Core: Adjust parameter output values to avoid excessive warning outputs on GCC and some other minor warnings 2012-03-04 21:38:57 +01:00
leak 33a04897de Core/Shared: Remove unused functions 2012-03-04 15:19:53 +01:00
Shauren 03a7a80687 Core/Packets: Fixed exceptions being incorrectly thrown when appending empty strings to packets
Closes #5486
Closes #5495
2012-02-29 20:12:11 +01:00
teyrnon 8e18726b69 Update src/server/shared/Packets/ByteBuffer.h 2012-02-29 15:09:51 +02:00
Shauren 7eff1c8f53 Core: Build fix (for real this time) and warning fix 2012-02-29 12:02:28 +01:00
Shauren 77c848b937 Fixed build broken in 218ed813d0 2012-02-28 23:03:38 +01:00
Machiavelli 218ed813d0 Core/Misc: Add more extensive ByteBuffer exceptions to trace down seemingly random crashes. 2012-02-28 14:51:50 +01:00
Machiavelli b2e4f8f958 Core/Misc: Add some documentation to TRINITY_WRITE_GUARD and TRINITY_READ_GUARD because ACE's documentation on underlying objects is not clear. 2012-02-26 15:16:22 +01:00
click e615fba7f8 Revert "Core: Fix the SFMT randgen-initbug" - alignment-fix is now properly handled within the respective code
This reverts commit 28310f0938.
2012-02-25 20:39:28 +01:00
Shauren 6ce46624d2 Core/Calendar: Fixed crash happening when inviting an offline player to an event 2012-02-25 11:14:19 +01:00
Elron103 28310f0938 Core: Fix the SFMT randgen-initbug
Signed-off-by: click <click@gonnamakeyou.com>
2012-02-25 02:16:08 +01:00
leak 08268d2430 Core/Warden: Update copyright information / More cleanups 2012-02-20 14:31:26 +01:00
leak 8e3a4b956e Core/Warden: Base implementation for Warden functionality
Note: The default config file action for clients failing the checks can be changed for each check via the characters.warden_action table

Credits to TOM_RUS
2012-02-19 13:51:16 +01:00
click 5411e1ce52 Core: Clean up whitespace and tabs in the base sourcetree 2012-02-18 16:52:08 +01:00
leak ca8862a21a Core/DBLayer: Remove unused struct 2012-02-15 19:00:40 +01:00
Subv 8a72aede16 Codestyle: Renamed some variables to fit codestyle, corrected order in structure/class fields to match alignment (they use slightly less memory now)
Signed-off-by: Subv <s.v.h21@hotmail.com>
2012-02-14 12:46:26 -05:00
leak 0fbb86f221 Core/DBLayer: Restore removal and cleanup of respawn times of expired instances 2012-01-30 00:31:06 +01:00
click e6d5b21778 Core: Fix non-PCH build and remove a few warnings. 2012-01-24 00:24:39 +01:00
Subv2112 f4075f0f94 Core/LFG:
Fix priority of the player when its added to the lfg group
        Better implementation of the Dungeon Deserter debuff
        Rewrite the NeedBeforeGreed loot
        Fixed players being shown as Unknown Entity when entering the lfg group
        Some incremental optimizations after original patch
Thanks to Retriman and Paecman for base implementation

Signed-off-by: Machiavelli <machiavelli.trinity@gmail.com>
2012-01-14 17:37:28 +01:00
Machiavelli dbbac0bdaa Core/Movement: Implement spline movement subsystem.
Spline movement controls movements of server-side controlled units (monster movement, taxi movement, etc).
Proper implementation of effects such as charge, jump, cyclic movement will rely on it.
However, need improve our states system before.

Technical changes:

* Added linear, catmullrom and bezier3 splines which based on client's algorthims. They can be reused for proper transport position interpolation.
* Precission increased. There are no more position desync issues since client's position calculation formulas used.
* Now possible to move by paths with multiple points, send whole path to client.

--
Original author of research and implementation: SilverIce. Massive kudos.
Original port for Trinity (ref #4629) Chaplain and Venugh
With the following incremental fixes during my review:

- Restore flightmaster end grid pre-loading
- Fix uninitialized Creature::m_path_id
- Add missing trinity_string entries for .movegens command
- Fix a bug in WaypointMovementGenerator that would trigger unexpected pausing at waypoints for various amounts of time

Known issues:
- Errors like WaypointMovementGenerator::LoadPath creature XXX (Entry: YYYYY GUID: ZZZZZZ) doesn't have waypoint path id: 0.
This is caused by bad DB data. This commit didn't "break" it.

Do not forget to re-run CMake before compiling.
2012-01-14 15:36:07 +01:00
Shauren 0c2dd2dc7f Core/Events: Fixed crash when loading character_queststatus_seasonal 2012-01-06 14:57:01 +01:00