* Persist construction menu favorites to player profile * Use `ProtoId`s for construction favorites * Validate construction favorites updates from the client * Actually await the async database call
30 lines
1.2 KiB
C#
30 lines
1.2 KiB
C#
using System.Diagnostics.CodeAnalysis;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Content.Shared.Construction.Prototypes;
|
|
using Content.Shared.Preferences;
|
|
using Robust.Shared.Network;
|
|
using Robust.Shared.Player;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Server.Preferences.Managers
|
|
{
|
|
public interface IServerPreferencesManager
|
|
{
|
|
void Init();
|
|
|
|
Task LoadData(ICommonSession session, CancellationToken cancel);
|
|
void FinishLoad(ICommonSession session);
|
|
void OnClientDisconnected(ICommonSession session);
|
|
|
|
bool TryGetCachedPreferences(NetUserId userId, [NotNullWhen(true)] out PlayerPreferences? playerPreferences);
|
|
PlayerPreferences GetPreferences(NetUserId userId);
|
|
PlayerPreferences? GetPreferencesOrNull(NetUserId? userId);
|
|
IEnumerable<KeyValuePair<NetUserId, ICharacterProfile>> GetSelectedProfilesForPlayers(List<NetUserId> userIds);
|
|
bool HavePreferencesLoaded(ICommonSession session);
|
|
|
|
Task SetProfile(NetUserId userId, int slot, ICharacterProfile profile);
|
|
Task SetConstructionFavorites(NetUserId userId, List<ProtoId<ConstructionPrototype>> favorites);
|
|
}
|
|
}
|