name suggestion bugfix

This commit is contained in:
Spirtix 2023-08-27 22:02:57 +02:00
parent 665089d5ef
commit e564a44b13
2 changed files with 8 additions and 7 deletions

View File

@ -56,13 +56,16 @@ public class ContentController : Controller {
"Young", "Youthful",
"Zealous", "Zealot"
};
//Get Username
User? user = ctx.Sessions.FirstOrDefault(e => e.ApiToken == apiToken)?.User;
Session? session = ctx.Sessions.FirstOrDefault(e => e.ApiToken == apiToken);
if (session is null)
return Unauthorized();
User? user = session.User;
if (user is null)
user = session.Viking?.User;
string uname = user.Username;
string name = uname; //Variable for name processing
List<string> tnames = ctx.Vikings.Select(e => e.Name).ToList(); //Get a list of names from the table
Random choice = new Random(); //Randomizer for selecting random adjectives
List<string> suggestions = new();

View File

@ -136,7 +136,6 @@ namespace sodoff.Services {
var rewards = achivmentsRewardByID[achievementID];
return ApplyAchievementRewards(viking, rewards);
} else {
Console.WriteLine(string.Format("Unknown rewards for achievementID={0}", achievementID));
return new AchievementReward[0];
}
}
@ -146,7 +145,6 @@ namespace sodoff.Services {
var rewards = achivmentsRewardByTask[task.TaskID];
return ApplyAchievementRewards(viking, rewards);
} else {
Console.WriteLine(string.Format("Unknown rewards for taskID={0}", task.TaskID));
return new AchievementReward[0];
}
}