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:
parent
58eb154ae4
commit
61f0ccdacd
2 changed files with 16 additions and 5 deletions
|
@ -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,
|
||||||
|
|
|
@ -478,12 +478,23 @@ 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();
|
||||||
|
|
||||||
|
// delete data
|
||||||
|
{
|
||||||
let mut stmt = connection
|
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();
|
.unwrap();
|
||||||
stmt.execute((content_id,)).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
|
||||||
pub fn set_remake_mode(&self, content_id: u64, mode: RemakeMode) {
|
pub fn set_remake_mode(&self, content_id: u64, mode: RemakeMode) {
|
||||||
let connection = self.connection.lock().unwrap();
|
let connection = self.connection.lock().unwrap();
|
||||||
|
|
Loading…
Add table
Reference in a new issue