예제 #1
0
        public IActionResult JoinEncounter(int encounterId, int userId)
        {
            //TODO: Validate userId matches session token

            var user = _userService.GetUser(userId);

            if (user != null)
            {
                var battleId = _encounterService.JoinEncounter(encounterId, user);
                if (battleId > 0)
                {
                    return(Ok(new { battleId = battleId }));
                }
            }
            return(BadRequest());
        }