More types

This commit is contained in:
Cj
2025-01-07 06:04:21 -05:00
parent cfcd724ebe
commit 0d0409f876
25 changed files with 432 additions and 1 deletions
@@ -0,0 +1,15 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Trade;
public class ProcessBaseTradeRequestData
{
[JsonPropertyName("Action")]
public string Action { get; set; }
[JsonPropertyName("type")]
public string Type { get; set; }
[JsonPropertyName("tid")]
public string TransactionId { get; set; }
}
@@ -0,0 +1,37 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Trade;
public class ProcessBuyTradeRequestData : ProcessBaseTradeRequestData
{
[JsonPropertyName("Action")]
public string Action { get; set; } // TODO: formerly - "buy_from_trader" | "TradingConfirm" | "RestoreHealth" | "SptInsure" | "SptRepair" | ""
[JsonPropertyName("type")]
public string Type { get; set; }
[JsonPropertyName("tid")]
public string TId { get; set; }
[JsonPropertyName("item_id")]
public string ItemId { get; set; }
[JsonPropertyName("count")]
public int Count { get; set; }
[JsonPropertyName("scheme_id")]
public int SchemeId { get; set; }
[JsonPropertyName("scheme_items")]
public List<SchemeItem> SchemeItems { get; set; }
}
public class SchemeItem
{
/** Id of stack to take money from, is money tpl when Action is `SptInsure` */
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("count")]
public int Count { get; set; }
}
@@ -0,0 +1,33 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Trade;
public class ProcessRagfairTradeRequestData
{
[JsonPropertyName("Action")]
public string Action { get; set; }
[JsonPropertyName("offers")]
public List<OfferRequest> Offers { get; set; }
}
public class OfferRequest
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("count")]
public int Count { get; set; }
[JsonPropertyName("items")]
public List<ItemRequest> Items { get; set; }
}
public class ItemRequest
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("count")]
public int Count { get; set; }
}
@@ -0,0 +1,33 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Trade;
public class ProcessSellTradeRequestData : ProcessBaseTradeRequestData
{
[JsonPropertyName("Action")]
public string Action { get; set; } = "sell_to_trader";
[JsonPropertyName("type")]
public string Type { get; set; }
[JsonPropertyName("tid")]
public string Tid { get; set; }
[JsonPropertyName("price")]
public double Price { get; set; }
[JsonPropertyName("items")]
public List<SoldItem> Items { get; set; }
}
public class SoldItem
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("count")]
public int Count { get; set; }
[JsonPropertyName("scheme_id")]
public int SchemeId { get; set; }
}
@@ -0,0 +1,19 @@
using System.Text.Json.Serialization;
using Core.Models.Eft.Common.Request;
namespace Core.Models.Eft.Trade;
public class SellScavItemsToFenceRequestData
{
[JsonPropertyName("Action")]
public string Action { get; set; } = "SellAllFromSavage";
[JsonPropertyName("totalValue")]
public double TotalValue { get; set; }
[JsonPropertyName("fromOwner")]
public OwnerInfo FromOwner { get; set; }
[JsonPropertyName("toOwner")]
public OwnerInfo ToOwner { get; set; }
}
+66
View File
@@ -0,0 +1,66 @@
using System.Text.Json.Serialization;
using Core.Models.Enums;
namespace Core.Models.Eft.Weather;
public class WeatherData
{
[JsonPropertyName("acceleration")]
public double Acceleration { get; set; }
[JsonPropertyName("time")]
public string Time { get; set; }
[JsonPropertyName("date")]
public string Date { get; set; }
[JsonPropertyName("weather")]
public Weather Weather { get; set; }
[JsonPropertyName("season")]
public Season Season { get; set; }
}
public class Weather
{
[JsonPropertyName("pressure")]
public double Pressure { get; set; }
[JsonPropertyName("temp")]
public double Temperature { get; set; }
[JsonPropertyName("fog")]
public double Fog { get; set; }
[JsonPropertyName("rain_intensity")]
public double RainIntensity { get; set; }
/** 1 - 3 light rain, 3+ 'rain' */
[JsonPropertyName("rain")]
public double Rain { get; set; }
[JsonPropertyName("wind_gustiness")]
public double WindGustiness { get; set; }
[JsonPropertyName("wind_direction")]
public WindDirection WindDirection { get; set; }
[JsonPropertyName("wind_speed")]
public double WindSpeed { get; set; }
/** < -0.4 = clear day */
[JsonPropertyName("cloud")]
public double Cloud { get; set; }
[JsonPropertyName("time")]
public string Time { get; set; }
[JsonPropertyName("date")]
public string Date { get; set; }
[JsonPropertyName("timestamp")]
public long Timestamp { get; set; }
[JsonPropertyName("sptInRaidTimestamp")]
public long SptInRaidTimestamp { get; set; }
}
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Wishlist;
public class AddToWishlistRequest
{
[JsonPropertyName("Action")]
public string Action { get; set; }
[JsonPropertyName("items")]
public Dictionary<string, int> Items { get; set; }
}
@@ -0,0 +1,15 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Wishlist;
public class ChangeWishlistItemCategoryRequest
{
[JsonPropertyName("Action")]
public string Action { get; set; }
[JsonPropertyName("item")]
public string Item { get; set; }
[JsonPropertyName("category")]
public int Category { get; set; }
}
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Wishlist;
public class RemoveFromWishlistRequest
{
[JsonPropertyName("Action")]
public string Action { get; set; }
[JsonPropertyName("items")]
public List<string> Items { get; set; }
}
+9
View File
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ws;
public class WsAid : WsNotificationEvent
{
[JsonPropertyName("aid")]
public int Aid { get; set; }
}
+12
View File
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ws;
public class WsAidNickname : WsNotificationEvent
{
[JsonPropertyName("aid")]
public int Aid { get; set; }
[JsonPropertyName("Nickname")]
public string Nickname { get; set; }
}
@@ -0,0 +1,16 @@
using System.Text.Json.Serialization;
using Core.Models.Eft.Profile;
namespace Core.Models.Eft.Ws;
public class WsChatMessageReceived : WsNotificationEvent
{
[JsonPropertyName("dialogId")]
public string DialogId { get; set; }
[JsonPropertyName("message")]
public Message Message { get; set; }
[JsonPropertyName("profiles")]
public List<GroupCharacter>? Profiles { get; set; }
}
+9
View File
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ws;
public class WsFriendsListAccept : WsNotificationEvent
{
[JsonPropertyName("profile")]
public SearchFriendResponse Profile { get; set; }
}
+9
View File
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ws;
public class WsGroupId : WsNotificationEvent
{
[JsonPropertyName("groupId")]
public string GroupId { get; set; }
}
@@ -0,0 +1,5 @@
namespace Core.Models.Eft.Ws;
public class WsGroupMatchInviteAccept : WsNotificationEvent, IGroupCharacter
{
}
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ws;
public class WsGroupMatchInviteDecline : WsNotificationEvent
{
[JsonPropertyName("aid")]
public int Aid { get; set; }
[JsonPropertyName("Nickname")]
public string Nickname { get; set; }
}
@@ -0,0 +1,15 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ws;
public class WsGroupMatchInviteSend : WsNotificationEvent
{
[JsonPropertyName("requestId")]
public string RequestId { get; set; }
[JsonPropertyName("from")]
public int From { get; set; }
[JsonPropertyName("members")]
public List<GroupCharacter> Members { get; set; }
}
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ws;
public class WsGroupMatchLeaderChanged : WsNotificationEvent
{
[JsonPropertyName("owner")]
public int Owner { get; set; }
}
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ws;
public class WsGroupMatchRaidReady : WsNotificationEvent
{
[JsonPropertyName("extendedProfile")]
public GroupCharacter ExtendedProfile { get; set; }
}
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ws;
public class WsGroupMatchRaidSettings : WsNotificationEvent
{
[JsonPropertyName("raidSettings")]
public RaidSettings RaidSettings { get; set; }
}
+12
View File
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ws;
public class WsNotificationEvent
{
[JsonPropertyName("type")]
public string EventType { get; set; }
[JsonPropertyName("eventId")]
public string? EventIdentifier { get; set; }
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Models.Eft.Ws;
public class WsPing : WsNotificationEvent
{
}
+15
View File
@@ -0,0 +1,15 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ws;
public class WsRagfairOfferSold : WsNotificationEvent
{
[JsonPropertyName("offerId")]
public string OfferId { get; set; }
[JsonPropertyName("count")]
public int Count { get; set; }
[JsonPropertyName("handbookId")]
public string HandbookId { get; set; }
}
+42
View File
@@ -0,0 +1,42 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Ws;
public class WsUserConfirmed : WsNotificationEvent
{
[JsonPropertyName("profileid")]
public string ProfileId { get; set; }
[JsonPropertyName("profileToken")]
public string ProfileToken { get; set; }
[JsonPropertyName("status")]
public ProfileStatus Status { get; set; }
[JsonPropertyName("ip")]
public string Ip { get; set; }
[JsonPropertyName("port")]
public int Port { get; set; }
[JsonPropertyName("sid")]
public string Sid { get; set; }
[JsonPropertyName("version")]
public string Version { get; set; }
[JsonPropertyName("location")]
public string Location { get; set; }
[JsonPropertyName("raidMode")]
public RaidMode RaidMode { get; set; }
[JsonPropertyName("mode")]
public string Mode { get; set; }
[JsonPropertyName("shortId")]
public string ShortId { get; set; }
[JsonPropertyName("additional_info")]
public List<object> AdditionalInfo { get; set; } // TODO: Was `any` in the node server.
}
@@ -8,5 +8,5 @@ public class GetLocalWeatherResponseData
public int Season { get; set; }
[JsonPropertyName("weather")]
public List<Weather> Weather { get; set; }
public List<Eft.Weather.Weather> Weather { get; set; }
}