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:
Prithu
2017-09-21 18:19:54 +10:00
committed by GitHub
parent 6d45fae841
commit 4af3840406
10 changed files with 106 additions and 31 deletions
+9 -1
View File
@@ -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;
}
}