StrixNetworkDeleteRoom Method |
Deletes a match room.
Namespace:
SoftGear.Strix.Unity.Runtime
Assembly:
StrixUnityRuntime (in StrixUnityRuntime.dll) Version: 1.5.0
Syntax Remarks Examples Note: Make sure to change the placeholder values of
applicationId and
host to the real ones that can be found on the
Strix Cloud application information tab.
using SoftGear.Strix.Unity.Runtime;
using UnityEngine;
public class StrixDeleteRoomExample : MonoBehaviour
{
void Start()
{
var strixNetwork = StrixNetwork.instance;
strixNetwork.applicationId = "00000000-0000-0000-0000-000000000000";
strixNetwork.ConnectMasterServer(
host: "0123456789abcdef01234567.game.strixcloud.net",
connectEventHandler: _ => {
Debug.Log("Connection established.");
strixNetwork.CreateRoom(
new Dictionary<string, object> {
{ "name", "My Game Room" },
{ "capacity", 20 }
},
playerName: "My Player Name",
handler: createRoomResult => {
Debug.Log("Room created.");
strixNetwork.DeleteRoom(
roomId: strixNetwork.room.GetPrimaryKey(),
handler: deleteRoomResult => Debug.Log("Room deleted: " + (strixNetwork.room == null)),
failureHandler: deleteRoomError => Debug.LogError("Could not delete room. Reason: " + deleteRoomError.cause)
);
},
failureHandler: createRoomError => Debug.LogError("Could not create room. Reason: " + createRoomError.cause)
);
},
errorEventHandler: connectError => Debug.LogError("Connection failed. Reason: " + connectError.cause)
);
}
}
See Also