Mega Antag Refactor (#25786)

* Mega Antag Refactor

* last minute delta save

* more workshopping

* more shit

* ok tested this for once

* okkkkk sure

* generic delays for starting rules

* well darn

* nukies partially

* ouagh

* ballin' faded and smonkin wed

* obliterated the diff

* Spread my arms and soak up congratulations

* I've got plenty of love, but nothing to show for it

* but there’s too much sunlight
Shining on my laptop monitor, so I
Can’t see anything with any amount of clarity

* ok this junk

* OOK!

* fubar

* most of sloth's review

* oh boy

* eek

* hell yea!

* ASDFJASDJFvsakcvjkzjnhhhyh
This commit is contained in:
Nemanja
2024-04-24 21:31:45 -04:00
committed by GitHub
parent 771661f478
commit 161fd6c83c
99 changed files with 1931 additions and 2310 deletions

View File

@@ -256,6 +256,20 @@ namespace Content.Server.Preferences.Managers
return prefs;
}
/// <summary>
/// Retrieves preferences for the given username from storage or returns null.
/// Creates and saves default preferences if they are not found, then returns them.
/// </summary>
public PlayerPreferences? GetPreferencesOrNull(NetUserId? userId)
{
if (userId == null)
return null;
if (_cachedPlayerPrefs.TryGetValue(userId.Value, out var pref))
return pref.Prefs;
return null;
}
private async Task<PlayerPreferences> GetOrCreatePreferencesAsync(NetUserId userId)
{
var prefs = await _db.GetPlayerPreferencesAsync(userId);