mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-11-16 23:10:09 +00:00
Prevent DB players from occupying same slot
This commit is contained in:
@@ -208,6 +208,16 @@ bool Database::isNameFree(std::string firstName, std::string lastName) {
|
||||
.empty());
|
||||
}
|
||||
|
||||
bool Database::isSlotFree(int accountId, int slotNum) {
|
||||
std::lock_guard<std::mutex> lock(dbCrit);
|
||||
|
||||
return
|
||||
(db.get_all<DbPlayer>
|
||||
(where((c(&DbPlayer::AccountID) == accountId)
|
||||
and (c(&DbPlayer::slot) == slotNum)))
|
||||
.empty());
|
||||
}
|
||||
|
||||
int Database::createCharacter(sP_CL2LS_REQ_SAVE_CHAR_NAME* save, int AccountID) {
|
||||
std::lock_guard<std::mutex> lock(dbCrit);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user