1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-06-30 11:47:45 +00:00

Fix deleting characters in the lobby not working

This statement broke at some point, and the size of the custom IPC
was wrong too.
This commit is contained in:
Joshua Goins 2025-06-28 10:43:53 -04:00
parent 58eb154ae4
commit 61f0ccdacd
2 changed files with 16 additions and 5 deletions

View file

@ -20,7 +20,7 @@ impl ReadWriteIpcSegment for CustomIpcSegment {
CustomIpcType::NameIsAvailableResponse => 1, CustomIpcType::NameIsAvailableResponse => 1,
CustomIpcType::RequestCharacterList => 4, CustomIpcType::RequestCharacterList => 4,
CustomIpcType::RequestCharacterListRepsonse => 1 + (1184 * 8), CustomIpcType::RequestCharacterListRepsonse => 1 + (1184 * 8),
CustomIpcType::DeleteCharacter => 4, CustomIpcType::DeleteCharacter => 8,
CustomIpcType::CharacterDeleted => 1, CustomIpcType::CharacterDeleted => 1,
CustomIpcType::ImportCharacter => 132, CustomIpcType::ImportCharacter => 132,
CustomIpcType::RemakeCharacter => 1024 + 8, CustomIpcType::RemakeCharacter => 1024 + 8,

View file

@ -478,10 +478,21 @@ impl WorldDatabase {
pub fn delete_character(&self, content_id: u64) { pub fn delete_character(&self, content_id: u64) {
let connection = self.connection.lock().unwrap(); let connection = self.connection.lock().unwrap();
let mut stmt = connection // delete data
.prepare("DELETE FROM character_data WHERE content_id = ?1; DELETE FROM characters WHERE content_id = ?1;") {
.unwrap(); let mut stmt = connection
stmt.execute((content_id,)).unwrap(); .prepare("DELETE FROM character_data WHERE content_id = ?1")
.unwrap();
stmt.execute((content_id,)).unwrap();
}
// delete char
{
let mut stmt = connection
.prepare("DELETE FROM characters WHERE content_id = ?1")
.unwrap();
stmt.execute((content_id,)).unwrap();
}
} }
/// Sets the remake mode for a character /// Sets the remake mode for a character