Commit Graph

446 Commits

Author SHA1 Message Date
Shauren
7cb72c2aac Core/DBLayer: Fixed an incredibly rare memory leak happening when player started loading from database and never finished 2014-08-16 01:43:42 +02:00
joschiwald
ccfa82e7d5 Core/Creature: update creature_template and some other small things
http://www.trinitycore.org/f/topic/9572-creature-damage/
2014-08-14 16:09:14 +02:00
leak
528baae5f7 Kill potentially uninitialized variable warning 2014-08-11 14:03:16 +02:00
leak
14cb6e4235 Resolve shutdown crash/leak if MySQL server is not running
Fixes #12734
2014-08-10 22:43:48 +02:00
DDuarte
df3b08d140 Core/Server: Use nullptr instead of 0 where pointers are expected 2014-08-09 21:32:26 +01:00
DDuarte
a394205eca Core/Server: Add missing overrides 2014-08-09 20:17:40 +01:00
DDuarte
cb453fa093 Core/Shared: Fix world and auth crash on shutdown (PCQ & DbWorker)
Fixes #12704
2014-08-02 19:30:55 +01:00
joschiwald
04bb78f6c3 Scripts/OutdoorPvP: replaced some chat texts with proper defense messages 2014-07-29 23:45:34 +02:00
Shauren
e1c400250c Added comments to 6961f957c9 to make sure noone decides that storing the result in a variable is unneccessary 2014-07-26 16:14:18 +02:00
Shauren
6961f957c9 Core/DBLayer: Fixed possible crashes with async queries retrieving result
Closes #12655
2014-07-26 16:10:05 +02:00
Subv
a03c879565 Core/PreparedStatements: Fixed a change I missed in the World prepared statements for waypoints. 2014-07-25 20:18:43 -05:00
Subv
b5d025938e Core/Waypoints: Allow the table waypoint_data to use Takeoff and Land waypoints. 2014-07-25 19:05:25 -05:00
leak
5b0898b33c Core/DatabaseWorkerPool: Delete PCQ in dtor rather than in Close() and cancel queue properly before doing so 2014-07-21 20:12:44 +02:00
Sebastian Valle Herrera
eae97c7bc8 Core/PreparedStatements: Fixed a Coverity warning 2014-07-21 13:01:11 -05:00
Vincent-Michael
946ab3e8b7 Core: Kill again whitespace :( 2014-07-21 18:14:22 +02:00
Shauren
7532864264 Buildsystem/MSVC: Warning fixes
C4800 'type' : forcing value to bool 'true' or 'false' (performance warning)
C4127 conditional expression is constant
2014-07-17 15:42:57 +02:00
Subv
87f830ca89 Fix a warning about abstract class not having a virtual destructor 2014-07-13 15:17:13 -05:00
leak
d1594998f8 Replaced the LogWorker thread with Boost ASIO 2014-07-08 20:55:25 +02:00
Subv
87b72f41ca Fixed login and some errors 2014-07-02 21:56:40 -05:00
Subv
b2657a809d Fixed the authserver compile 2014-07-01 20:40:56 -05:00
leak
029bad6698 Replaced all remaining ACE based Singletons
Replaced ACE base AutoPtr class with shared_ptr
Note: worldserver currently broken due to MapUpdater threading failure (ACE ofc, what else could it be)
2014-07-01 00:54:09 +02:00
leak
d39a013b6b Replaced ACE_Task_Base based DatabaseWorker with PCQ
Note: Not exactly sure how shutdown should be handled, currently the queue clears itself out before shutting down
This might need to be changed if the queue should be fully processed before being deleted
2014-06-30 18:37:23 +02:00
Subv
f03d49705d Core/Databases: Removed ACE dependencies on some of the database handling code. 2014-06-24 13:17:41 -05:00
Subv
0db743c4ff Merge branch 'master' of github.com:TrinityCore/TrinityCore into boost
Conflicts:
	src/server/authserver/Server/AuthSession.cpp
	src/server/game/Server/WorldSession.h
	src/server/shared/Packets/ByteBuffer.cpp
	src/server/shared/Utilities/Util.h
2014-06-23 16:35:54 -05:00
leak
33dc72a812 Replaced Threading and SFMT access related code with std::thread and boost TSS
Note: The remote access thread is currently broken due to unknown ACE fail (will be replaced at some point anyways..)
2014-06-21 19:39:16 +02:00
Ascathor
6949735098 Core/Misc:
* Fix some codestyle, fix some typos

* Change CMakeLists for: Custom (can be uncommented), Events, World
** Custom is theoretically unchanged. You can, however, uncomment the glob_recurse that initializes every file within. This might be easier for beginners.

* Introducing the IP Based Action Log System:
** On several different actions, e.g. Login, Character Login, etc., a new entry is added
** Can be logged on and off in worldserver config
*** Disabled by default to prevent increased log db size for unknowing users.

* Add a new row to account table called 'last_attempt_ip'
** Lists the last ip trying to connect to the account

* Add a new type of HookScripts: AccountScript
** Includes: OnAccountLogin, OnFailedAccountLogin, OnEmailChange, OnFailedChange, OnPasswordChange, OnFailedPasswordChange

* Added new Hook to PlayerScripts: OnFailedPlayerDelete

* Added new variables to PlayerScripts: OnPlayerDelete
2014-06-13 16:25:11 +02:00
Aokromes
4ec84fd1ec Core/Database: Update log for incorrect db structure 2014-06-07 22:13:42 +02:00
jackpoz
03f16d2e90 Shared/Database: Increase Database Worker Pool queue size
Increase DatabaseWorkerPool queue size from the default 16KB to 8MB to avoid blocking the caller thread when queuing an async statement/transaction.
2014-05-17 23:48:32 +02:00
Dehravor
24ae6a6802 Core/Misc: Remove obsolete C++11 backward compatibility macros
OVERRIDE, FINAL, DELETE_MEMBER
2014-04-29 16:35:11 +02:00
Kinzcool
c536305e3a Core: Droped faction_H field -- only one faction table is necessary 2014-04-27 18:13:55 -04:00
joschiwald
742f32f15a Core/Texts: Implemented loading BroadcastTexts 2014-04-22 17:57:23 +02:00
Shauren
0f5632c70e Core/Misc: Fixed some -Weffc++ warnings 2014-04-20 16:48:35 +02:00
Shauren
dee867547d Merge pull request #11719 from Dehravor/master-loot
Core/Loot: Fix master loot
2014-03-29 13:24:48 +01:00
jackpoz
6dcd8c8545 Core/Misc: Fix some static analysis issues
Fix some static analysis issues about:
- uninitialized values, most of which are false positives, always initialized before being accessed
- unchecked return values
- dead code never executed
- bad formatting leading to wrong behavior

Please ensure EventMap is never used with event id set to 0 or those events will never execute.
2014-03-22 14:54:32 +01:00
Dehravor
6a5c43b0d8 Core/Loot: Implement round robin for under threshold items in case of master loot
Thanks @Shauren for pointing out
2014-03-16 19:12:01 +01:00
joschiwald
3a40d8a887 Core/Player: delete queststatus (weekly/monthly/seasonal) on deleting character thx @Expecto
- also rename some prepared statements

Closes #11658
2014-03-02 00:00:39 +01:00
Vincent_Michael
20004050bc Update copyright note for 2014.
Happy new year.
2014-01-01 00:07:53 +01:00
Malcrom
fe95371d9a Core/Scripting: Replace casted with cast as casted is not a word. 2013-12-25 14:16:55 -03:30
jackpoz
b0ffbb2179 Core/Auth: Fix expiring account bans
Fix a database race condition in authserver that would delay the account ban expiry by 1 login because the query that would have removed the ban was executed asynchronously.
2013-12-22 14:00:14 +01:00
Shauren
172d3197bc Core/Guilds: Fixed an issue with withdrawing money from guild bank as guild master if the guild was created using a gm command
Closes #11262
2013-11-25 16:23:55 +01:00
jackpoz
f0c4d0ac05 Core/Transports: Fix few transport issues on relog.
Properly save transport related data to database when saving a Player .
On Player login update the current position as relative to transport, in case the transport moved.
2013-11-17 15:17:40 +01:00
jackpoz
096cb6bf00 Core/Auth: Fix Auth failing sometimes
Fix a database race condition between authserver saving session key to database asynchronously and worldserver reading it; session key is now saved synchronously.
2013-11-16 23:25:21 +01:00
Spp
94e2b9332a Core/Logging: Remove LOG_FILTER_XXX defines with it's value (remember logger names are case-sensitive) 2013-11-08 10:50:51 +01:00
jackpoz
6d794ab305 Core/Database: Add additional assert
Add additional assert to assure that helgrind reports related to SQLQueryHolderTask::Execute() and WorldSession::ProcessQueryCallbacks() are false positives.
The only chance for WorldSession::ProcessQueryCallbacks() to access the SQL queries before they are completed is if m_result.ready() is true before the end of SQLQueryHolderTask::Execute() .

Helgrind false positive log:
 Possible data race during read of size 8 at 0x2BD641E0 by thread #7
 Locks held: none
    at : SQLQueryHolder::GetPreparedResult(unsigned long) (QueryHolder.cpp:107)
    by : Player::LoadFromDB(unsigned int, SQLQueryHolder*) (Player.cpp:16917)
    by : WorldSession::HandlePlayerLogin(LoginQueryHolder*) (CharacterHandler.cpp:807)
    by : WorldSession::ProcessQueryCallbacks() (WorldSession.cpp:1112)
    by : WorldSession::Update(unsigned int, PacketFilter&) (WorldSession.cpp:401)
    by : World::UpdateSessions(unsigned int) (World.cpp:2646)
    by : World::Update(unsigned int) (World.cpp:2003)
    by : WorldRunnable::run() (WorldRunnable.cpp:60)
    by : ACE_Based::Thread::ThreadTask(void*) (Threading.cpp:186)
    by : ACE_OS_Thread_Adapter::invoke() (in /usr/lib/libACE-6.0.3.so)
    by : mythread_wrapper (hg_intercepts.c:233)
    by : start_thread (pthread_create.c:311)

 This conflicts with a previous write of size 8 by thread #4
 Locks held: none
    at : SQLQueryHolder::SetPreparedResult(unsigned long, PreparedResultSet*) (QueryHolder.cpp:140)
    by : SQLQueryHolderTask::Execute() (QueryHolder.cpp:196)
    by : SQLOperation::call() (SQLOperation.h:65)
    by : DatabaseWorker::svc() (DatabaseWorker.cpp:45)
    by : ACE_Task_Base::svc_run(void*) (in /usr/lib/libACE-6.0.3.so)
    by : ACE_Thread_Adapter::invoke_i() (in /usr/lib/libACE-6.0.3.so)
    by : ACE_Thread_Adapter::invoke() (in /usr/lib/libACE-6.0.3.so)
    by : mythread_wrapper (hg_intercepts.c:233)

 Address 0x2BD641E0 is 16 bytes inside a block of size 792 alloc'd
    at : operator new(unsigned long) (vg_replace_malloc.c:319)
    by : __gnu_cxx::new_allocator<std::pair<SQLElementData, SQLResultSetUnion> >::allocate(unsigned long, void const*) (new_allocator.h:104)
    by : std::_Vector_base<std::pair<SQLElementData, SQLResultSetUnion>, std::allocator<std::pair<SQLElementData, SQLResultSetUnion> > >::_M_allocate(unsigned long) (in /home/jackpoz/trinity/bin/worldserver)
    by : std::vector<std::pair<SQLElementData, SQLResultSetUnion>, std::allocator<std::pair<SQLElementData, SQLResultSetUnion> > >::_M_fill_insert(__gnu_cxx::__normal_iterator<std::pair<SQLElementData, SQLResultSetUnion>*, std::vector<std::pair<SQLElementData, SQLResultSetUnion>, std::allocator<std::pair<SQLElementData, SQLResultSetUnion> > > >, unsigned long, std::pair<SQLElementData, SQLResultSetUnion> const&) (vector.tcc:483)
    by : std::vector<std::pair<SQLElementData, SQLResultSetUnion>, std::allocator<std::pair<SQLElementData, SQLResultSetUnion> > >::insert(__gnu_cxx::__normal_iterator<std::pair<SQLElementData, SQLResultSetUnion>*, std::vector<std::pair<SQLElementData, SQLResultSetUnion>, std::allocator<std::pair<SQLElementData, SQLResultSetUnion> > > >, unsigned long, std::pair<SQLElementData, SQLResultSetUnion> const&) (stl_vector.h:1024)
    by : std::vector<std::pair<SQLElementData, SQLResultSetUnion>, std::allocator<std::pair<SQLElementData, SQLResultSetUnion> > >::resize(unsigned long, std::pair<SQLElementData, SQLResultSetUnion>) (stl_vector.h:707)
    by : SQLQueryHolder::SetSize(unsigned long) (QueryHolder.cpp:167)
    by : LoginQueryHolder::Initialize() (CharacterHandler.cpp:66)
    by : WorldSession::HandlePlayerLoginOpcode(WorldPacket&) (CharacterHandler.cpp:788)
    by : WorldSession::Update(unsigned int, PacketFilter&) (WorldSession.cpp:363)
    by : World::UpdateSessions(unsigned int) (World.cpp:2646)
    by : World::Update(unsigned int) (World.cpp:2003)
2013-11-02 22:57:07 +01:00
leguybrush
0a308144a8 Core/Code: Unify [more] codestyle for brackets: )\n{\n} to ) { }. 2013-10-28 14:36:07 -04:00
Ascathor
2607738990 Core/Code: Unify codestyle for brackets: {} to { }.
Also added missing copyright to some files.
2013-10-27 23:46:02 +01:00
Shauren
59fd2520fc Core/Creatures: Removed remains of creature_transport table 2013-10-17 00:20:00 +02:00
Ellie
1fae858645 Whitespace between string literals and user-defined literals is now mandatory for concatenation in C++11 2013-10-01 01:13:13 -07:00
Spp
ea2fe0217d Core/RBAC: Simplify RBAC implementation
- Drop groups (roles than can have inherited roles) and roles (set of
  permissions)
- Permissions can now have inherited permissions (those act as roles)

RBAC DB structure is now limited to four tables
- rbac_permissions: Contains permissions and roles
- rbac_linked_permissions: Contains the relation between permissions and
  linked permissions (those permissions that have linked permissions are
  called roles)
- rbac_default_permissions: Contains the list of permissions to be granted
  to each security level [Added to maintain compatibility in an easy way]
- rbac_account_permissions: Contains the list of permissions granted or
  denied for a particular account.

NOTE: IF YOU ARE USING CUSTOM PERMISSIONS, ROLES OR GROUPS CHECK THE SQL
BEFORE APPLYING...
2013-09-29 13:19:05 +02:00
jackpoz
9c336cc32e Core/DB: Make a26a24a consistent with Trinity code style
Change DatabaseWorkerPool<T>::DirectExecute() to handle PreparedStatement disposal in the same way of DatabaseWorkerPool<T>::Query() , thanks Joschiwald for patch.
2013-09-21 17:45:46 +02:00