/// <summary> Join a running multiplayer room. </summary> /// <param name="roomId"> The ID of the room you wish to join. </param> /// <param name="joinData"> Data to send to the room with additional information about the join. </param> /// <param name="successCallback"> A callback called when you successfully created and joined the room. </param> /// <param name="errorCallback"> A callback called instead of <paramref name="successCallback"/> if an error occurs when joining the room. </param> public void JoinRoom(string roomId, Dictionary <string, string> joinData = null, Callback <Connection> successCallback = null, Callback <PlayerIOError> errorCallback = null) => CallbackHandler.CreateHandler(() => this.JoinRoom(roomId, joinData), ref successCallback, ref errorCallback);
/// <summary> Creates a multiplayer room (if it doesn't exists already), and joins it. </summary> /// <param name="roomId"> The ID of the room you wish to (create and then) join. </param> /// <param name="roomType"> /// If the room doesn't exists: The name of the room type you wish to run the room as. This /// value should match one of the 'RoomType(...)' attributes of your uploaded code. A room /// type of 'bounce' is always available. /// </param> /// <param name="visible"> /// If the room doesn't exists: Determines (upon creation) if the room should be visible when /// listing rooms with ListRooms. /// </param> /// <param name="roomData"> /// If the room doesn't exists: The data to initialize the room with (upon creation). /// </param> /// <param name="joinData"> /// Data to send to the room with additional information about the join. /// </param> /// <param name="successCallback"> A callback called when you successfully created and/or joined the room. </param> /// <param name="errorCallback"> A callback called instead of <paramref name="successCallback"/> if an error occurs when creating or joining the room. </param> public void CreateJoinRoom(string roomId, string roomType, bool visible = true, Dictionary <string, string> roomData = null, Dictionary <string, string> joinData = null, Callback <Connection> successCallback = null, Callback <PlayerIOError> errorCallback = null) => CallbackHandler.CreateHandler(() => this.CreateJoinRoom(roomId, roomType, visible, roomData, joinData), ref successCallback, ref errorCallback);
/// <summary> /// Load a database object from a table using the specified index. /// </summary> /// <param name="table"> The table to load the database object from. </param> /// <param name="index"> The name of the index to query for the database object. </param> /// <param name="indexValue"> An array of objects of the same types as the index properties, specifying which object to load. </param> /// <returns> The database object found, or null if no object was found. </returns> public void LoadSingle(string table, string index, object[] indexValue, Callback <DatabaseObject> successCallback, Callback <PlayerIOError> errorCallback = null) => CallbackHandler.CreateHandler(() => this.LoadSingle(table, index, indexValue), ref successCallback, ref errorCallback);
/// <summary> /// Delete a range of database objects from a table using an index. /// </summary> /// <param name="table"> The table to delete the database object from</param> /// <param name="index"> The name of the index to query for the database objects to delete</param> /// <param name="indexPath"> /// Where in the index to start the range delete: An array of objects of the same types as the index properties, specifying where in the index to start loading database objects from. /// For instance, in the index [Mode,Map,Score] you might use new object[]{"expert","skyland"} as the indexPath and use the start and stop arguments to determine the range of scores /// you wish to delete. IndexPath can be set to null instead of an empty array. /// </param> /// <param name="start"> /// Where to start the range delete. For instance, if the index is [Mode,Map,Score] and indexPath is ["expert","skyland"], then start defines the minimum score to delete. /// </param> /// <param name="stop"> /// Where to stop the range delete. For instance, if the index is [Mode,Map,Score] and indexPath is ["expert","skyland"], then stop defines the maximum score to delete. /// </param> public void DeleteRange(string table, string index, object[] indexPath, object start, object stop, Callback successCallback, Callback <PlayerIOError> errorCallback = null) => CallbackHandler.CreateHandler(() => this.DeleteRange(table, index, indexPath, start, stop), ref successCallback, ref errorCallback);
/// <summary> Load a range of database objects from a table using the specified index. </summary> /// <param name="table"> The table to load the database object from. </param> /// <param name="index"> The name of the index to query for the database object. </param> /// <param name="indexPath"> /// Where in the index to start the range search: An array of objects of the same types as the index properties,specifying where in the index to start loading database objects from. /// For instance, in the index [Mode,Map,Score] you might use new object[]{"expert","skyland"} as the indexPath and use the start and stop arguments to determine the range of scores /// you wish to return. IndexPath can be set to null if there is only one property in the index. /// </param> /// <param name="start"> /// Where to start the range search. For instance, if the index is [Mode,Map,Score] and indexPath is ["expert","skyland"], then start defines the minimum score to include in the results. </param> /// <param name="stop"> /// Where to stop the range search. For instance, if the index is [Mode,Map,Score] and indexPath is ["expert","skyland"], then stop defines the maximum score to include in the results. </param> /// <param name="limit"> The maximum amount of objects to return. </param> /// <returns> An array containing the database objects that were found in the search. </returns> public void LoadRange(string table, string index, object[] indexPath, object start, object stop, int limit, Callback <DatabaseObject[]> successCallback, Callback <PlayerIOError> errorCallback = null) => CallbackHandler.CreateHandler(() => this.LoadRange(table, index, indexPath, start, stop, limit), ref successCallback, ref errorCallback);
/// <summary> /// Load the database object corresponding to the ConnectUserId of the client from the PlayerObjects table. /// </summary> /// <returns> The database object for the client. </returns> public void LoadMyPlayerObject(Callback <DatabaseObject> successCallback, Callback <PlayerIOError> errorCallback = null) => CallbackHandler.CreateHandler(() => this.LoadMyPlayerObject(), ref successCallback, ref errorCallback);
/// <summary> Loads or creates the database objects with the given keys from the specified table. If the given key doesn't exist, it will be created with a new database object. </summary> /// <param name="table"> The name of the table in which to load the database objects from. </param> /// <param name="keys"> The keys of the database objects to load. </param> /// <returns> An array of database objects in the same order as the keys array. </returns> public void LoadKeysOrCreate(string table, string[] keys, Callback <IEnumerable <DatabaseObject> > successCallback, Callback <PlayerIOError> errorCallback = null) => CallbackHandler.CreateHandler(() => this.LoadKeysOrCreate(table, keys), ref successCallback, ref errorCallback);
/// <summary> Loads the database object with the given key from the specified table. </summary> /// <param name="table"> The name of the table in which to load the database object from. </param> /// <param name="key"> The key of the database object to load. </param> /// <returns> A database object from BigDB with the specified key and table. </returns> public void Load(string table, string key, Callback <DatabaseObject> successCallback, Callback <PlayerIOError> errorCallback = null) => CallbackHandler.CreateHandler(() => this.Load(table, key), ref successCallback, ref errorCallback);
/// <summary> /// Delete the database objects with the given keys from the specified table. /// </summary> /// <param name="table"> The name of the table. </param> /// <param name="keys"> The database object keys. </param> public void DeleteKeys(string table, string[] keys, Callback successCallback, Callback <PlayerIOError> errorCallback = null) => CallbackHandler.CreateHandler(() => this.DeleteKeys(table, keys), ref successCallback, ref errorCallback);