diff --git a/Expedience.Models/ClientInfo.cs b/Expedience.Models/ClientInfo.cs new file mode 100644 index 0000000..2376263 --- /dev/null +++ b/Expedience.Models/ClientInfo.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Expedience.Models +{ + public class ClientInfo + { + public string GameVersion { get; set; } + public string GameLanguage { get; set; } + public string PluginVersion { get; set; } + } +} diff --git a/Expedience.Models/CompletionTimeInfo.cs b/Expedience.Models/CompletionTimeInfo.cs new file mode 100644 index 0000000..198d9c2 --- /dev/null +++ b/Expedience.Models/CompletionTimeInfo.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Expedience.Models +{ + public class CompletionTimeInfo + { + public CompletionTimeInfo() + { + + } + public CompletionTimeInfo(TimeSpan completionTime) + { + Hours = completionTime.Hours; + Minutes = completionTime.Minutes; + Seconds = completionTime.Seconds; + Milliseconds = completionTime.Milliseconds; + CompletionTimeText = completionTime.ToString(@"hh\:mm\:ss\.fff"); + } + + public int Hours { get; set; } + public int Minutes { get; set; } + public int Seconds { get; set; } + public int Milliseconds { get; set; } + public string CompletionTimeText { get; set; } + } +} diff --git a/Expedience.Models/CurrentDutyInfo.cs b/Expedience.Models/CurrentDutyInfo.cs new file mode 100644 index 0000000..0ead3ee --- /dev/null +++ b/Expedience.Models/CurrentDutyInfo.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; + +namespace Expedience.Models +{ + public class CurrentDutyInfo + { + public CurrentDutyInfo(Stopwatch stopwatch) + { + _stopwatch = stopwatch; + StartTime = DateTime.UtcNow; + } + + private Stopwatch _stopwatch; + public PlayerInfo Player { get; set; } + public int DutyId { get; set; } + public string PlaceName { get; set; } + public List PartyMembers { get; set; } = new (); + public DateTime StartTime { get; } + public DateTime EndTime { get; private set; } + public bool IsUnrestricted { get; set; } + public bool HasNpcMembers { get; set; } + public bool HasEcho { get; set; } + public string DataCenter { get; set; } + + public void EndDuty() + { + _stopwatch.Stop(); + EndTime = DateTime.UtcNow; + } + + public TimeSpan GetDuration() + { + return _stopwatch.Elapsed; + } + } +} diff --git a/Expedience.Models/DutyCompletionResult.cs b/Expedience.Models/DutyCompletionResult.cs new file mode 100644 index 0000000..4327de1 --- /dev/null +++ b/Expedience.Models/DutyCompletionResult.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Expedience.Models +{ + public class DutyCompletionResult + { + public DutyCompletionResult() + { + + } + + public DutyCompletionResult(CurrentDutyInfo currentDuty, ClientInfo clientInfo, UserInfo userInfo) + { + DutyInfo = new DutyInfo + { + DutyId = currentDuty.DutyId, + DutyName = currentDuty.PlaceName, + IsUnrestricted = currentDuty.IsUnrestricted, + IsNpcSupported = currentDuty.PartyMembers.Any(p => p.IsNpc), + HasEcho = currentDuty.HasEcho, + }; + + PlayerInfo = new PlayerInfo + { + ClassJob = currentDuty.Player.ClassJob, + Level = currentDuty.Player.Level, + }; + + GroupMembers = currentDuty.PartyMembers.Select(p => new GroupMemberInfo + { + ClassJob = p.ClassJob, + Level = p.Level, + GroupNumber = p.GroupNumber, + IsNpc = p.IsNpc, + IsPlayer = p.IsPlayer, + }).ToList(); + + ClientInfo = new ClientInfo + { + GameVersion = clientInfo.GameVersion, + GameLanguage = clientInfo.GameLanguage, + PluginVersion = clientInfo.PluginVersion, + }; + + UserInfo = new UserInfo + { + UserId = userInfo.UserId, + WorldId = userInfo.WorldId, + WorldName = userInfo.WorldName, + }; + + CompletionTimeInfo = new CompletionTimeInfo(currentDuty.GetDuration()); + DutyStartDateUtc = currentDuty.StartTime; + DutyCompletionDateUtc = currentDuty.EndTime; + DataCenter = currentDuty.DataCenter; + } + + public Guid UploadId { get; set; } + public DutyInfo DutyInfo { get; set; } + public CompletionTimeInfo CompletionTimeInfo { get; set; } + public PlayerInfo PlayerInfo { get; set; } + public List GroupMembers { get; set; } + public DateTime DutyStartDateUtc { get; set; } + public DateTime DutyCompletionDateUtc { get; set; } + public ClientInfo ClientInfo { get; set; } + public UserInfo UserInfo{ get; set; } + public DateTime UploadDateUtc { get; set; } + public string DataCenter { get; set; } + } +} diff --git a/Expedience.Models/DutyInfo.cs b/Expedience.Models/DutyInfo.cs new file mode 100644 index 0000000..8a3f39f --- /dev/null +++ b/Expedience.Models/DutyInfo.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Expedience.Models +{ + public class DutyInfo + { + public int DutyId { get; set; } + public string DutyName { get; set; } + public bool IsUnrestricted { get; set; } + public bool HasEcho { get; set; } + public bool IsNpcSupported { get; set; } + } +} diff --git a/Expedience.Models/Expedience.Models.csproj b/Expedience.Models/Expedience.Models.csproj new file mode 100644 index 0000000..cfadb03 --- /dev/null +++ b/Expedience.Models/Expedience.Models.csproj @@ -0,0 +1,9 @@ + + + + net7.0 + enable + enable + + + diff --git a/Expedience.Models/GroupMemberInfo.cs b/Expedience.Models/GroupMemberInfo.cs new file mode 100644 index 0000000..0d5140c --- /dev/null +++ b/Expedience.Models/GroupMemberInfo.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Expedience.Models +{ + public class GroupMemberInfo + { + public string ClassJob { get; set; } + public bool IsNpc { get; set; } + public int Level { get; set; } + public int GroupNumber { get; set; } + public bool IsPlayer { get; set; } + } +} diff --git a/Expedience.Models/PlayerInfo.cs b/Expedience.Models/PlayerInfo.cs new file mode 100644 index 0000000..9bef41f --- /dev/null +++ b/Expedience.Models/PlayerInfo.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Expedience.Models +{ + public class PlayerInfo + { + public string ClassJob { get; set; } + public uint Level { get; set; } + } +} \ No newline at end of file diff --git a/Expedience.Models/UserInfo.cs b/Expedience.Models/UserInfo.cs new file mode 100644 index 0000000..27b6db0 --- /dev/null +++ b/Expedience.Models/UserInfo.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Expedience.Models +{ + public class UserInfo + { + public string UserId { get; set; } + public int WorldId { get; set; } + public string WorldName { get; set; } + } +} diff --git a/Expedience.csproj b/Expedience.csproj deleted file mode 100644 index 31fe6b8..0000000 --- a/Expedience.csproj +++ /dev/null @@ -1,69 +0,0 @@ - - - - MgAl2O4 - 1.8.0.0 - Pat counter - (c) 2023 MgAl2O4 - https://github.com/MgAl2O4/ExpedienceDalamud - - - - net7.0-windows - x64 - 9.0 - true - false - false - true - true - $(appdata)\XIVLauncher\addon\Hooks\dev\ - - - - - - - - - - - - - - $(DalamudLibPath)Dalamud.dll - false - - - $(DalamudLibPath)ImGui.NET.dll - false - - - $(DalamudLibPath)ImGuiScene.dll - false - - - $(DalamudLibPath)FFXIVClientStructs.dll - false - - - $(DalamudLibPath)Lumina.dll - false - - - $(DalamudLibPath)Lumina.Excel.dll - false - - - - - - PreserveNewest - - - - - - - - diff --git a/Expedience.json b/Expedience.json deleted file mode 100644 index 81cb00a..0000000 --- a/Expedience.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Author": "ilitirit", - "Name": "Expedience", - "Punchline": "Ahahaha worthless buff", - "Description": "Records and uploads Duty Completion times", - "InternalName": "Expedience", - "ApplicableVersion": "any", - "Tags": [ "speed", "duty" ], - "CategoryTags": [ "social" ], - "DalamudApiLevel": 8 -} diff --git a/packages.lock.json b/packages.lock.json deleted file mode 100644 index 467f0f2..0000000 --- a/packages.lock.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": 1, - "dependencies": { - "net7.0-windows7.0": { - "DalamudPackager": { - "type": "Direct", - "requested": "[2.1.11, )", - "resolved": "2.1.11", - "contentHash": "9qlAWoRRTiL/geAvuwR/g6Bcbrd/bJJgVnB/RurBiyKs6srsP0bvpoo8IK+Eg8EA6jWeM6/YJWs66w4FIAzqPw==" - } - } - } -} \ No newline at end of file