Implemented support for serial transactions and character loading (#2664)
* Implemented support for serial transactions and character loading, ensuring order of operations remains consistent - All item saving is now serialized to prevent issues with duplicating due to certain queries running out of order - Character loading is now serialized with the same system as items, to prevent duplications by relogging before queries are performed * Reverted debug delay thread update timer
This commit is contained in:
@@ -23,7 +23,8 @@
|
||||
#include "Database/SqlOperations.h"
|
||||
#include "DatabaseEnv.h"
|
||||
|
||||
SqlDelayThread::SqlDelayThread(Database* db, SqlConnection* conn) : m_dbEngine(db), m_dbConnection(conn), m_running(true)
|
||||
SqlDelayThread::SqlDelayThread(Database* db, SqlConnection* conn, int workerId)
|
||||
: m_dbEngine(db), m_dbConnection(conn), m_running(true), m_workerId(workerId)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -80,4 +81,11 @@ void SqlDelayThread::ProcessRequests()
|
||||
s->Execute(m_dbConnection);
|
||||
delete s;
|
||||
}
|
||||
|
||||
// Process any serial operations for this worker
|
||||
while (m_dbEngine->NextSerialDelayedOperation(m_workerId, s))
|
||||
{
|
||||
s->Execute(m_dbConnection);
|
||||
delete s;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user