More Types

This commit is contained in:
CWX
2025-01-06 23:49:14 +00:00
parent 211e68f3fc
commit 8b8fa6e4fd
34 changed files with 714 additions and 14 deletions
+77 -6
View File
@@ -1,4 +1,5 @@
using Core.Models.Eft.Common;
using Core.Models.Eft.Common.Request;
using Core.Models.Eft.Dialog;
using Core.Models.Eft.HttpResponse;
using Core.Models.Eft.Profile;
@@ -27,7 +28,7 @@ public class DialogCallbacks
throw new NotImplementedException();
}
public GetBodyResponseData<object> GetMailDialogInfo(string url, GetMailDialogInfoRequestData info, string sessionID)
public GetBodyResponseData<DialogueInfo> GetMailDialogInfo(string url, GetMailDialogInfoRequestData info, string sessionID)
{
throw new NotImplementedException();
}
@@ -52,7 +53,12 @@ public class DialogCallbacks
throw new NotImplementedException();
}
public GetBodyResponseData<GetAllAttachmentsResponse> GetAllAttachments(string url, EmptyRequestData info, string sessionID)
public GetBodyResponseData<object> GetAllAttachments(string url, EmptyRequestData info, string sessionID) // TODO: Fix type - GetBodyResponseData<GetAllAttachmentsResponse | Undefined>
{
throw new NotImplementedException();
}
public GetBodyResponseData<string> SendMessage(string url, SendMessageRequest info, string sessionID)
{
throw new NotImplementedException();
}
@@ -64,20 +70,85 @@ public class DialogCallbacks
public GetBodyResponseData<List<object>> ListInbox(string url, EmptyRequestData info, string sessionID)
{
throw new NotImplementedException();
}
public NullResponseData SendFriendRequest(string url, FriendRequestData info, string sessionID)
public GetBodyResponseData<FriendRequestSendResponse> SendFriendRequest(string url, FriendRequestData info, string sessionID)
{
throw new NotImplementedException();
}
public GetBodyResponseData<int> SendMessage(string url, SendMessageRequest info, string sessionID)
public NullResponseData AcceptAllFriendRequests(string url, EmptyRequestData info, string sessionID)
{
throw new NotImplementedException();
}
public bool Update()
public GetBodyResponseData<bool> AcceptFriendRequest(string url, AcceptFriendRequestData info, string sessionID)
{
throw new NotImplementedException();
}
public GetBodyResponseData<bool> DeclineFriendRequest(string url, DeclineFriendRequestData info, string sessionID)
{
throw new NotImplementedException();
}
public GetBodyResponseData<bool> CancelFriendRequest(string url, CancelFriendRequestData info, string sessionID)
{
throw new NotImplementedException();
}
public NullResponseData DeleteFriend(string url, DeleteFriendRequest info, string sessionID)
{
throw new NotImplementedException();
}
public NullResponseData IgnoreFriend(string url, UIDRequestData info, string sessionID)
{
throw new NotImplementedException();
}
public NullResponseData UnIgnoreFriend(string url, UIDRequestData info, string sessionID)
{
throw new NotImplementedException();
}
public GetBodyResponseData<List<object>> ClearMail(string url, ClearMailMessageRequest info, string sessionID)
{
throw new NotImplementedException();
}
public GetBodyResponseData<List<object>> RemoveMail(string url, RemoveMailMessageRequest info, string sessionID)
{
throw new NotImplementedException();
}
public GetBodyResponseData<List<object>> CreateGroupMail(string url, CreateGroupMailRequest info, string sessionID)
{
throw new NotImplementedException();
}
public GetBodyResponseData<List<object>> ChangeMailGroupOwner(string url, ChangeGroupMailOwnerRequest info, string sessionID)
{
throw new NotImplementedException();
}
public GetBodyResponseData<List<object>> AddUserToMail(string url, AddUserGroupMailRequest info, string sessionID)
{
throw new NotImplementedException();
}
public GetBodyResponseData<List<object>> RemoveUserFromMail(string url, RemoveUserGroupMailRequest info, string sessionID)
{
throw new NotImplementedException();
}
public async Task<bool> OnUpdate(int timeSinceLastRun)
{
throw new NotImplementedException();
}
public string GetRoute()
{
throw new NotImplementedException();
}
+57 -7
View File
@@ -1,18 +1,38 @@
namespace Core.Callbacks;
using Core.Models.Eft.Common;
using Core.Models.Eft.Common.Request;
using Core.Models.Eft.Game;
using Core.Models.Eft.HttpResponse;
namespace Core.Callbacks;
public class GameCallbacks
{
public NullResponseData VersionValidata(string url, VersionValidaterequestData info, string sessionID)
public GameCallbacks()
{
}
public async Task OnLoad()
{
throw new NotImplementedException();
}
public GetBodyResponseData<object> GameStart(string url, EmptyRequestData info, string sessionID)
public string GetRoute()
{
throw new NotImplementedException();
}
public GetBodyResponseData<object> GameLogout(string url, EmptyRequestData info, string sessionID)
public NullResponseData VersionValidata(string url, VersionValidateRequestData info, string sessionID)
{
throw new NotImplementedException();
}
public GetBodyResponseData<GameStartResponse> GameStart(string url, EmptyRequestData info, string sessionID)
{
throw new NotImplementedException();
}
public GetBodyResponseData<GameLogoutResponseData> GameLogout(string url, EmptyRequestData info, string sessionID)
{
throw new NotImplementedException();
}
@@ -22,17 +42,22 @@ public class GameCallbacks
throw new NotImplementedException();
}
public GetBodyResponseData<object> GetServer(string url, EmptyRequestData info, string sessionID)
public GetBodyResponseData<GameModeResponse> GetGameMode(string url, GameModeRequestData info, string sessionID)
{
throw new NotImplementedException();
}
public GetBodyResponseData<object> ValidateGameVersion(string url, EmptyRequestData info, string sessionID)
public GetBodyResponseData<List<ServerDetails>> GetServer(string url, EmptyRequestData info, string sessionID)
{
throw new NotImplementedException();
}
public GetBodyResponseData<object> GameKeepalive(string url, EmptyRequestData info, string sessionID)
public GetBodyResponseData<CheckVersionResponse> ValidateGameVersion(string url, EmptyRequestData info, string sessionID)
{
throw new NotImplementedException();
}
public GetBodyResponseData<GameKeepAliveResponse> GameKeepalive(string url, EmptyRequestData info, string sessionID)
{
throw new NotImplementedException();
}
@@ -41,4 +66,29 @@ public class GameCallbacks
{
throw new NotImplementedException();
}
public NullResponseData ReportNickname(string url, UIDRequestData info, string sessionID)
{
throw new NotImplementedException();
}
public GetRaidTimeResponse GetRaidTime(string url, GetRaidTimeRequest info, string sessionID)
{
throw new NotImplementedException();
}
public object GetSurvey(string url, EmptyRequestData info, string sessionID) // TODO: Types given was NullResponseData | GetBodyResponseData<SurveyResponseData>
{
throw new NotImplementedException();
}
public NullResponseData GetSurveyView(string url, object info, string sessionID)
{
throw new NotImplementedException();
}
public NullResponseData SendSurveyOpinion(string url, SendSurveyOpinionRequest info, string sessionID)
{
throw new NotImplementedException();
}
}
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Common.Request;
public class UIDRequestData
{
[JsonPropertyName("uid")]
public string Uid { get; set; }
}
@@ -0,0 +1,21 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Dialog;
public class AcceptFriendRequestData : BaseFriendRequest
{
}
public class CancelFriendRequestData : BaseFriendRequest
{
}
public class DeclineFriendRequestData : BaseFriendRequest
{
}
public class BaseFriendRequest
{
[JsonPropertyName("profileId")]
public string ProfileId { get; set; }
}
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Dialog;
public class AddUserGroupMailRequest
{
[JsonPropertyName("dialogId")]
public string DialogId { get; set; }
[JsonPropertyName("uid")]
public string Uid { get; set; }
}
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Dialog;
public class ChangeGroupMailOwnerRequest
{
[JsonPropertyName("dialogId")]
public string DialogId { get; set; }
[JsonPropertyName("uid")]
public string Uid { get; set; }
}
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Dialog;
public class ClearMailMessageRequest
{
[JsonPropertyName("dialogId")]
public string DialogId { get; set; }
}
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Dialog;
public class CreateGroupMailRequest
{
[JsonPropertyName("Name")]
public string Name { get; set; }
[JsonPropertyName("Users")]
public List<string> Users { get; set; }
}
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Dialog;
public class DeleteFriendRequest
{
[JsonPropertyName("friend_id")]
public string FriendId { get; set; }
}
@@ -0,0 +1,15 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Dialog;
public class FriendRequestData
{
[JsonPropertyName("status")]
public int Status { get; set; }
[JsonPropertyName("requestId")]
public string RequestId { get; set; }
[JsonPropertyName("retryAfter")]
public int RetryAfter { get; set; }
}
@@ -0,0 +1,15 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Dialog;
public class FriendRequestSendResponse
{
[JsonPropertyName("status")]
public int Status { get; set; }
[JsonPropertyName("requestId")]
public string RequestId { get; set; }
[JsonPropertyName("retryAfter")]
public int RetryAfter { get; set; }
}
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Dialog;
public class GetMailDialogInfoRequestData
{
[JsonPropertyName("dialogId")]
public string DialogId { get; set; }
}
@@ -0,0 +1,19 @@
using System.Text.Json.Serialization;
using Core.Models.Enums;
namespace Core.Models.Eft.Dialog;
public class GetMailDialogViewRequestData
{
[JsonPropertyName("type")]
public MessageType Type { get; set; }
[JsonPropertyName("dialogId")]
public string DialogId { get; set; }
[JsonPropertyName("limit")]
public int Limit { get; set; }
[JsonPropertyName("time")]
public decimal Time { get; set; } // decimal
}
@@ -0,0 +1,16 @@
using System.Text.Json.Serialization;
using Core.Models.Eft.Profile;
namespace Core.Models.Eft.Dialog;
public class GetMailDialogViewResponseData
{
[JsonPropertyName("messages")]
public List<Message> Messages { get; set; }
[JsonPropertyName("profiles")]
public List<UserDialogInfo> Profiles { get; set; }
[JsonPropertyName("hasMessagesWithRewards")]
public bool HasMessagesWithRewards { get; set; }
}
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Dialog;
public class PinDialogRequestData
{
[JsonPropertyName("dialogId")]
public string DialogId { get; set; }
}
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Dialog;
public class RemoveDialogRequestData
{
[JsonPropertyName("dialogId")]
public string DialogId { get; set; }
}
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Dialog;
public class RemoveMailMessageRequest
{
[JsonPropertyName("dialogId")]
public string DialogId { get; set; }
}
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Dialog;
public class RemoveUserGroupMailRequest
{
[JsonPropertyName("dialogId")]
public string DialogId { get; set; }
[JsonPropertyName("uid")]
public string Uid { get; set; }
}
@@ -0,0 +1,18 @@
using System.Text.Json.Serialization;
using Core.Models.Enums;
namespace Core.Models.Eft.Dialog;
public class SendMessageRequest {
[JsonPropertyName("dialogId")]
public string DialogId { get; set; }
[JsonPropertyName("type")]
public MessageType Type { get; set; }
[JsonPropertyName("text")]
public string Text { get; set; }
[JsonPropertyName("replyTo")]
public string ReplyTo { get; set; }
}
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Dialog;
public class SetDialogReadRequestData
{
[JsonPropertyName("dialogId")]
public List<string> DialogId { get; set; }
}
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Game;
public class CheckVersionResponse
{
[JsonPropertyName("isvalid")]
public bool IsValid { get; set; }
[JsonPropertyName("latestVersion")]
public string LatestVersion { get; set; }
}
@@ -0,0 +1,76 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Game;
public class GameConfigResponse
{
[JsonPropertyName("aid")]
public int Aid { get; set; }
[JsonPropertyName("lang")]
public string Language { get; set; }
[JsonPropertyName("languages")]
public Dictionary<string, string> Languages { get; set; }
[JsonPropertyName("ndaFree")]
public bool IsNdaFree { get; set; }
[JsonPropertyName("taxonomy")]
public int Taxonomy { get; set; }
[JsonPropertyName("activeProfileId")]
public string ActiveProfileId { get; set; }
[JsonPropertyName("backend")]
public Backend Backend { get; set; }
[JsonPropertyName("useProtobuf")]
public bool UseProtobuf { get; set; }
[JsonPropertyName("utc_time")]
public long UtcTime { get; set; }
/** Total in game time */
[JsonPropertyName("totalInGame")]
public int TotalInGame { get; set; }
[JsonPropertyName("reportAvailable")]
public bool IsReportAvailable { get; set; }
[JsonPropertyName("twitchEventMember")]
public bool IsTwitchEventMember { get; set; }
[JsonPropertyName("sessionMode")]
public string SessionMode { get; set; }
[JsonPropertyName("purchasedGames")]
public PurchasedGames PurchasedGames { get; set; }
}
public class PurchasedGames
{
[JsonPropertyName("eft")]
public bool IsEftPurchased { get; set; }
[JsonPropertyName("arena")]
public bool IsArenaPurchased { get; set; }
}
public class Backend
{
[JsonPropertyName("Lobby")]
public string Lobby { get; set; }
[JsonPropertyName("Trading")]
public string Trading { get; set; }
[JsonPropertyName("Messaging")]
public string Messaging { get; set; }
[JsonPropertyName("Main")]
public string Main { get; set; }
[JsonPropertyName("RagFair")]
public string RagFair { get; set; }
}
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Game;
public class GameEmptyCrcRequestData
{
[JsonPropertyName("crc")]
public int Crc { get; set; }
}
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Game;
public class GameKeepAliveResponse
{
[JsonPropertyName("msg")]
public string Message { get; set; }
[JsonPropertyName("utc_time")]
public double UtcTime { get; set; }
}
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Game;
public class GameLogoutResponseData
{
[JsonPropertyName("status")]
public string Status { get; set; }
}
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Game;
public class GameModeRequestData
{
[JsonPropertyName("sessionMode")]
public string? SessionMode { get; set; }
}
+18
View File
@@ -0,0 +1,18 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Game;
public enum SessionMode
{
REGULAR,
PVE
}
public class GameModeResponse
{
[JsonPropertyName("gameMode")]
public SessionMode GameMode { get; set; }
[JsonPropertyName("backendUrl")]
public string BackendUrl { get; set; }
}
@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Game;
public class GameStartResponse
{
[JsonPropertyName("utc_time")]
public double UtcTime { get; set; }
}
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Game;
public class GetRaidTimeRequest
{
[JsonPropertyName("Side")]
public string Side { get; set; }
[JsonPropertyName("Location")]
public string Location { get; set; }
}
@@ -0,0 +1,33 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Game;
public class GetRaidTimeResponse
{
[JsonPropertyName("RaidTimeMinutes")]
public int RaidTimeMinutes { get; set; }
[JsonPropertyName("NewSurviveTimeSeconds")]
public int? NewSurviveTimeSeconds { get; set; }
[JsonPropertyName("OriginalSurvivalTimeSeconds")]
public int OriginalSurvivalTimeSeconds { get; set; }
[JsonPropertyName("ExitChanges")]
public List<ExtractChange> ExitChanges { get; set; }
}
public class ExtractChange
{
[JsonPropertyName("Name")]
public string Name { get; set; }
[JsonPropertyName("MinTime")]
public int? MinTime { get; set; }
[JsonPropertyName("MaxTime")]
public int? MaxTime { get; set; }
[JsonPropertyName("Chance")]
public int? Chance { get; set; }
}
@@ -0,0 +1,24 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Game;
public class SendSurveyOpinionRequest
{
[JsonPropertyName("surveyId")]
public int SurveyId { get; set; }
[JsonPropertyName("answers")]
public List<SurveyOpinionAnswer> Answers { get; set; }
}
public class SurveyOpinionAnswer
{
[JsonPropertyName("questionId")]
public int QuestionId { get; set; }
[JsonPropertyName("answerType")]
public string AnswerType { get; set; }
[JsonPropertyName("answers")]
public object Answers { get; set; }
}
+12
View File
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Game;
public class ServerDetails
{
[JsonPropertyName("ip")]
public string Ip { get; set; }
[JsonPropertyName("port")]
public int Port { get; set; }
}
@@ -0,0 +1,90 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Game;
public class SurveyResponseData
{
[JsonPropertyName("locale")]
public Dictionary<string, Dictionary<string, string>> Locale { get; set; }
[JsonPropertyName("survey")]
public Survey Survey { get; set; }
}
public class Survey
{
[JsonPropertyName("id")]
public int Id { get; set; }
[JsonPropertyName("welcomePageData")]
public WelcomePageData WelcomePageData { get; set; }
[JsonPropertyName("farewellPageData")]
public FarewellPageData FarewellPageData { get; set; }
[JsonPropertyName("pages")]
public List<List<int>> Pages { get; set; }
[JsonPropertyName("questions")]
public List<SurveyQuestion> Questions { get; set; }
[JsonPropertyName("isNew")]
public bool IsNew { get; set; }
}
public class WelcomePageData
{
[JsonPropertyName("titleLocaleKey")]
public string TitleLocaleKey { get; set; }
[JsonPropertyName("timeLocaleKey")]
public string TimeLocaleKey { get; set; }
[JsonPropertyName("descriptionLocaleKey")]
public string DescriptionLocaleKey { get; set; }
}
public class FarewellPageData
{
[JsonPropertyName("textLocaleKey")]
public string TextLocaleKey { get; set; }
}
public class SurveyQuestion
{
[JsonPropertyName("id")]
public int Id { get; set; }
[JsonPropertyName("sortIndex")]
public int SortIndex { get; set; }
[JsonPropertyName("titleLocaleKey")]
public string TitleLocaleKey { get; set; }
[JsonPropertyName("hintLocaleKey")]
public string HintLocaleKey { get; set; }
[JsonPropertyName("answerLimit")]
public int AnswerLimit { get; set; }
[JsonPropertyName("answerType")]
public string AnswerType { get; set; }
[JsonPropertyName("answers")]
public List<SurveyAnswer> Answers { get; set; }
}
public class SurveyAnswer
{
[JsonPropertyName("id")]
public int Id { get; set; }
[JsonPropertyName("questionId")]
public int QuestionId { get; set; }
[JsonPropertyName("sortIndex")]
public int SortIndex { get; set; }
[JsonPropertyName("localeKey")]
public string LocaleKey { get; set; }
}
@@ -0,0 +1,30 @@
using System.Text.Json.Serialization;
namespace Core.Models.Eft.Game;
public class VersionValidateRequestData
{
[JsonPropertyName("version")]
public Version Version { get; set; }
[JsonPropertyName("develop")]
public bool Develop { get; set; }
}
public class Version
{
[JsonPropertyName("major")]
public string Major { get; set; }
[JsonPropertyName("minor")]
public string Minor { get; set; }
[JsonPropertyName("game")]
public string Game { get; set; }
[JsonPropertyName("backend")]
public string Backend { get; set; }
[JsonPropertyName("taxonomy")]
public string Taxonomy { get; set; }
}