Fix creating and deleting character slots crashing the client and server (#2172)

* Fix creating a character slot crashing the client

* a

* Fix deleting character profiles
This commit is contained in:
DrSmugleaf
2020-10-06 12:03:14 +02:00
committed by GitHub
parent f9bb3fed6f
commit f35625630b
5 changed files with 89 additions and 5 deletions

View File

@@ -27,7 +27,7 @@ namespace Content.Server.Database
// Preferences
Task<PlayerPreferences> InitPrefsAsync(NetUserId userId, ICharacterProfile defaultProfile);
Task SaveSelectedCharacterIndexAsync(NetUserId userId, int index);
Task SaveCharacterSlotAsync(NetUserId userId, ICharacterProfile profile, int slot);
Task SaveCharacterSlotAsync(NetUserId userId, ICharacterProfile? profile, int slot);
Task<PlayerPreferences?> GetPlayerPreferencesAsync(NetUserId userId);
// Username assignment (for guest accounts, so they persist GUID)
@@ -90,7 +90,7 @@ namespace Content.Server.Database
return _db.SaveSelectedCharacterIndexAsync(userId, index);
}
public Task SaveCharacterSlotAsync(NetUserId userId, ICharacterProfile profile, int slot)
public Task SaveCharacterSlotAsync(NetUserId userId, ICharacterProfile? profile, int slot)
{
return _db.SaveCharacterSlotAsync(userId, profile, slot);
}