using Content.Shared.Database;
using Robust.Shared.Network;
namespace Content.Server.Connection;
///
/// Helper functions for working with .
///
public static class UserDataExt
{
///
/// Get the preferred HWID that should be used for new records related to a player.
///
///
/// Players can have zero or more HWIDs, but for logging things like connection logs we generally
/// only want a single one. This method returns a nullable method.
///
public static ImmutableTypedHwid? GetModernHwid(this NetUserData userData)
{
return userData.ModernHWIds.Length == 0
? null
: new ImmutableTypedHwid(userData.ModernHWIds[0], HwidType.Modern);
}
}