public IActionResult UpdateServerSelection([FromBody] IEnumerable <int> selectedServers) { var steamId = UserExtensions.GetSteamId(this.User); _matchmakingService.UpdateServerSelection(steamId, selectedServers); return(Ok()); }
public IActionResult UpdateMatchmakingPreference([FromBody] int matchMakingPreference) { var steamId = UserExtensions.GetSteamId(this.User); _matchmakingService.UpdatePreference(steamId, matchMakingPreference); return(Ok()); }
public IActionResult UpdateCollegiateChecked([FromBody] bool collegiateChecked) { var steamId = UserExtensions.GetSteamId(this.User); _matchmakingService.UpdateCollegiateSelected(steamId, collegiateChecked); return(Ok()); }
public IActionResult DeclineMatch() { var steamId = UserExtensions.GetSteamId(this.User); _matchmakingService.DeclineMatch(steamId); return(Ok()); }
public IActionResult CancelSearch() { var steamId = UserExtensions.GetSteamId(this.User); _matchmakingService.CancelSearch(steamId); return(Ok()); }
public IActionResult SendMessage([FromBody] string message) { var steamId = UserExtensions.GetSteamId(this.User); _matchmakingService.SendMessage(steamId, message); return(Ok()); }
public IActionResult LeaveLobby() { var steamId = UserExtensions.GetSteamId(this.User); _matchmakingService.LeaveLobby(steamId); return(Ok()); }
public LobbyInfo GetLobbyInfo([FromBody] int eventId) { if (this.User.Identity.IsAuthenticated) { var steamId = UserExtensions.GetSteamId(this.User); return(_schedulingService.GetLobbyInfo(eventId, steamId)); } return(null); }
public MatchmakingData GetExistingLobbyInfo() { if (this.User.Identity.IsAuthenticated) { var steamId = UserExtensions.GetSteamId(this.User); return(_matchmakingService.GetExistingLobbyInfo(steamId)); } return(null); }
public bool IsQueued() { if (this.User.Identity.IsAuthenticated) { var steamId = UserExtensions.GetSteamId(this.User); return(_matchmakingService.GetIsQueued(steamId)); } return(false); }
public IActionResult DeleteEvent([FromBody] int id) { if (this.User.Identity.IsAuthenticated) { var steamId = UserExtensions.GetSteamId(this.User); _schedulingService.DeleteEvent(steamId, id); return(Ok()); } return(Unauthorized()); }
public override Task OnConnectedAsync() { if (Context.User.Identity.IsAuthenticated) { var steamId = UserExtensions.GetSteamId(Context.User); UserConnections.Add(steamId, Context.ConnectionId); } return(base.OnConnectedAsync()); }
public override Task OnDisconnectedAsync(Exception ex) { if (Context.User.Identity.IsAuthenticated) { var steamId = UserExtensions.GetSteamId(Context.User); UserConnections.Remove(steamId, Context.ConnectionId); } return(base.OnDisconnectedAsync(ex)); }
public IActionResult SendMessage([FromBody] ChatMessage message) { if (this.User.Identity.IsAuthenticated) { var steamId = UserExtensions.GetSteamId(this.User); message.SteamId = steamId; message.Sent = DateTime.Now; _schedulingService.AddMessage(message); return(Ok()); } return(Unauthorized()); }
public ScrimEventViewModel AddEvent([FromBody] ScrimEvent scrimEvent) { if (this.User.Identity.IsAuthenticated) { var steamId = UserExtensions.GetSteamId(this.User); scrimEvent.SteamId = steamId; var newEvent = _schedulingService.AddEvent(scrimEvent); var newEventViewModel = this.GetEventViewModel(newEvent); _schedulingService.NotifyEventAdded(newEventViewModel); return(newEventViewModel); } return(null); }
public UserInfo GetUserInfo() { if (this.User.Identity.IsAuthenticated) { var steamId = UserExtensions.GetSteamId(this.User); var steamInfo = _steamService.GetSteamInfo(steamId); var userName = steamInfo.FirstOrDefault(u => u.Name == "personaname")?.Value; var mmr = _trackerService.GetMmr(steamId).Result; return(new UserInfo { SteamId = steamId, DisplayName = userName, Mmr = mmr }); } return(null); }
public IEnumerable <ScrimEventViewModel> GetScrimEvents() { if (this.User.Identity.IsAuthenticated) { var steamId = UserExtensions.GetSteamId(this.User); var scrimEvents = _schedulingService.GetScrimEvents(steamId); var viewModels = new List <ScrimEventViewModel>(); foreach (var scrimEvent in scrimEvents) { viewModels.Add(this.GetEventViewModel(scrimEvent)); } return(viewModels); } return(null); }
public IActionResult StartSearch([FromBody] UserInfo userInfo) { var steamId = UserExtensions.GetSteamId(this.User); if (string.IsNullOrWhiteSpace(steamId) || !userInfo.Servers.Any()) { return(BadRequest()); } var mmr = _trackerService.GetMmr(steamId).Result; userInfo.SteamId = steamId; userInfo.Mmr = mmr; _matchmakingService.StartSearch(userInfo); return(Ok()); }
public ScrimRequestViewModel RequestEvent([FromBody] int id) { if (this.User.Identity.IsAuthenticated) { var steamId = UserExtensions.GetSteamId(this.User); var request = new ScrimRequest { ScrimEventId = id, Date = DateTime.Now, SteamId = steamId }; var newRequest = _schedulingService.AddRequest(request); var newRequestViewModel = this.GetRequestViewModel(newRequest); _schedulingService.NotifyRequestAdded(id, newRequestViewModel); return(newRequestViewModel); } return(null); }