Skip to content

Commit e8b639f

Browse files
committed
deprecate GetAvailableRooms()
1 parent b233345 commit e8b639f

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed

Assets/Colyseus/Runtime/Colyseus/Models/ColyseusClient.cs

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -226,35 +226,6 @@ public async Task<ColyseusRoom<NoState>> Reconnect(string roomId, string session
226226
return await CreateMatchMakeRequest<NoState>("joinById", roomId, options, headers);
227227
}
228228

229-
/// <summary>
230-
/// Get all available rooms
231-
/// </summary>
232-
/// <param name="roomName">Room identifier</param>
233-
/// <param name="headers">Dictionary of headers to pass to the server</param>
234-
/// <returns><see cref="ColyseusRoomAvailable" /> array via async task</returns>
235-
public async Task<ColyseusRoomAvailable[]> GetAvailableRooms(string roomName = "")
236-
{
237-
return await GetAvailableRooms<ColyseusRoomAvailable>(roomName);
238-
}
239-
240-
/// <summary>
241-
/// Get all available rooms with provided custom type <typeparamref name="T" />
242-
/// </summary>
243-
/// <param name="roomName">Name of the room</param>
244-
/// <returns><see cref="CSACSARoomAvailableCollection{T}" /> array via async task</returns>
245-
public async Task<T[]> GetAvailableRooms<T>(string roomName = "")
246-
{
247-
string json = await Http.Request("GET", $"matchmake/{roomName}");
248-
249-
if (json.StartsWith("[", StringComparison.CurrentCulture))
250-
{
251-
json = "{\"rooms\":" + json + "}";
252-
}
253-
254-
RoomAvailableCollection<T> response = JsonUtility.FromJson<RoomAvailableCollection<T>>(json);
255-
return response.rooms;
256-
}
257-
258229
/// <summary>
259230
/// Consume the seat reservation
260231
/// </summary>
@@ -272,8 +243,10 @@ public async Task<ColyseusRoom<T>> ConsumeSeatReservation<T>(ColyseusMatchMakeRe
272243
SessionId = response.sessionId
273244
};
274245

275-
Dictionary<string, object> queryString = new Dictionary<string, object>();
276-
queryString.Add("sessionId", room.SessionId);
246+
Dictionary<string, object> queryString = new Dictionary<string, object>
247+
{
248+
{ "sessionId", room.SessionId }
249+
};
277250

278251
// forward reconnection token
279252
if (response.reconnectionToken != null)

0 commit comments

Comments
 (0)