Files
AIGame/AIClient/Assets/HotUpdate/Scripts/Net/SessionData.cs
T
udxandCursor b7a0bbcb89 Add hot-update boot pipeline, UI bundles/atlas assets, and design docs.
Ignore AIClient/Library and AIClient/HybridCLRData permanently; include HybridCLR/YooAsset project setup and UI tooling.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 16:02:58 +08:00

38 lines
869 B
C#

using System;
namespace HotUpdate.Net
{
[Serializable]
public class AuthResponse
{
public string token;
public long pid;
}
[Serializable]
public class AuthError
{
public string error;
}
public sealed class SessionData
{
public string Username;
public string Token;
public long Pid;
public string DeviceId;
public bool IsValid => !string.IsNullOrEmpty(Token) && Pid > 0;
public string BuildWsUrl(string template = null)
{
var tpl = string.IsNullOrEmpty(template)
? "wss://game.xworld.ren/ws?pid={pid}&token={token}"
: template;
return tpl
.Replace("{pid}", Pid.ToString())
.Replace("{token}", Uri.EscapeDataString(Token ?? string.Empty));
}
}
}