Ignore AIClient/Library and AIClient/HybridCLRData permanently; include HybridCLR/YooAsset project setup and UI tooling. Co-authored-by: Cursor <cursoragent@cursor.com>
38 lines
869 B
C#
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));
|
|
}
|
|
}
|
|
}
|