Replaced ACE base AutoPtr class with shared_ptr
Note: worldserver currently broken due to MapUpdater threading failure (ACE ofc, what else could it be)
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
* 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
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.
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.
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.
Fix a database race condition between authserver saving session key to database asynchronously and worldserver reading it; session key is now saved synchronously.
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)
- 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...
Change DatabaseWorkerPool<T>::DirectExecute() to handle PreparedStatement disposal in the same way of DatabaseWorkerPool<T>::Query() , thanks Joschiwald for patch.