mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-04-09 17:26:58 +00:00
feat: implement character and property reputation system
- Added ICharacterReputation and IPropertyReputationContribution interfaces for managing character and property reputations. - Implemented MySQL and SQLite database methods for getting and setting character reputations. - Created migration scripts for character and property reputation tables in both MySQL and SQLite. - Updated CharacterComponent to retrieve and set character reputation. - Enhanced PropertyManagementComponent to manage property reputation and contributions. - Added methods for handling reputation contributions and decay. - Introduced CharacterReputationMigration to migrate existing character reputations from XML to the database.
This commit is contained in:
@@ -55,6 +55,18 @@ std::vector<LWOOBJID> SQLiteDatabase::GetAccountCharacterIds(const LWOOBJID acco
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
std::vector<LWOOBJID> SQLiteDatabase::GetAllCharacterIds() {
|
||||
auto [_, result] = ExecuteSelect("SELECT id FROM charinfo;");
|
||||
|
||||
std::vector<LWOOBJID> toReturn;
|
||||
while (!result.eof()) {
|
||||
toReturn.push_back(result.getInt64Field("id"));
|
||||
result.nextRow();
|
||||
}
|
||||
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
void SQLiteDatabase::InsertNewCharacter(const ICharInfo::Info info) {
|
||||
ExecuteInsert(
|
||||
"INSERT INTO `charinfo`(`id`, `account_id`, `name`, `pending_name`, `needs_rename`, `last_login`, `prop_clone_id`) VALUES (?,?,?,?,?,?,(SELECT IFNULL(MAX(`prop_clone_id`), 0) + 1 FROM `charinfo`))",
|
||||
|
||||
Reference in New Issue
Block a user