增加steamid上报
This commit is contained in:
parent
a861d153c0
commit
aeffbb3d0f
@ -17,6 +17,7 @@ namespace Logic.CrashSight
|
||||
public static CrashSightManager Instance => new CrashSightManager();
|
||||
private const string CrashSightDeviceIdFallbackKey = "TH1_CrashSightDeviceId";
|
||||
private static string _runtimeFallbackDeviceId;
|
||||
private static ulong _reportedSteamUserId;
|
||||
private CrashSightManager() { }
|
||||
|
||||
public void Initialize()
|
||||
@ -31,6 +32,24 @@ namespace Logic.CrashSight
|
||||
CrashSightAgent.SetUserValue("DeviceId", deviceId);
|
||||
}
|
||||
|
||||
public static void UpdateSteamUserId(ulong steamUserId)
|
||||
{
|
||||
if (steamUserId == 0 || !CrashSightAgent.IsInitialized || _reportedSteamUserId == steamUserId) return;
|
||||
|
||||
try
|
||||
{
|
||||
var value = steamUserId.ToString();
|
||||
CrashSightAgent.SetUserId(value);
|
||||
CrashSightAgent.SetUserValue("SteamId", value);
|
||||
CrashSightAgent.SetUserValue("MemberId", value);
|
||||
_reportedSteamUserId = steamUserId;
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
Debug.LogWarning($"CrashSight SetSteamUserId failed: {e.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetCrashSightDeviceId()
|
||||
{
|
||||
try
|
||||
|
||||
@ -371,6 +371,7 @@ namespace TH1_Logic.Steam
|
||||
{
|
||||
if (!TrySteamApi("RefreshLoginStatus.GetSteamID", SteamUser.GetSteamID, out _selfID)) return;
|
||||
if (!TrySteamApi("RefreshLoginStatus.GetPersonaName", SteamFriends.GetPersonaName, out _selfName)) return;
|
||||
CrashSightManager.UpdateSteamUserId(_selfID.m_SteamID);
|
||||
LogSystem.LogInfo($"Steam用户已登录: {_selfName} ({_selfID})");
|
||||
}
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user