https and auth token rollover

This commit is contained in:
2026-04-25 00:58:07 +05:30
parent 217dacb54c
commit 8bc14d5fff
9 changed files with 1159 additions and 76 deletions
+5 -1
View File
@@ -15,8 +15,12 @@ public class CupidLobby : MonoBehaviour
[SerializeField]private GameObject MatchmakingUI;
[SerializeField]private string GameScene;
[Header("Server info (matchmaker port should match server settings.json)")]
[Tooltip("IP/hostname uses HTTP and cupidPort below. Or full URL: https://match.example.com (default 443, no :port in URL) or http://host/path.")]
[SerializeField]private string serverAddress = "xx.xx.xxx.xx";
[Tooltip("HTTP port when server address is not a full URL. Ignored for https:// or http:// URLs unless the URL includes an explicit port.")]
[SerializeField]private int cupidPort = 2612;
[Tooltip("Sent as the password query param on GET /settings (matchmaker settings.json).")]
[SerializeField]private string cupidPassword = "HelloWorld";
[Tooltip("Used when LoginManager is absent or has no token (e.g. Cupid sample scene).")]
[SerializeField]private string bearerTokenFallback = "";
@@ -59,7 +63,7 @@ public class CupidLobby : MonoBehaviour
: bearerTokenFallback;
if (LoginManager.instance != null && LoginManager.CurrentUser != null && !string.IsNullOrEmpty(LoginManager.CurrentUser.username))
m_username = LoginManager.CurrentUser.username;
Cupid.Init(serverAddress, cupidPort, token);
Cupid.Init(serverAddress, cupidPort, token, cupidPassword);
}
bool matchmaking = false;
public void Matchmake()