Compare commits

...

3 Commits

Author SHA1 Message Date
Robert Paciorek
17685e76d8 fix null exception in LoginParent 2025-06-27 14:46:23 +00:00
Robert Paciorek
bdd4111722 update dotnet version in Dockerfile 2025-06-27 14:37:19 +00:00
Spirtix
e03e732f33 fix indent 2025-06-27 14:17:05 +02:00
32 changed files with 284 additions and 279 deletions

View File

@ -48,8 +48,13 @@ public class AuthenticationController : Controller {
} else { } else {
user = ctx.Users.FirstOrDefault(e => e.Username == data.UserName); user = ctx.Users.FirstOrDefault(e => e.Username == data.UserName);
} }
if (user is null) {
return Ok(new ParentLoginInfo { Status = MembershipUserStatus.InvalidUserName });
}
PasswordVerificationResult result = new PasswordHasher<object>().VerifyHashedPassword(null, user.Password, data.Password); PasswordVerificationResult result = new PasswordHasher<object>().VerifyHashedPassword(null, user.Password, data.Password);
if (user is null || result == PasswordVerificationResult.Failed) { if (result == PasswordVerificationResult.Failed) {
return Ok(new ParentLoginInfo { Status = MembershipUserStatus.InvalidPassword }); return Ok(new ParentLoginInfo { Status = MembershipUserStatus.InvalidPassword });
} }

View File

