mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-11 08:18:49 -07:00
Compare commits
7 Commits
3877a8ba37
...
12bb663076
Author | SHA1 | Date | |
---|---|---|---|
![]() |
12bb663076 | ||
![]() |
a3db9c2bcf | ||
![]() |
2aac24c37e | ||
![]() |
06daf21d8c | ||
![]() |
dc303d871e | ||
![]() |
3ffced2b60 | ||
![]() |
640d7ba664 |
@ -49,10 +49,19 @@ public class AuthenticationController : Controller {
|
|||||||
user = ctx.Users.FirstOrDefault(e => e.Username == data.UserName);
|
user = ctx.Users.FirstOrDefault(e => e.Username == data.UserName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user is null || new PasswordHasher<object>().VerifyHashedPassword(null, user.Password, data.Password) != PasswordVerificationResult.Success) {
|
if (user is null) {
|
||||||
|
return Ok(new ParentLoginInfo { Status = MembershipUserStatus.InvalidUserName });
|
||||||
|
}
|
||||||
|
|
||||||
|
PasswordVerificationResult result = new PasswordHasher<object>().VerifyHashedPassword(null, user.Password, data.Password);
|
||||||
|
if (result == PasswordVerificationResult.Failed) {
|
||||||
return Ok(new ParentLoginInfo { Status = MembershipUserStatus.InvalidPassword });
|
return Ok(new ParentLoginInfo { Status = MembershipUserStatus.InvalidPassword });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (result == PasswordVerificationResult.SuccessRehashNeeded) {
|
||||||
|
user.Password = new PasswordHasher<object>().HashPassword(null, data.Password);
|
||||||
|
}
|
||||||
|
|
||||||
// Create session
|
// Create session
|
||||||
Session session = new Session {
|
Session session = new Session {
|
||||||
User = user,
|
User = user,
|
||||||
|
@ -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 .
|
||||||
|
|
||||||
|
@ -4,48 +4,67 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "AR", Namespace = "")]
|
[XmlRoot(ElementName = "AR", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class AchievementReward
|
public class AchievementReward {
|
||||||
{
|
public AchievementReward() { }
|
||||||
[XmlElement(ElementName = "ui", IsNullable = true)]
|
|
||||||
public UserItemData UserItem { get; set; }
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "a")]
|
public AchievementReward(AchievementReward other) {
|
||||||
public int? Amount;
|
if (other.UserItem != null)
|
||||||
|
UserItem = new UserItemData(other.UserItem);
|
||||||
|
|
||||||
[XmlElement(ElementName = "p", IsNullable = true)]
|
Amount = other.Amount;
|
||||||
public AchievementPointTypes? PointTypeID;
|
PointTypeID = other.PointTypeID;
|
||||||
|
ItemID = other.ItemID;
|
||||||
|
EntityID = other.EntityID;
|
||||||
|
EntityTypeID = other.EntityTypeID;
|
||||||
|
RewardID = other.RewardID;
|
||||||
|
AchievementID = other.AchievementID;
|
||||||
|
AllowMultiple = other.AllowMultiple;
|
||||||
|
MinAmount = other.MinAmount;
|
||||||
|
MaxAmount = other.MaxAmount;
|
||||||
|
Date = other.Date;
|
||||||
|
CommonInventoryID = other.CommonInventoryID;
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "ii")]
|
[XmlElement(ElementName = "ui", IsNullable = true)]
|
||||||
public int ItemID;
|
public UserItemData UserItem { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "i", IsNullable = true)]
|
[XmlElement(ElementName = "a")]
|
||||||
public Guid? EntityID;
|
public int? Amount;
|
||||||
|
|
||||||
[XmlElement(ElementName = "t")]
|
[XmlElement(ElementName = "p", IsNullable = true)]
|
||||||
public int EntityTypeID;
|
public AchievementPointTypes? PointTypeID;
|
||||||
|
|
||||||
[XmlElement(ElementName = "r")]
|
[XmlElement(ElementName = "ii")]
|
||||||
public int RewardID;
|
public int ItemID;
|
||||||
|
|
||||||
[XmlElement(ElementName = "ai")]
|
[XmlElement(ElementName = "i", IsNullable = true)]
|
||||||
public int AchievementID;
|
public Guid? EntityID;
|
||||||
|
|
||||||
[XmlElement(ElementName = "amulti")]
|
[XmlElement(ElementName = "t")]
|
||||||
public bool AllowMultiple;
|
public int EntityTypeID;
|
||||||
|
|
||||||
[XmlElement(ElementName = "mina", IsNullable = true)]
|
[XmlElement(ElementName = "r")]
|
||||||
public int? MinAmount;
|
public int RewardID;
|
||||||
|
|
||||||
[XmlElement(ElementName = "maxa", IsNullable = true)]
|
[XmlElement(ElementName = "ai")]
|
||||||
public int? MaxAmount;
|
public int AchievementID;
|
||||||
|
|
||||||
[XmlElement(ElementName = "d", IsNullable = true)]
|
[XmlElement(ElementName = "amulti")]
|
||||||
public DateTime? Date;
|
public bool AllowMultiple;
|
||||||
|
|
||||||
[XmlElement(ElementName = "cid")]
|
[XmlElement(ElementName = "mina", IsNullable = true)]
|
||||||
public int CommonInventoryID;
|
public int? MinAmount;
|
||||||
|
|
||||||
public AchievementReward Clone() {
|
[XmlElement(ElementName = "maxa", IsNullable = true)]
|
||||||
return (AchievementReward) this.MemberwiseClone();
|
public int? MaxAmount;
|
||||||
}
|
|
||||||
|
[XmlElement(ElementName = "d", IsNullable = true)]
|
||||||
|
public DateTime? Date;
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "cid")]
|
||||||
|
public int CommonInventoryID;
|
||||||
|
|
||||||
|
public AchievementReward Clone() {
|
||||||
|
return (AchievementReward)this.MemberwiseClone();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,14 +5,21 @@ 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() { }
|
||||||
[XmlElement(ElementName = "BPDC", IsNullable = true)]
|
|
||||||
public List<BluePrintDeductibleConfig> Deductibles { get; set; }
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "ING", IsNullable = false)]
|
public BluePrint(BluePrint other) {
|
||||||
public List<BluePrintSpecification> Ingredients { get; set; }
|
Deductibles = other.Deductibles.Select(d => new BluePrintDeductibleConfig(d)).ToList();
|
||||||
|
Ingredients = other.Ingredients.Select(i => new BluePrintSpecification(i)).ToList();
|
||||||
|
Outputs = other.Outputs.Select(o => new BluePrintSpecification(o)).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "OUT", IsNullable = false)]
|
[XmlElement(ElementName = "BPDC", IsNullable = true)]
|
||||||
public List<BluePrintSpecification> Outputs { get; set; }
|
public List<BluePrintDeductibleConfig> Deductibles { get; set; }
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "ING", IsNullable = false)]
|
||||||
|
public List<BluePrintSpecification> Ingredients { get; set; }
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "OUT", IsNullable = false)]
|
||||||
|
public List<BluePrintSpecification> Outputs { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -4,17 +4,25 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "BPDC", Namespace = "", IsNullable = true)]
|
[XmlRoot(ElementName = "BPDC", Namespace = "", IsNullable = true)]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class BluePrintDeductibleConfig
|
public class BluePrintDeductibleConfig {
|
||||||
{
|
public BluePrintDeductibleConfig() {}
|
||||||
[XmlElement(ElementName = "BPIID", IsNullable = false)]
|
|
||||||
public int BluePrintItemID { get; set; }
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "DT", IsNullable = false)]
|
public BluePrintDeductibleConfig(BluePrintDeductibleConfig other) {
|
||||||
public DeductibleType DeductibleType { get; set; }
|
BluePrintItemID = other.BluePrintItemID;
|
||||||
|
DeductibleType = other.DeductibleType;
|
||||||
|
ItemID = other.ItemID;
|
||||||
|
Quantity = other.Quantity;
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "IID", IsNullable = true)]
|
[XmlElement(ElementName = "BPIID", IsNullable = false)]
|
||||||
public int? ItemID { get; set; }
|
public int BluePrintItemID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "QTY", IsNullable = false)]
|
[XmlElement(ElementName = "DT", IsNullable = false)]
|
||||||
public int Quantity { get; set; }
|
public DeductibleType DeductibleType { get; set; }
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "IID", IsNullable = true)]
|
||||||
|
public int? ItemID { get; set; }
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "QTY", IsNullable = false)]
|
||||||
|
public int Quantity { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -2,33 +2,45 @@ using System.Xml.Serialization;
|
|||||||
|
|
||||||
namespace sodoff.Schema;
|
namespace sodoff.Schema;
|
||||||
|
|
||||||
public class BluePrintSpecification
|
public class BluePrintSpecification {
|
||||||
{
|
public BluePrintSpecification() { }
|
||||||
[XmlElement(ElementName = "BPSID", IsNullable = false)]
|
|
||||||
public int BluePrintSpecID { get; set; }
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "BPIID", IsNullable = false)]
|
public BluePrintSpecification(BluePrintSpecification other) {
|
||||||
public int BluePrintItemID { get; set; }
|
BluePrintSpecID = other.BluePrintSpecID;
|
||||||
|
BluePrintItemID = other.BluePrintItemID;
|
||||||
|
ItemID = other.ItemID;
|
||||||
|
CategoryID = other.CategoryID;
|
||||||
|
ItemRarity = other.ItemRarity;
|
||||||
|
Tier = other.Tier;
|
||||||
|
Quantity = other.Quantity;
|
||||||
|
SpecificationType = other.SpecificationType;
|
||||||
|
}
|
||||||
|
|
||||||
public bool ShouldSerializeBluePrintItemID() { return BluePrintItemID != 0; }
|
[XmlElement(ElementName = "BPSID", IsNullable = false)]
|
||||||
|
public int BluePrintSpecID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "IID", IsNullable = true)]
|
[XmlElement(ElementName = "BPIID", IsNullable = false)]
|
||||||
public int? ItemID { get; set; }
|
public int BluePrintItemID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "CID", IsNullable = true)]
|
public bool ShouldSerializeBluePrintItemID() { return BluePrintItemID != 0; }
|
||||||
public int? CategoryID { get; set; }
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "IR", IsNullable = true)]
|
[XmlElement(ElementName = "IID", IsNullable = true)]
|
||||||
public ItemRarity? ItemRarity { get; set; }
|
public int? ItemID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "T", IsNullable = true)]
|
[XmlElement(ElementName = "CID", IsNullable = true)]
|
||||||
public ItemTier? Tier { get; set; }
|
public int? CategoryID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "QTY", IsNullable = false)]
|
[XmlElement(ElementName = "IR", IsNullable = true)]
|
||||||
public int Quantity { get; set; }
|
public ItemRarity? ItemRarity { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "ST", IsNullable = true)]
|
[XmlElement(ElementName = "T", IsNullable = true)]
|
||||||
public SpecificationType? SpecificationType { get; set; }
|
public ItemTier? Tier { get; set; }
|
||||||
|
|
||||||
public bool ShouldSerializeSpecificationType() { return SpecificationType != null; }
|
[XmlElement(ElementName = "QTY", IsNullable = false)]
|
||||||
|
public int Quantity { get; set; }
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "ST", IsNullable = true)]
|
||||||
|
public SpecificationType? SpecificationType { get; set; }
|
||||||
|
|
||||||
|
public bool ShouldSerializeSpecificationType() { return SpecificationType != null; }
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,13 @@ using System.Xml.Serialization;
|
|||||||
namespace sodoff.Schema;
|
namespace sodoff.Schema;
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class CompletionAction
|
public class CompletionAction {
|
||||||
{
|
public CompletionAction() { }
|
||||||
[XmlElement(ElementName = "Transition")]
|
|
||||||
public StateTransition Transition;
|
public CompletionAction(CompletionAction other) {
|
||||||
|
Transition = other.Transition;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "Transition")]
|
||||||
|
public StateTransition Transition;
|
||||||
}
|
}
|
||||||
|
@ -4,11 +4,17 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "AT", Namespace = "")]
|
[XmlRoot(ElementName = "AT", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemAttribute
|
public class ItemAttribute {
|
||||||
{
|
public ItemAttribute() { }
|
||||||
[XmlElement(ElementName = "k")]
|
|
||||||
public string Key;
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "v")]
|
public ItemAttribute(ItemAttribute other) {
|
||||||
public string Value;
|
Key = other.Key;
|
||||||
|
Value = other.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "k")]
|
||||||
|
public string Key;
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "v")]
|
||||||
|
public string Value;
|
||||||
}
|
}
|
||||||
|
@ -4,11 +4,17 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "Availability", Namespace = "")]
|
[XmlRoot(ElementName = "Availability", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemAvailability
|
public class ItemAvailability {
|
||||||
{
|
public ItemAvailability() { }
|
||||||
[XmlElement(ElementName = "sdate", IsNullable = true)]
|
|
||||||
public DateTime? StartDate;
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "edate", IsNullable = true)]
|
public ItemAvailability(ItemAvailability other) {
|
||||||
public DateTime? EndDate;
|
StartDate = other.StartDate;
|
||||||
|
EndDate = other.EndDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "sdate", IsNullable = true)]
|
||||||
|
public DateTime? StartDate;
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "edate", IsNullable = true)]
|
||||||
|
public DateTime? EndDate;
|
||||||
}
|
}
|
||||||
|
@ -3,111 +3,148 @@ using System.Xml.Serialization;
|
|||||||
namespace sodoff.Schema;
|
namespace sodoff.Schema;
|
||||||
|
|
||||||
[XmlRoot(ElementName = "I", Namespace = "", IsNullable = true)]
|
[XmlRoot(ElementName = "I", Namespace = "", IsNullable = true)]
|
||||||
public class ItemData
|
public class ItemData {
|
||||||
{
|
public ItemData() { }
|
||||||
[XmlElement(ElementName = "is")]
|
|
||||||
public List<ItemState> ItemStates { get; set; }
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "ir", IsNullable = true)]
|
public ItemData(ItemData other) {
|
||||||
public ItemRarity? ItemRarity { get; set; }
|
ItemStates = other.ItemStates.Select(s => new ItemState(s)).ToList();
|
||||||
|
ItemRarity = other.ItemRarity;
|
||||||
|
PossibleStatsMap = new ItemPossibleStatsMap(other.PossibleStatsMap);
|
||||||
|
ItemStatsMap = new ItemStatsMap(other.ItemStatsMap);
|
||||||
|
ItemSaleConfigs = other.ItemSaleConfigs.Select(cfg => new ItemSaleConfig(cfg)).ToArray();
|
||||||
|
BluePrint = new BluePrint(other.BluePrint);
|
||||||
|
AssetName = other.AssetName;
|
||||||
|
Attribute = other.Attribute.Select(attr => new ItemAttribute(attr)).ToArray();
|
||||||
|
Category = other.Category.Select(cat => new ItemDataCategory(cat)).ToArray();
|
||||||
|
Cost = other.Cost;
|
||||||
|
CashCost = other.CashCost;
|
||||||
|
CreativePoints = other.CreativePoints;
|
||||||
|
Description = other.Description;
|
||||||
|
IconName = other.IconName;
|
||||||
|
InventoryMax = other.InventoryMax;
|
||||||
|
ItemID = other.ItemID;
|
||||||
|
ItemName = other.ItemName;
|
||||||
|
ItemNamePlural = other.ItemNamePlural;
|
||||||
|
Locked = other.Locked;
|
||||||
|
Geometry2 = other.Geometry2;
|
||||||
|
Rollover = new ItemDataRollover(other.Rollover);
|
||||||
|
RankId = other.RankId;
|
||||||
|
Relationship = other.Relationship.Select(r => new ItemDataRelationship(r)).ToArray();
|
||||||
|
Stackable = other.Stackable;
|
||||||
|
AllowStacking = other.AllowStacking;
|
||||||
|
SaleFactor = other.SaleFactor;
|
||||||
|
Texture = other.Texture.Select(t => new ItemDataTexture(t)).ToArray();
|
||||||
|
Uses = other.Uses;
|
||||||
|
Availability = other.Availability.Select(a => new ItemAvailability(a)).ToArray();
|
||||||
|
RewardTypeID = other.RewardTypeID;
|
||||||
|
Points = other.Points;
|
||||||
|
NormalDiscoutModifier = other.NormalDiscoutModifier;
|
||||||
|
MemberDiscountModifier = other.MemberDiscountModifier;
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "ipsm", IsNullable = true)]
|
[XmlElement(ElementName = "is")]
|
||||||
public ItemPossibleStatsMap PossibleStatsMap { get; set; }
|
public List<ItemState> ItemStates { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "ism", IsNullable = true)]
|
[XmlElement(ElementName = "ir", IsNullable = true)]
|
||||||
public ItemStatsMap ItemStatsMap { get; set; }
|
public ItemRarity? ItemRarity { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "iscs", IsNullable = true)]
|
[XmlElement(ElementName = "ipsm", IsNullable = true)]
|
||||||
public ItemSaleConfig[] ItemSaleConfigs { get; set; }
|
public ItemPossibleStatsMap PossibleStatsMap { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "bp", IsNullable = true)]
|
[XmlElement(ElementName = "ism", IsNullable = true)]
|
||||||
public BluePrint BluePrint { get; set; }
|
public ItemStatsMap ItemStatsMap { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "an")]
|
[XmlElement(ElementName = "iscs", IsNullable = true)]
|
||||||
public string AssetName;
|
public ItemSaleConfig[] ItemSaleConfigs { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "at", IsNullable = true)]
|
[XmlElement(ElementName = "bp", IsNullable = true)]
|
||||||
public ItemAttribute[] Attribute;
|
public BluePrint BluePrint { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "c")]
|
[XmlElement(ElementName = "an")]
|
||||||
public ItemDataCategory[] Category;
|
public string AssetName;
|
||||||
|
|
||||||
[XmlElement(ElementName = "ct")]
|
[XmlElement(ElementName = "at", IsNullable = true)]
|
||||||
public int Cost;
|
public ItemAttribute[] Attribute;
|
||||||
|
|
||||||
[XmlElement(ElementName = "ct2")]
|
[XmlElement(ElementName = "c")]
|
||||||
public int CashCost;
|
public ItemDataCategory[] Category;
|
||||||
|
|
||||||
[XmlElement(ElementName = "cp")]
|
[XmlElement(ElementName = "ct")]
|
||||||
public int CreativePoints;
|
public int Cost;
|
||||||
|
|
||||||
[XmlElement(ElementName = "d")]
|
[XmlElement(ElementName = "ct2")]
|
||||||
public string Description;
|
public int CashCost;
|
||||||
|
|
||||||
[XmlElement(ElementName = "icn")]
|
[XmlElement(ElementName = "cp")]
|
||||||
public string IconName;
|
public int CreativePoints;
|
||||||
|
|
||||||
[XmlElement(ElementName = "im")]
|
[XmlElement(ElementName = "d")]
|
||||||
public int InventoryMax;
|
public string Description;
|
||||||
|
|
||||||
[XmlElement(ElementName = "id")]
|
[XmlElement(ElementName = "icn")]
|
||||||
public int ItemID;
|
public string IconName;
|
||||||
|
|
||||||
[XmlElement(ElementName = "itn")]
|
[XmlElement(ElementName = "im")]
|
||||||
public string ItemName;
|
public int InventoryMax;
|
||||||
|
|
||||||
[XmlElement(ElementName = "itnp")]
|
[XmlElement(ElementName = "id")]
|
||||||
public string ItemNamePlural;
|
public int ItemID;
|
||||||
|
|
||||||
[XmlElement(ElementName = "l")]
|
[XmlElement(ElementName = "itn")]
|
||||||
public bool Locked;
|
public string ItemName;
|
||||||
|
|
||||||
[XmlElement(ElementName = "g", IsNullable = true)]
|
[XmlElement(ElementName = "itnp")]
|
||||||
public string Geometry2;
|
public string ItemNamePlural;
|
||||||
|
|
||||||
[XmlElement(ElementName = "ro", IsNullable = true)]
|
[XmlElement(ElementName = "l")]
|
||||||
public ItemDataRollover Rollover;
|
public bool Locked;
|
||||||
|
|
||||||
[XmlElement(ElementName = "rid", IsNullable = true)]
|
[XmlElement(ElementName = "g", IsNullable = true)]
|
||||||
public int? RankId;
|
public string Geometry2;
|
||||||
|
|
||||||
[XmlElement(ElementName = "r")]
|
[XmlElement(ElementName = "ro", IsNullable = true)]
|
||||||
public ItemDataRelationship[] Relationship;
|
public ItemDataRollover Rollover;
|
||||||
|
|
||||||
[XmlElement(ElementName = "s")]
|
[XmlElement(ElementName = "rid", IsNullable = true)]
|
||||||
public bool Stackable;
|
public int? RankId;
|
||||||
|
|
||||||
[XmlElement(ElementName = "as")]
|
[XmlElement(ElementName = "r")]
|
||||||
public bool AllowStacking;
|
public ItemDataRelationship[] Relationship;
|
||||||
|
|
||||||
[XmlElement(ElementName = "sf")]
|
[XmlElement(ElementName = "s")]
|
||||||
public int SaleFactor;
|
public bool Stackable;
|
||||||
|
|
||||||
[XmlElement(ElementName = "t")]
|
[XmlElement(ElementName = "as")]
|
||||||
public ItemDataTexture[] Texture;
|
public bool AllowStacking;
|
||||||
|
|
||||||
[XmlElement(ElementName = "u")]
|
[XmlElement(ElementName = "sf")]
|
||||||
public int Uses;
|
public int SaleFactor;
|
||||||
|
|
||||||
[XmlElement(ElementName = "av")]
|
[XmlElement(ElementName = "t")]
|
||||||
public ItemAvailability[] Availability;
|
public ItemDataTexture[] Texture;
|
||||||
|
|
||||||
[XmlElement(ElementName = "rtid")]
|
[XmlElement(ElementName = "u")]
|
||||||
public int RewardTypeID;
|
public int Uses;
|
||||||
|
|
||||||
[XmlElement(ElementName = "p", IsNullable = true)]
|
[XmlElement(ElementName = "av")]
|
||||||
public int? Points;
|
public ItemAvailability[] Availability;
|
||||||
|
|
||||||
[XmlIgnore]
|
[XmlElement(ElementName = "rtid")]
|
||||||
public float NormalDiscoutModifier;
|
public int RewardTypeID;
|
||||||
|
|
||||||
[XmlIgnore]
|
[XmlElement(ElementName = "p", IsNullable = true)]
|
||||||
public float MemberDiscountModifier;
|
public int? Points;
|
||||||
|
|
||||||
[XmlIgnore]
|
[XmlIgnore]
|
||||||
public float FinalDiscoutModifier {
|
public float NormalDiscoutModifier;
|
||||||
get {
|
|
||||||
return Math.Min(1f, (1f - NormalDiscoutModifier) * (1f - MemberDiscountModifier));
|
[XmlIgnore]
|
||||||
|
public float MemberDiscountModifier;
|
||||||
|
|
||||||
|
[XmlIgnore]
|
||||||
|
public float FinalDiscoutModifier {
|
||||||
|
get {
|
||||||
|
return Math.Min(1f, (1f - NormalDiscoutModifier) * (1f - MemberDiscountModifier));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,14 +4,21 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "IC", Namespace = "")]
|
[XmlRoot(ElementName = "IC", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemDataCategory
|
public class ItemDataCategory {
|
||||||
{
|
public ItemDataCategory() { }
|
||||||
[XmlElement(ElementName = "cid")]
|
|
||||||
public int CategoryId;
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "cn")]
|
public ItemDataCategory(ItemDataCategory other) {
|
||||||
public string CategoryName;
|
CategoryId = other.CategoryId;
|
||||||
|
CategoryName = other.CategoryName;
|
||||||
|
IconName = other.IconName;
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "i", IsNullable = true)]
|
[XmlElement(ElementName = "cid")]
|
||||||
public string IconName;
|
public int CategoryId;
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "cn")]
|
||||||
|
public string CategoryName;
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "i", IsNullable = true)]
|
||||||
|
public string IconName;
|
||||||
}
|
}
|
||||||
|
@ -4,20 +4,29 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "IRE", Namespace = "")]
|
[XmlRoot(ElementName = "IRE", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemDataRelationship
|
public class ItemDataRelationship {
|
||||||
{
|
public ItemDataRelationship() { }
|
||||||
[XmlElement(ElementName = "t")]
|
|
||||||
public string Type;
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "id")]
|
public ItemDataRelationship(ItemDataRelationship other) {
|
||||||
public int ItemId;
|
Type = other.Type;
|
||||||
|
ItemId = other.ItemId;
|
||||||
|
Weight = other.Weight;
|
||||||
|
Quantity = other.Quantity;
|
||||||
|
MaxQuantity = other.MaxQuantity;
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "wt")]
|
[XmlElement(ElementName = "t")]
|
||||||
public int Weight;
|
public string Type;
|
||||||
|
|
||||||
[XmlElement(ElementName = "q")]
|
[XmlElement(ElementName = "id")]
|
||||||
public int Quantity;
|
public int ItemId;
|
||||||
|
|
||||||
[XmlElement(ElementName = "mxq")]
|
[XmlElement(ElementName = "wt")]
|
||||||
public int? MaxQuantity;
|
public int Weight;
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "q")]
|
||||||
|
public int Quantity;
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "mxq")]
|
||||||
|
public int? MaxQuantity;
|
||||||
}
|
}
|
||||||
|
@ -4,11 +4,17 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "IRO", Namespace = "")]
|
[XmlRoot(ElementName = "IRO", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemDataRollover
|
public class ItemDataRollover {
|
||||||
{
|
public ItemDataRollover() { }
|
||||||
[XmlElement(ElementName = "d")]
|
|
||||||
public string DialogName;
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "b")]
|
public ItemDataRollover(ItemDataRollover other) {
|
||||||
public string Bundle;
|
DialogName = other.DialogName;
|
||||||
|
Bundle = other.Bundle;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "d")]
|
||||||
|
public string DialogName;
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "b")]
|
||||||
|
public string Bundle;
|
||||||
}
|
}
|
||||||
|
@ -4,17 +4,25 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "IT", Namespace = "")]
|
[XmlRoot(ElementName = "IT", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemDataTexture
|
public class ItemDataTexture {
|
||||||
{
|
public ItemDataTexture() { }
|
||||||
[XmlElement(ElementName = "n")]
|
|
||||||
public string TextureName;
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "t")]
|
public ItemDataTexture(ItemDataTexture other) {
|
||||||
public string TextureTypeName;
|
TextureName = other.TextureName;
|
||||||
|
TextureTypeName = other.TextureTypeName;
|
||||||
|
OffsetX = other.OffsetX;
|
||||||
|
OffsetY = other.OffsetY;
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "x", IsNullable = true)]
|
[XmlElement(ElementName = "n")]
|
||||||
public float? OffsetX;
|
public string TextureName;
|
||||||
|
|
||||||
[XmlElement(ElementName = "y", IsNullable = true)]
|
[XmlElement(ElementName = "t")]
|
||||||
public float? OffsetY;
|
public string TextureTypeName;
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "x", IsNullable = true)]
|
||||||
|
public float? OffsetX;
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "y", IsNullable = true)]
|
||||||
|
public float? OffsetY;
|
||||||
}
|
}
|
||||||
|
@ -4,17 +4,25 @@ 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() { }
|
||||||
[XmlElement(ElementName = "IID", IsNullable = false)]
|
|
||||||
public int ItemID { get; set; }
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "SC", IsNullable = false)]
|
public ItemPossibleStatsMap(ItemPossibleStatsMap other) {
|
||||||
public int ItemStatsCount { get; set; }
|
ItemID = other.ItemID;
|
||||||
|
ItemStatsCount = other.ItemStatsCount;
|
||||||
|
SetID = other.SetID;
|
||||||
|
Stats = other.Stats.Select(s => new Stat(s)).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "SID", IsNullable = false)]
|
[XmlElement(ElementName = "IID", IsNullable = false)]
|
||||||
public int SetID { get; set; }
|
public int ItemID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "SS", IsNullable = false)]
|
[XmlElement(ElementName = "SC", IsNullable = false)]
|
||||||
public List<Stat> Stats { get; set; }
|
public int ItemStatsCount { get; set; }
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "SID", IsNullable = false)]
|
||||||
|
public int SetID { get; set; }
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "SS", IsNullable = false)]
|
||||||
|
public List<Stat> Stats { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -4,20 +4,29 @@ 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() { }
|
||||||
[XmlElement(ElementName = "IID", IsNullable = true)]
|
|
||||||
public int? ItemID { get; set; }
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "CID", IsNullable = true)]
|
public ItemSaleConfig(ItemSaleConfig other) {
|
||||||
public int? CategoryID { get; set; }
|
ItemID = other.ItemID;
|
||||||
|
CategoryID = other.CategoryID;
|
||||||
|
RarityID = other.RarityID;
|
||||||
|
Quantity = other.Quantity;
|
||||||
|
RewardItemID = other.RewardItemID;
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "RID", IsNullable = true)]
|
[XmlElement(ElementName = "IID", IsNullable = true)]
|
||||||
public int? RarityID { get; set; }
|
public int? ItemID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "QTY", IsNullable = false)]
|
[XmlElement(ElementName = "CID", IsNullable = true)]
|
||||||
public int Quantity { get; set; }
|
public int? CategoryID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "RIID", IsNullable = false)]
|
[XmlElement(ElementName = "RID", IsNullable = true)]
|
||||||
public int RewardItemID { get; set; }
|
public int? RarityID { get; set; }
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "QTY", IsNullable = false)]
|
||||||
|
public int Quantity { get; set; }
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "RIID", IsNullable = false)]
|
||||||
|
public int RewardItemID { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -4,17 +4,25 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "IS", Namespace = "")]
|
[XmlRoot(ElementName = "IS", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemStat
|
public class ItemStat {
|
||||||
{
|
public ItemStat() { }
|
||||||
[XmlElement(ElementName = "ID")]
|
|
||||||
public int ItemStatID { get; set; }
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "N")]
|
public ItemStat(ItemStat other) {
|
||||||
public string Name { get; set; }
|
ItemStatID = other.ItemStatID;
|
||||||
|
Name = other.Name;
|
||||||
|
Value = other.Value;
|
||||||
|
DataType = other.DataType;
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "V")]
|
[XmlElement(ElementName = "ID")]
|
||||||
public string Value { get; set; }
|
public int ItemStatID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "DTI")]
|
[XmlElement(ElementName = "N")]
|
||||||
public DataTypeInfo DataType { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "V")]
|
||||||
|
public string Value { get; set; }
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "DTI")]
|
||||||
|
public DataTypeInfo DataType { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -4,23 +4,33 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "ItemState", Namespace = "")]
|
[XmlRoot(ElementName = "ItemState", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemState
|
public class ItemState {
|
||||||
{
|
public ItemState() { }
|
||||||
[XmlElement(ElementName = "ItemStateID")]
|
|
||||||
public int ItemStateID;
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "Name")]
|
public ItemState(ItemState other) {
|
||||||
public string Name;
|
ItemStateID = other.ItemStateID;
|
||||||
|
Name = other.Name;
|
||||||
|
Rule = new ItemStateRule(other.Rule);
|
||||||
|
Order = other.Order;
|
||||||
|
AchievementID = other.AchievementID;
|
||||||
|
Rewards = other.Rewards.Select(r => new AchievementReward(r)).ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "Rule")]
|
[XmlElement(ElementName = "ItemStateID")]
|
||||||
public ItemStateRule Rule;
|
public int ItemStateID;
|
||||||
|
|
||||||
[XmlElement(ElementName = "Order")]
|
[XmlElement(ElementName = "Name")]
|
||||||
public int Order;
|
public string Name;
|
||||||
|
|
||||||
[XmlElement(ElementName = "AchievementID", IsNullable = true)]
|
[XmlElement(ElementName = "Rule")]
|
||||||
public int? AchievementID;
|
public ItemStateRule Rule;
|
||||||
|
|
||||||
[XmlElement(ElementName = "Rewards")]
|
[XmlElement(ElementName = "Order")]
|
||||||
public AchievementReward[] Rewards;
|
public int Order;
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "AchievementID", IsNullable = true)]
|
||||||
|
public int? AchievementID;
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "Rewards")]
|
||||||
|
public AchievementReward[] Rewards;
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,13 @@ namespace sodoff.Schema;
|
|||||||
[XmlInclude(typeof(ItemStateCriteriaSpeedUpItem))]
|
[XmlInclude(typeof(ItemStateCriteriaSpeedUpItem))]
|
||||||
[XmlInclude(typeof(ItemStateCriteriaExpiry))]
|
[XmlInclude(typeof(ItemStateCriteriaExpiry))]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemStateCriteria
|
public class ItemStateCriteria {
|
||||||
{
|
public ItemStateCriteria() { }
|
||||||
[XmlElement(ElementName = "Type")]
|
|
||||||
public ItemStateCriteriaType Type;
|
public ItemStateCriteria(ItemStateCriteria other) {
|
||||||
|
Type = other.Type;
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "Type")]
|
||||||
|
public ItemStateCriteriaType Type;
|
||||||
}
|
}
|
||||||
|
@ -4,11 +4,17 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "ItemStateRule", Namespace = "")]
|
[XmlRoot(ElementName = "ItemStateRule", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ItemStateRule
|
public class ItemStateRule {
|
||||||
{
|
public ItemStateRule() { }
|
||||||
[XmlElement(ElementName = "Criterias")]
|
|
||||||
public List<ItemStateCriteria> Criterias;
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "CompletionAction")]
|
public ItemStateRule(ItemStateRule other) {
|
||||||
public CompletionAction CompletionAction;
|
Criterias = other.Criterias.Select(c => new ItemStateCriteria(c)).ToList();
|
||||||
|
CompletionAction = new CompletionAction(other.CompletionAction);
|
||||||
|
}
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "Criterias")]
|
||||||
|
public List<ItemStateCriteria> Criterias;
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "CompletionAction")]
|
||||||
|
public CompletionAction CompletionAction;
|
||||||
}
|
}
|
||||||
|
@ -4,14 +4,21 @@ 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() { }
|
||||||
[XmlElement(ElementName = "IID", IsNullable = false)]
|
|
||||||
public int ItemID { get; set; }
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "IT", IsNullable = false)]
|
public ItemStatsMap(ItemStatsMap other) {
|
||||||
public ItemTier ItemTier { get; set; }
|
ItemID = other.ItemID;
|
||||||
|
ItemTier = other.ItemTier;
|
||||||
|
ItemStats = other.ItemStats.Select(s => new ItemStat(s)).ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "ISS", IsNullable = false)]
|
[XmlElement(ElementName = "IID", IsNullable = false)]
|
||||||
public ItemStat[] ItemStats { get; set; }
|
public int ItemID { get; set; }
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "IT", IsNullable = false)]
|
||||||
|
public ItemTier ItemTier { get; set; }
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "ISS", IsNullable = false)]
|
||||||
|
public ItemStat[] ItemStats { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,32 @@
|
|||||||
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(Mission other) {
|
||||||
|
if (other == null) throw new ArgumentNullException(nameof(other));
|
||||||
|
MissionID = other.MissionID;
|
||||||
|
Name = other.Name;
|
||||||
|
GroupID = other.GroupID;
|
||||||
|
ParentID = other.ParentID;
|
||||||
|
Static = other.Static;
|
||||||
|
Accepted = other.Accepted;
|
||||||
|
Completed = other.Completed;
|
||||||
|
Rule = other.Rule;
|
||||||
|
VersionID = other.VersionID;
|
||||||
|
AchievementID = other.AchievementID;
|
||||||
|
AcceptanceAchievementID = other.AcceptanceAchievementID;
|
||||||
|
Repeatable = other.Repeatable;
|
||||||
|
MissionRule = new MissionRule(other.MissionRule);
|
||||||
|
|
||||||
|
Missions = other.Missions.Select(m => new Mission(m)).ToList();
|
||||||
|
Tasks = other.Tasks.Select(t => new Task(t)).ToList();
|
||||||
|
Rewards = other.Rewards.Select(r => new AchievementReward(r)).ToList();
|
||||||
|
AcceptanceRewards = other.AcceptanceRewards.Select(a => new AchievementReward(a)).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "I")]
|
[XmlElement(ElementName = "I")]
|
||||||
public int MissionID;
|
public int MissionID;
|
||||||
|
|
||||||
|
@ -5,6 +5,16 @@ namespace sodoff.Schema;
|
|||||||
[XmlRoot(ElementName = "MissionCriteria", Namespace = "")]
|
[XmlRoot(ElementName = "MissionCriteria", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class MissionCriteria {
|
public class MissionCriteria {
|
||||||
|
public MissionCriteria() { }
|
||||||
|
|
||||||
|
public MissionCriteria(MissionCriteria other) {
|
||||||
|
Type = other.Type;
|
||||||
|
Ordered = other.Ordered;
|
||||||
|
Min = other.Min;
|
||||||
|
Repeat = other.Repeat;
|
||||||
|
RuleItems = other.RuleItems.Select(r => new RuleItem(r)).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "Type")]
|
[XmlElement(ElementName = "Type")]
|
||||||
public string Type;
|
public string Type;
|
||||||
|
|
||||||
|
@ -5,6 +5,13 @@ namespace sodoff.Schema;
|
|||||||
[XmlRoot(ElementName = "MissionRule", Namespace = "")]
|
[XmlRoot(ElementName = "MissionRule", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class MissionRule {
|
public class MissionRule {
|
||||||
|
public MissionRule() { }
|
||||||
|
|
||||||
|
public MissionRule(MissionRule other) {
|
||||||
|
Prerequisites = other.Prerequisites.Select(p => new PrerequisiteItem(p)).ToList();
|
||||||
|
Criteria = new MissionCriteria(other.Criteria);
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "Prerequisites")]
|
[XmlElement(ElementName = "Prerequisites")]
|
||||||
public List<PrerequisiteItem> Prerequisites;
|
public List<PrerequisiteItem> Prerequisites;
|
||||||
|
|
||||||
|
@ -4,14 +4,21 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "Pair", Namespace = "")]
|
[XmlRoot(ElementName = "Pair", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class Pair
|
public class Pair {
|
||||||
{
|
public Pair() { }
|
||||||
[XmlElement(ElementName = "PairKey")]
|
|
||||||
public string PairKey;
|
public Pair(Pair other) {
|
||||||
|
PairKey = other.PairKey;
|
||||||
[XmlElement(ElementName = "PairValue")]
|
PairValue = other.PairValue;
|
||||||
public string PairValue;
|
UpdateDate = other.UpdateDate;
|
||||||
|
}
|
||||||
[XmlElement(ElementName = "UpdateDate")]
|
|
||||||
public DateTime UpdateDate;
|
[XmlElement(ElementName = "PairKey")]
|
||||||
|
public string PairKey;
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "PairValue")]
|
||||||
|
public string PairValue;
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "UpdateDate")]
|
||||||
|
public DateTime UpdateDate;
|
||||||
}
|
}
|
@ -5,6 +5,12 @@ 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(PairData other) {
|
||||||
|
Pairs = other.Pairs.Select(p => new Pair(p)).ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement("Pair", IsNullable = true)]
|
[XmlElement("Pair", IsNullable = true)]
|
||||||
public Pair[] Pairs { get; set; }
|
public Pair[] Pairs { get; set; }
|
||||||
}
|
}
|
@ -5,6 +5,15 @@ namespace sodoff.Schema;
|
|||||||
[XmlRoot(ElementName = "PrerequisiteItem", Namespace = "")]
|
[XmlRoot(ElementName = "PrerequisiteItem", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class PrerequisiteItem {
|
public class PrerequisiteItem {
|
||||||
|
public PrerequisiteItem() { }
|
||||||
|
|
||||||
|
public PrerequisiteItem(PrerequisiteItem other) {
|
||||||
|
Type = other.Type;
|
||||||
|
Value = other.Value;
|
||||||
|
Quantity = other.Quantity;
|
||||||
|
ClientRule = other.ClientRule;
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "Type")]
|
[XmlElement(ElementName = "Type")]
|
||||||
public PrerequisiteRequiredType Type;
|
public PrerequisiteRequiredType Type;
|
||||||
|
|
||||||
|
@ -5,6 +5,15 @@ namespace sodoff.Schema;
|
|||||||
[XmlRoot(ElementName = "RuleItem", Namespace = "")]
|
[XmlRoot(ElementName = "RuleItem", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class RuleItem {
|
public class RuleItem {
|
||||||
|
public RuleItem() { }
|
||||||
|
|
||||||
|
public RuleItem(RuleItem other) {
|
||||||
|
Type = other.Type;
|
||||||
|
MissionID = other.MissionID;
|
||||||
|
ID = other.ID;
|
||||||
|
Complete = other.Complete;
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "Type")]
|
[XmlElement(ElementName = "Type")]
|
||||||
public RuleItemType Type;
|
public RuleItemType Type;
|
||||||
|
|
||||||
|
@ -4,20 +4,29 @@ 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() { }
|
||||||
[XmlElement(ElementName = "IID", IsNullable = false)]
|
|
||||||
public int ItemID { get; set; }
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "ISID", IsNullable = false)]
|
public Stat(Stat other) {
|
||||||
public int ItemStatsID { get; set; }
|
ItemID = other.ItemID;
|
||||||
|
ItemStatsID = other.ItemStatsID;
|
||||||
|
SetID = other.SetID;
|
||||||
|
Probability = other.Probability;
|
||||||
|
ItemStatsRangeMaps = other.ItemStatsRangeMaps.Select(s => new StatRangeMap(s)).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "SID", IsNullable = false)]
|
[XmlElement(ElementName = "IID", IsNullable = false)]
|
||||||
public int SetID { get; set; }
|
public int ItemID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "PROB", IsNullable = false)]
|
[XmlElement(ElementName = "ISID", IsNullable = false)]
|
||||||
public int Probability { get; set; }
|
public int ItemStatsID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "ISRM", IsNullable = false)]
|
[XmlElement(ElementName = "SID", IsNullable = false)]
|
||||||
public List<StatRangeMap> ItemStatsRangeMaps { get; set; }
|
public int SetID { get; set; }
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "PROB", IsNullable = false)]
|
||||||
|
public int Probability { get; set; }
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "ISRM", IsNullable = false)]
|
||||||
|
public List<StatRangeMap> ItemStatsRangeMaps { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -4,20 +4,29 @@ 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() { }
|
||||||
[XmlElement(ElementName = "ISID", IsNullable = false)]
|
|
||||||
public int ItemStatsID { get; set; }
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "ISN", IsNullable = false)]
|
public StatRangeMap(StatRangeMap other) {
|
||||||
public string ItemStatsName { get; set; }
|
ItemStatsID = other.ItemStatsID;
|
||||||
|
ItemStatsName = other.ItemStatsName;
|
||||||
|
ItemTierID = other.ItemTierID;
|
||||||
|
StartRange = other.StartRange;
|
||||||
|
EndRange = other.EndRange;
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "ITID", IsNullable = false)]
|
[XmlElement(ElementName = "ISID", IsNullable = false)]
|
||||||
public int ItemTierID { get; set; }
|
public int ItemStatsID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "SR", IsNullable = false)]
|
[XmlElement(ElementName = "ISN", IsNullable = false)]
|
||||||
public int StartRange { get; set; }
|
public string ItemStatsName { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "ER", IsNullable = false)]
|
[XmlElement(ElementName = "ITID", IsNullable = false)]
|
||||||
public int EndRange { get; set; }
|
public int ItemTierID { get; set; }
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "SR", IsNullable = false)]
|
||||||
|
public int StartRange { get; set; }
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "ER", IsNullable = false)]
|
||||||
|
public int EndRange { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,17 @@ namespace sodoff.Schema;
|
|||||||
[XmlRoot(ElementName = "Task", Namespace = "")]
|
[XmlRoot(ElementName = "Task", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class Task {
|
public class Task {
|
||||||
|
public Task() { }
|
||||||
|
|
||||||
|
public Task(Task other) {
|
||||||
|
TaskID = other.TaskID;
|
||||||
|
Name = other.Name;
|
||||||
|
Static = other.Static;
|
||||||
|
Completed = other.Completed;
|
||||||
|
Failed = other.Failed;
|
||||||
|
Payload = other.Payload;
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "I")]
|
[XmlElement(ElementName = "I")]
|
||||||
public int TaskID;
|
public int TaskID;
|
||||||
|
|
||||||
|
@ -4,35 +4,49 @@ namespace sodoff.Schema;
|
|||||||
|
|
||||||
[XmlRoot(ElementName = "UserItem", Namespace = "")]
|
[XmlRoot(ElementName = "UserItem", Namespace = "")]
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class UserItemData
|
public class UserItemData {
|
||||||
{
|
public UserItemData() { }
|
||||||
[XmlElement(ElementName = "iid")]
|
|
||||||
public int ItemID { get; set; }
|
|
||||||
|
|
||||||
[XmlElement(ElementName = "md", IsNullable = true)]
|
public UserItemData(UserItemData other) {
|
||||||
public DateTime? ModifiedDate { get; set; }
|
ItemID = other.ItemID;
|
||||||
|
ModifiedDate = other.ModifiedDate;
|
||||||
|
UserItemAttributes = new PairData(other.UserItemAttributes);
|
||||||
|
ItemStats = other.ItemStats.Select(stat => new ItemStat(stat)).ToArray();
|
||||||
|
ItemTier = other.ItemTier;
|
||||||
|
CreatedDate = other.CreatedDate;
|
||||||
|
UserInventoryID = other.UserInventoryID;
|
||||||
|
Quantity = other.Quantity;
|
||||||
|
Uses = other.Uses;
|
||||||
|
Item = new ItemData(other.Item);
|
||||||
|
}
|
||||||
|
|
||||||
[XmlElement(ElementName = "uia", IsNullable = true)]
|
[XmlElement(ElementName = "iid")]
|
||||||
public PairData UserItemAttributes { get; set; }
|
public int ItemID { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "iss", IsNullable = true)]
|
[XmlElement(ElementName = "md", IsNullable = true)]
|
||||||
public ItemStat[] ItemStats { get; set; }
|
public DateTime? ModifiedDate { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "IT", IsNullable = true)]
|
[XmlElement(ElementName = "uia", IsNullable = true)]
|
||||||
public ItemTier? ItemTier { get; set; }
|
public PairData UserItemAttributes { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "cd", IsNullable = true)]
|
[XmlElement(ElementName = "iss", IsNullable = true)]
|
||||||
public DateTime? CreatedDate { get; set; }
|
public ItemStat[] ItemStats { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "uiid")]
|
[XmlElement(ElementName = "IT", IsNullable = true)]
|
||||||
public int UserInventoryID;
|
public ItemTier? ItemTier { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "q")]
|
[XmlElement(ElementName = "cd", IsNullable = true)]
|
||||||
public int Quantity;
|
public DateTime? CreatedDate { get; set; }
|
||||||
|
|
||||||
[XmlElement(ElementName = "u")]
|
[XmlElement(ElementName = "uiid")]
|
||||||
public int Uses;
|
public int UserInventoryID;
|
||||||
|
|
||||||
[XmlElement(ElementName = "i")]
|
[XmlElement(ElementName = "q")]
|
||||||
public ItemData Item;
|
public int Quantity;
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "u")]
|
||||||
|
public int Uses;
|
||||||
|
|
||||||
|
[XmlElement(ElementName = "i")]
|
||||||
|
public ItemData Item;
|
||||||
}
|
}
|
||||||
|
@ -119,20 +119,8 @@ public class MissionStoreSingleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: Don't use BinaryFormatter for deep copying
|
|
||||||
// FIXME: Remove <EnableUnsafeBinaryFormatterSerialization> flag from the project file once we have a different way of deep copying
|
|
||||||
public static Mission DeepCopy(Mission original) {
|
public static Mission DeepCopy(Mission original) {
|
||||||
using (MemoryStream memoryStream = new MemoryStream()) {
|
return new Mission(original);
|
||||||
BinaryFormatter formatter = new BinaryFormatter();
|
|
||||||
|
|
||||||
formatter.Serialize(memoryStream, original);
|
|
||||||
|
|
||||||
memoryStream.Position = 0;
|
|
||||||
|
|
||||||
Mission clone = (Mission)formatter.Deserialize(memoryStream);
|
|
||||||
|
|
||||||
return clone;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
|
|
||||||
|
|
||||||
<DefineConstants>USE_SQLITE;$(DefineConstants)</DefineConstants>
|
<DefineConstants>USE_SQLITE;$(DefineConstants)</DefineConstants>
|
||||||
<DefineConstants>USE_POSTGRESQL;$(DefineConstants)</DefineConstants>
|
<DefineConstants>USE_POSTGRESQL;$(DefineConstants)</DefineConstants>
|
||||||
@ -12,26 +11,26 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="7.0.7" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="9.0.6" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Choose>
|
<Choose>
|
||||||
<When Condition="$(DefineConstants.Contains('USE_SQLITE'))">
|
<When Condition="$(DefineConstants.Contains('USE_SQLITE'))">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.7" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.6" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</When>
|
</When>
|
||||||
</Choose>
|
</Choose>
|
||||||
<Choose>
|
<Choose>
|
||||||
<When Condition="$(DefineConstants.Contains('USE_POSTGRESQL'))">
|
<When Condition="$(DefineConstants.Contains('USE_POSTGRESQL'))">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.11" />
|
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</When>
|
</When>
|
||||||
</Choose>
|
</Choose>
|
||||||
<Choose>
|
<Choose>
|
||||||
<When Condition="$(DefineConstants.Contains('USE_MYSQL'))">
|
<When Condition="$(DefineConstants.Contains('USE_MYSQL'))">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="MySql.EntityFrameworkCore" Version="7.0.5" />
|
<PackageReference Include="MySql.EntityFrameworkCore" Version="9.0.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</When>
|
</When>
|
||||||
</Choose>
|
</Choose>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user