public static Task <Connection> JoinRoomAsync(this Multiplayer multiplayer, string roomId, Dictionary <string, string> joinData) { var tcs = new TaskCompletionSource <Connection>(); multiplayer.JoinRoom(roomId, joinData, tcs.SetResult, tcs.SetException); return(tcs.Task); }
public Connection Join(Multiplayer m) => (this.Type == ConnectType.CreateJoinRoom ? m.CreateJoinRoom(this.RoomId, this.RoomType, this.Visible, this.RoomData, this.JoinData) : m.JoinRoom(this.RoomId, this.JoinData) );