@ -1,5 +1,5 @@
# Use the official .NET SDK image for building the application # Use the official .NET SDK image for building the application
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src WORKDIR /src
# Copy the source code # Copy the source code
@ -13,7 +13,7 @@ RUN mv src/mods /app && ln -s /app/mods src/
RUN mv src/assets /app && ln -s /app/assets src/ RUN mv src/assets /app && ln -s /app/assets src/
# Create clean run environment (without source and sdk) # Create clean run environment (without source and sdk)
# FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base # FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
# WORKDIR /app # WORKDIR /app
# COPY --from=build /app . # COPY --from=build /app .

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "AR", Namespace = "")] [XmlRoot(ElementName = "AR", Namespace = "")]
[Serializable] [Serializable]
public class AchievementReward { public class AchievementReward {
public AchievementReward() {} public AchievementReward() { }
public AchievementReward(AchievementReward other) { public AchievementReward(AchievementReward other) {
if (other.UserItem != null) if (other.UserItem != null)
@ -65,6 +65,6 @@ public class AchievementReward {
public int CommonInventoryID; public int CommonInventoryID;
public AchievementReward Clone() { public AchievementReward Clone() {
return (AchievementReward) this.MemberwiseClone(); return (AchievementReward)this.MemberwiseClone();
} }
} }

View File

@ -6,7 +6,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "BP", Namespace = "", IsNullable = true)] [XmlRoot(ElementName = "BP", Namespace = "", IsNullable = true)]
[Serializable] [Serializable]
public class BluePrint { public class BluePrint {
public BluePrint() {} public BluePrint() { }
public BluePrint(BluePrint other) { public BluePrint(BluePrint other) {
Deductibles = other.Deductibles.Select(d => new BluePrintDeductibleConfig(d)).ToList(); Deductibles = other.Deductibles.Select(d => new BluePrintDeductibleConfig(d)).ToList();

View File

@ -3,7 +3,7 @@ using System.Xml.Serialization;
namespace sodoff.Schema; namespace sodoff.Schema;
public class BluePrintSpecification { public class BluePrintSpecification {
public BluePrintSpecification() {} public BluePrintSpecification() { }
public BluePrintSpecification(BluePrintSpecification other) { public BluePrintSpecification(BluePrintSpecification other) {
BluePrintSpecID = other.BluePrintSpecID; BluePrintSpecID = other.BluePrintSpecID;

View File

@ -4,7 +4,7 @@ namespace sodoff.Schema;
[Serializable] [Serializable]
public class CompletionAction { public class CompletionAction {
public CompletionAction() {} public CompletionAction() { }
public CompletionAction(CompletionAction other) { public CompletionAction(CompletionAction other) {
Transition = other.Transition; Transition = other.Transition;

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "AT", Namespace = "")] [XmlRoot(ElementName = "AT", Namespace = "")]
[Serializable] [Serializable]
public class ItemAttribute { public class ItemAttribute {
public ItemAttribute() {} public ItemAttribute() { }
public ItemAttribute(ItemAttribute other) { public ItemAttribute(ItemAttribute other) {
Key = other.Key; Key = other.Key;

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "Availability", Namespace = "")] [XmlRoot(ElementName = "Availability", Namespace = "")]
[Serializable] [Serializable]
public class ItemAvailability { public class ItemAvailability {
public ItemAvailability() {} public ItemAvailability() { }
public ItemAvailability(ItemAvailability other) { public ItemAvailability(ItemAvailability other) {
StartDate = other.StartDate; StartDate = other.StartDate;

View File

@ -4,7 +4,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "I", Namespace = "", IsNullable = true)] [XmlRoot(ElementName = "I", Namespace = "", IsNullable = true)]
public class ItemData { public class ItemData {
public ItemData() {} public ItemData() { }
public ItemData(ItemData other) { public ItemData(ItemData other) {
ItemStates = other.ItemStates.Select(s => new ItemState(s)).ToList(); ItemStates = other.ItemStates.Select(s => new ItemState(s)).ToList();

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "IC", Namespace = "")] [XmlRoot(ElementName = "IC", Namespace = "")]
[Serializable] [Serializable]
public class ItemDataCategory { public class ItemDataCategory {
public ItemDataCategory() {} public ItemDataCategory() { }
public ItemDataCategory(ItemDataCategory other) { public ItemDataCategory(ItemDataCategory other) {
CategoryId = other.CategoryId; CategoryId = other.CategoryId;

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "IRE", Namespace = "")] [XmlRoot(ElementName = "IRE", Namespace = "")]
[Serializable] [Serializable]
public class ItemDataRelationship { public class ItemDataRelationship {
public ItemDataRelationship() {} public ItemDataRelationship() { }
public ItemDataRelationship(ItemDataRelationship other) { public ItemDataRelationship(ItemDataRelationship other) {
Type = other.Type; Type = other.Type;

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "IRO", Namespace = "")] [XmlRoot(ElementName = "IRO", Namespace = "")]
[Serializable] [Serializable]
public class ItemDataRollover { public class ItemDataRollover {
public ItemDataRollover() {} public ItemDataRollover() { }
public ItemDataRollover(ItemDataRollover other) { public ItemDataRollover(ItemDataRollover other) {
DialogName = other.DialogName; DialogName = other.DialogName;

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "IT", Namespace = "")] [XmlRoot(ElementName = "IT", Namespace = "")]
[Serializable] [Serializable]
public class ItemDataTexture { public class ItemDataTexture {
public ItemDataTexture() {} public ItemDataTexture() { }
public ItemDataTexture(ItemDataTexture other) { public ItemDataTexture(ItemDataTexture other) {
TextureName = other.TextureName; TextureName = other.TextureName;

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "IPSM", Namespace = "", IsNullable = false)] [XmlRoot(ElementName = "IPSM", Namespace = "", IsNullable = false)]
[Serializable] [Serializable]
public class ItemPossibleStatsMap { public class ItemPossibleStatsMap {
public ItemPossibleStatsMap() {} public ItemPossibleStatsMap() { }
public ItemPossibleStatsMap(ItemPossibleStatsMap other) { public ItemPossibleStatsMap(ItemPossibleStatsMap other) {
ItemID = other.ItemID; ItemID = other.ItemID;

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "ISC", Namespace = "", IsNullable = true)] [XmlRoot(ElementName = "ISC", Namespace = "", IsNullable = true)]
[Serializable] [Serializable]
public class ItemSaleConfig { public class ItemSaleConfig {
public ItemSaleConfig() {} public ItemSaleConfig() { }
public ItemSaleConfig(ItemSaleConfig other) { public ItemSaleConfig(ItemSaleConfig other) {
ItemID = other.ItemID; ItemID = other.ItemID;

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "IS", Namespace = "")] [XmlRoot(ElementName = "IS", Namespace = "")]
[Serializable] [Serializable]
public class ItemStat { public class ItemStat {
public ItemStat() {} public ItemStat() { }
public ItemStat(ItemStat other) { public ItemStat(ItemStat other) {
ItemStatID = other.ItemStatID; ItemStatID = other.ItemStatID;

View File

@ -11,7 +11,7 @@ namespace sodoff.Schema;
[XmlInclude(typeof(ItemStateCriteriaExpiry))] [XmlInclude(typeof(ItemStateCriteriaExpiry))]
[Serializable] [Serializable]
public class ItemStateCriteria { public class ItemStateCriteria {
public ItemStateCriteria() {} public ItemStateCriteria() { }
public ItemStateCriteria(ItemStateCriteria other) { public ItemStateCriteria(ItemStateCriteria other) {
Type = other.Type; Type = other.Type;

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "ItemStateRule", Namespace = "")] [XmlRoot(ElementName = "ItemStateRule", Namespace = "")]
[Serializable] [Serializable]
public class ItemStateRule { public class ItemStateRule {
public ItemStateRule() {} public ItemStateRule() { }
public ItemStateRule(ItemStateRule other) { public ItemStateRule(ItemStateRule other) {
Criterias = other.Criterias.Select(c => new ItemStateCriteria(c)).ToList(); Criterias = other.Criterias.Select(c => new ItemStateCriteria(c)).ToList();

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "ISM", Namespace = "", IsNullable = false)] [XmlRoot(ElementName = "ISM", Namespace = "", IsNullable = false)]
[Serializable] [Serializable]
public class ItemStatsMap { public class ItemStatsMap {
public ItemStatsMap() {} public ItemStatsMap() { }
public ItemStatsMap(ItemStatsMap other) { public ItemStatsMap(ItemStatsMap other) {
ItemID = other.ItemID; ItemID = other.ItemID;

View File

@ -3,9 +3,9 @@
namespace sodoff.Schema; namespace sodoff.Schema;
[XmlRoot(ElementName = "Mission", Namespace = "")] [XmlRoot(ElementName = "Mission", Namespace = "")]
[Serializable] // FIXME: Remove serializable once we have a different way of deep copying than BinaryFormatter [Serializable]
public class Mission { public class Mission {
public Mission() {} public Mission() { }
public Mission(Mission other) { public Mission(Mission other) {
if (other == null) throw new ArgumentNullException(nameof(other)); if (other == null) throw new ArgumentNullException(nameof(other));

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "MissionCriteria", Namespace = "")] [XmlRoot(ElementName = "MissionCriteria", Namespace = "")]
[Serializable] [Serializable]
public class MissionCriteria { public class MissionCriteria {
public MissionCriteria() {} public MissionCriteria() { }
public MissionCriteria(MissionCriteria other) { public MissionCriteria(MissionCriteria other) {
Type = other.Type; Type = other.Type;

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "MissionRule", Namespace = "")] [XmlRoot(ElementName = "MissionRule", Namespace = "")]
[Serializable] [Serializable]
public class MissionRule { public class MissionRule {
public MissionRule() {} public MissionRule() { }
public MissionRule(MissionRule other) { public MissionRule(MissionRule other) {
Prerequisites = other.Prerequisites.Select(p => new PrerequisiteItem(p)).ToList(); Prerequisites = other.Prerequisites.Select(p => new PrerequisiteItem(p)).ToList();

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "Pair", Namespace = "")] [XmlRoot(ElementName = "Pair", Namespace = "")]
[Serializable] [Serializable]
public class Pair { public class Pair {
public Pair() {} public Pair() { }
public Pair(Pair other) { public Pair(Pair other) {
PairKey = other.PairKey; PairKey = other.PairKey;

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "Pairs", Namespace = "", IsNullable = true)] [XmlRoot(ElementName = "Pairs", Namespace = "", IsNullable = true)]
[Serializable] [Serializable]
public class PairData { public class PairData {
public PairData() {} public PairData() { }
public PairData(PairData other) { public PairData(PairData other) {
Pairs = other.Pairs.Select(p => new Pair(p)).ToArray(); Pairs = other.Pairs.Select(p => new Pair(p)).ToArray();

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "PrerequisiteItem", Namespace = "")] [XmlRoot(ElementName = "PrerequisiteItem", Namespace = "")]
[Serializable] [Serializable]
public class PrerequisiteItem { public class PrerequisiteItem {
public PrerequisiteItem() {} public PrerequisiteItem() { }
public PrerequisiteItem(PrerequisiteItem other) { public PrerequisiteItem(PrerequisiteItem other) {
Type = other.Type; Type = other.Type;

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "RuleItem", Namespace = "")] [XmlRoot(ElementName = "RuleItem", Namespace = "")]
[Serializable] [Serializable]
public class RuleItem { public class RuleItem {
public RuleItem() {} public RuleItem() { }
public RuleItem(RuleItem other) { public RuleItem(RuleItem other) {
Type = other.Type; Type = other.Type;

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "STAT", Namespace = "", IsNullable = false)] [XmlRoot(ElementName = "STAT", Namespace = "", IsNullable = false)]
[Serializable] [Serializable]
public class Stat { public class Stat {
public Stat() {} public Stat() { }
public Stat(Stat other) { public Stat(Stat other) {
ItemID = other.ItemID; ItemID = other.ItemID;

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "SRM", Namespace = "", IsNullable = false)] [XmlRoot(ElementName = "SRM", Namespace = "", IsNullable = false)]
[Serializable] [Serializable]
public class StatRangeMap { public class StatRangeMap {
public StatRangeMap() {} public StatRangeMap() { }
public StatRangeMap(StatRangeMap other) { public StatRangeMap(StatRangeMap other) {
ItemStatsID = other.ItemStatsID; ItemStatsID = other.ItemStatsID;

View File

@ -8,7 +8,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "Task", Namespace = "")] [XmlRoot(ElementName = "Task", Namespace = "")]
[Serializable] [Serializable]
public class Task { public class Task {
public Task() {} public Task() { }
public Task(Task other) { public Task(Task other) {
TaskID = other.TaskID; TaskID = other.TaskID;

View File

@ -5,7 +5,7 @@ namespace sodoff.Schema;
[XmlRoot(ElementName = "UserItem", Namespace = "")] [XmlRoot(ElementName = "UserItem", Namespace = "")]
[Serializable] [Serializable]
public class UserItemData { public class UserItemData {
public UserItemData() {} public UserItemData() { }
public UserItemData(UserItemData other) { public UserItemData(UserItemData other) {
ItemID = other.ItemID; ItemID = other.ItemID;