mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-12-14 01:10:08 +00:00
Lock all Database operations.
All DB functions that are called outside of Database.cpp are now locked by the same mutex. This might be a bit overkill, but it's not a hot code path, so it doesn't matter. Better to avoid the potential deadlocks if we made it too granular. From now on a clear distinction must be made between external and internal functions in Database.cpp, or else deadlock will occur. Note that sqlite database operations are already locked, but if execute multiple transactions within the same operation, it could have still caused problems. I also removed the DbPlayer fetch when writing to DB by making it a part of the Player struct. This, by itself, should have fixed the crash we found.
This commit is contained in:
@@ -16,6 +16,7 @@ struct Player {
|
||||
int64_t SerialKey;
|
||||
int32_t iID;
|
||||
uint64_t FEKey;
|
||||
time_t creationTime;
|
||||
|
||||
int level;
|
||||
int HP;
|
||||
|
||||
Reference in New Issue
Block a user