/// <summary> /// Creates a lobby. Creating a lobby auto-joins the connected user to it. Do not call SetOwner() in the transaction /// for this method. /// </summary> /// <param name="transaction"></param> /// <param name="callback"></param> public void CreateLobby(LobbyTransaction transaction, CreateLobbyHandler callback) { GCHandle wrapped = GCHandle.Alloc(callback); Methods.CreateLobby(methodsPtr, transaction.MethodsPtr, GCHandle.ToIntPtr(wrapped), CreateLobbyCallbackImpl); transaction.MethodsPtr = IntPtr.Zero; }
/// <summary> /// Updates a lobby with data from the given transaction. You can call SetOwner() in this transaction. /// <para> /// This call has a rate limit of 10 updates per 5 seconds. If you fear you might hit that, it may be a good idea /// to batch your lobby updates into transactions. /// </para> /// </summary> /// <param name="lobbyId"></param> /// <param name="transaction"></param> /// <param name="callback"></param> public void UpdateLobby(long lobbyId, LobbyTransaction transaction, UpdateLobbyHandler callback) { GCHandle wrapped = GCHandle.Alloc(callback); Methods.UpdateLobby(methodsPtr, lobbyId, transaction.MethodsPtr, GCHandle.ToIntPtr(wrapped), UpdateLobbyCallbackImpl); transaction.MethodsPtr = IntPtr.Zero; }
/// <summary> /// Gets a lobby transaction used for updating an existing lobby. /// </summary> /// <param name="lobbyId"></param> /// <returns></returns> /// <exception cref="ResultException"></exception> public LobbyTransaction GetLobbyUpdateTransaction(long lobbyId) { LobbyTransaction ret = new LobbyTransaction(); Result res = Methods.GetLobbyUpdateTransaction(methodsPtr, lobbyId, ref ret.MethodsPtr); if (res != Result.Ok) { throw new ResultException(res); } return(ret); }