add server categorization feature (issue #77)

This commit is contained in:
RaidMax
2020-04-13 20:26:13 -05:00
parent b188e36786
commit 8539223a15
6 changed files with 43 additions and 12 deletions

View File

@ -3,14 +3,15 @@ using SharedLibraryCore;
using SharedLibraryCore.Dtos;
using System.Linq;
using System.Net;
using static SharedLibraryCore.Server;
namespace WebfrontCore.ViewComponents
{
public class ServerListViewComponent : ViewComponent
{
public IViewComponentResult Invoke()
public IViewComponentResult Invoke(Game? game)
{
var servers = Program.Manager.GetServers();
var servers = Program.Manager.GetServers().Where(_server => !game.HasValue ? true : _server.GameName == game);
var serverInfo = servers.Select(s => new ServerInfo()
{