Type fixes

This commit is contained in:
CWX
2025-01-24 12:27:57 +00:00
parent 8cc8300a70
commit 9cf43cda89
6 changed files with 10 additions and 37 deletions
@@ -576,7 +576,7 @@ public record HideoutImprovement
public record Production // use this instead of productive and scavcase
{
public List<Product>? Products { get; set; }
public List<Item>? Products { get; set; }
/** Seconds passed of production */
public double? Progress { get; set; }
@@ -665,17 +665,8 @@ public record HideoutSlot
public List<HideoutItem>? Items { get; set; }
}
public record HideoutItem
public record HideoutItem : Item
{
[JsonPropertyName("_id")]
public string? Id { get; set; }
[JsonPropertyName("_tpl")]
public string? Template { get; set; }
[JsonPropertyName("upd")]
public Upd? Upd { get; set; }
[JsonPropertyName("count")]
public double? Count { get; set; }
}
@@ -9,7 +9,7 @@ public record Item
public required string Id { get; set; }
[JsonPropertyName("_tpl")]
public required string Template { get; set; }
public string Template { get; set; }
[JsonPropertyName("parentId")]
public string? ParentId { get; set; }
@@ -25,20 +25,6 @@ public record Item
[JsonPropertyName("upd")]
public Upd? Upd { get; set; }
public ItemEvent.Product ConvertToProduct()
{
// TODO - maybe this entire product item can be replaced with Item?
return new ItemEvent.Product
{
Id = Id,
Template = Template,
ParentId = ParentId,
SlotId = SlotId,
Upd = Upd,
Location = (ItemLocation)Location
};
}
}
public record ItemLocation
@@ -9,7 +9,7 @@ public record AddItemDirectRequest
/// Item and child mods to add to player inventory
/// </summary>
[JsonPropertyName("itemWithModsToAdd")]
public List<HideoutItem>? ItemWithModsToAdd { get; set; }
public List<Item>? ItemWithModsToAdd { get; set; }
[JsonPropertyName("foundInRaid")]
public bool? FoundInRaid { get; set; }
@@ -136,13 +136,13 @@ public record EquipmentBuildChange
public record ItemChanges
{
[JsonPropertyName("new")]
public List<Product>? NewItems { get; set; }
public List<Item>? NewItems { get; set; }
[JsonPropertyName("change")]
public List<Product>? ChangedItems { get; set; }
public List<Item>? ChangedItems { get; set; }
[JsonPropertyName("del")]
public List<Product> DeletedItems { get; set; } // Only needs _id property
public List<Item> DeletedItems { get; set; } // Only needs _id property
}
/** Related to TraderInfo */
@@ -163,7 +163,3 @@ public record TraderData
[JsonPropertyName("disabled")]
public bool? Disabled { get; set; }
}
public record Product : Item
{
}
@@ -70,7 +70,7 @@ public class HideoutItemEventRouter : ItemEventRouterDefinition
case HideoutEventActions.HIDEOUT_IMPROVE_AREA:
return _hideoutCallbacks.ImproveArea(pmcData, body as HideoutImproveAreaRequestData, sessionID);
case HideoutEventActions.HIDEOUT_CANCEL_PRODUCTION_COMMAND:
return _hideoutCallbacks.CancelProduction(pmcData, body as HideoutImproveAreaRequestData, sessionID);
return _hideoutCallbacks.CancelProduction(pmcData, body as HideoutCancelProductionRequestData, sessionID);
case HideoutEventActions.HIDEOUT_CIRCLE_OF_CULTIST_PRODUCTION_START:
return _hideoutCallbacks.CicleOfCultistProductionStart(pmcData, body as HideoutCircleOfCultistProductionStartRequestData, sessionID);
case HideoutEventActions.HIDEOUT_DELETE_PRODUCTION_COMMAND:
+2 -2
View File
@@ -183,7 +183,7 @@ public class PaymentService(
}
// Inform client of change to items StackObjectsCount
output.ProfileChanges[sessionID].Items.ChangedItems.Add(_itemHelper.GetProductFromItem(item));
output.ProfileChanges[sessionID].Items.ChangedItems.Add(item);
if (skipSendingMoneyToStash) {
break;
@@ -275,7 +275,7 @@ public class PaymentService(
} else {
profileMoneyItem.Upd.StackObjectsCount -= leftToPay;
leftToPay = 0;
output.ProfileChanges[sessionID].Items.ChangedItems.Add(_itemHelper.GetProductFromItem(profileMoneyItem));
output.ProfileChanges[sessionID].Items.ChangedItems.Add(profileMoneyItem);
}
if (leftToPay == 0) {