Hi , I have been using lobby for the last weeks and it had been working fine. Today I started getting consistent 403 Forbidden when creating the lobby. (Creating the relay still works). Also I checked that I still have the “Lobby On” toggle enabled on the dashboard.
Is there any change in permissions required to create a Lobby?
The code goes like this:
(Creating the Relay succeeds).
public struct RelayServerData
{
public string joinCode;
public string ipv4Address;
public ushort port;
public byte[] allocationIdBytes;
public byte[] keyBytes;
public byte[] connectionDataBytes;
public byte[] hostConnectionDataBytes;
public bool isHost;
}
public async Task<RelayServerData> CreateRelay()
{
Allocation allocation;
allocation = await Relay.Instance.CreateAllocationAsync(4);
Debug.Log($"Host ConnectionData: {ByteArrayToString(allocation.ConnectionData)}");
Debug.Log($"Host AllocationId: {allocation.AllocationId}");
string createdJoinCode = await Relay.Instance.GetJoinCodeAsync(allocation.AllocationId);
Debug.Log("Relay Join code: " + createdJoinCode);
return new RelayServerData
{
joinCode = createdJoinCode,
ipv4Address = allocation.RelayServer.IpV4,
port = (ushort)allocation.RelayServer.Port,
allocationIdBytes = allocation.AllocationIdBytes,
keyBytes = allocation.Key,
connectionDataBytes = allocation.ConnectionData,
hostConnectionDataBytes = allocation.ConnectionData,
isHost = true,
};
}
public async void CreateLobby()
{
// these work
await UnityServices.InitializeAsync();
await AuthenticationService.Instance.SignInAnonymouslyAsync();
var relayData = await CreateRelay();
// this fails with 403
lobby = await Lobbies.Instance.CreateLobbyAsync("mylobby", 4, new CreateLobbyOptions
{
Player = new Unity.Services.Lobbies.Models.Player(
id: AuthenticationService.Instance.PlayerId,
connectionInfo: relayData.joinCode,
allocationId: relayData.allocationIdBytes.ToString()
),
});