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::RequestCharacterList => 4,
CustomIpcType::RequestCharacterListRepsonse => 1 + (1184 * 8),
CustomIpcType::DeleteCharacter => 4,
CustomIpcType::DeleteCharacter => 8,
CustomIpcType::CharacterDeleted => 1,
CustomIpcType::ImportCharacter => 132,
CustomIpcType::RemakeCharacter => 1024 + 8,

View file

@ -478,12 +478,23 @@ impl WorldDatabase {
pub fn delete_character(&self, content_id: u64) {
let connection = self.connection.lock().unwrap();
// delete data
{
let mut stmt = connection
.prepare("DELETE FROM character_data WHERE content_id = ?1; DELETE FROM characters WHERE content_id = ?1;")
.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
pub fn set_remake_mode(&self, content_id: u64, mode: RemakeMode) {
let connection = self.connection.lock().unwrap();