Fix + simplify web request

This commit is contained in:
smoogipoo 2020-07-10 19:54:09 +09:00
parent 64e8dce1ad
commit fe585611e7
2 changed files with 6 additions and 21 deletions

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using Humanizer;
using osu.Framework.IO.Network;
using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Multi.Lounge.Components;
@ -23,27 +24,11 @@ protected override WebRequest CreateWebRequest()
{
var req = base.CreateWebRequest();
switch (statusFilter)
{
case RoomStatusFilter.Owned:
req.AddParameter("mode", "owned");
break;
if (statusFilter != RoomStatusFilter.Open)
req.AddParameter("mode", statusFilter.ToString().Underscore().ToLowerInvariant());
case RoomStatusFilter.Participated:
req.AddParameter("mode", "participated");
break;
case RoomStatusFilter.RecentlyEnded:
req.AddParameter("mode", "ended");
break;
}
switch (categoryFilter)
{
case RoomCategoryFilter.Spotlight:
req.AddParameter("category", "spotlight");
break;
}
if (categoryFilter != RoomCategoryFilter.Any)
req.AddParameter("category", categoryFilter.ToString().Underscore().ToLowerInvariant());
return req;
}

View File

@ -74,7 +74,7 @@ public enum RoomStatusFilter
Open,
[Description("Recently Ended")]
RecentlyEnded,
Ended,
Participated,
Owned,
}