qstcompanion v1.0.1

This commit is contained in:
alydev 2025-12-04 04:39:08 +10:00
parent 3e10cbbbf2
commit 44c67ab71b
79 changed files with 21148 additions and 0 deletions

View file

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace QuestionableCompanion.Models;
public class AlliedSocietyCharacterStatus
{
public required string CharacterId { get; set; }
public AlliedSocietyRotationStatus Status { get; set; }
public DateTime? LastCompletionDate { get; set; }
public List<string> ImportedQuestIds { get; set; } = new List<string>();
}

View file

@ -0,0 +1,24 @@
using System.Collections.Generic;
namespace QuestionableCompanion.Models;
public class AlliedSocietyConfiguration
{
public List<AlliedSocietyPriority> Priorities { get; set; } = new List<AlliedSocietyPriority>();
public AlliedSocietyQuestMode QuestMode { get; set; }
public void InitializeDefaults()
{
Priorities.Clear();
for (byte i = 1; i <= 20; i++)
{
Priorities.Add(new AlliedSocietyPriority
{
SocietyId = i,
Enabled = true,
Order = i - 1
});
}
}
}

View file

@ -0,0 +1,10 @@
namespace QuestionableCompanion.Models;
public class AlliedSocietyPriority
{
public required byte SocietyId { get; set; }
public bool Enabled { get; set; }
public int Order { get; set; }
}

View file

@ -0,0 +1,12 @@
namespace QuestionableCompanion.Models;
public class AlliedSocietyProgress
{
public required string CharacterId { get; set; }
public required byte SocietyId { get; set; }
public int CurrentRank { get; set; }
public bool IsMaxRank { get; set; }
}

View file

@ -0,0 +1,7 @@
namespace QuestionableCompanion.Models;
public enum AlliedSocietyQuestMode
{
OnlyThreePerSociety,
AllAvailableQuests
}

View file

@ -0,0 +1,13 @@
namespace QuestionableCompanion.Models;
public enum AlliedSocietyRotationPhase
{
Idle,
StartingRotation,
ImportingQuests,
WaitingForQuestAccept,
MonitoringQuests,
CheckingCompletion,
WaitingForCharacterSwitch,
Completed
}

View file

@ -0,0 +1,8 @@
namespace QuestionableCompanion.Models;
public enum AlliedSocietyRotationStatus
{
Ready,
InProgress,
Complete
}

View file

@ -0,0 +1,25 @@
using System;
namespace QuestionableCompanion.Models;
[Serializable]
public class CharacterProgressInfo
{
public string World { get; set; } = "Unknown";
public uint LastQuestId { get; set; }
public string LastQuestName { get; set; } = "—";
public int CompletedQuestCount { get; set; }
public DateTime LastUpdatedUtc { get; set; } = DateTime.MinValue;
public uint LastCompletedMSQId { get; set; }
public string LastCompletedMSQName { get; set; } = "—";
public int CompletedMSQCount { get; set; }
public float MSQCompletionPercentage { get; set; }
}

View file

@ -0,0 +1,23 @@
using System;
namespace QuestionableCompanion.Models;
[Serializable]
public class ExecutionState
{
public string ActiveProfile { get; set; } = string.Empty;
public string CurrentCharacter { get; set; } = string.Empty;
public uint CurrentQuestId { get; set; }
public string CurrentQuestName { get; set; } = string.Empty;
public string CurrentSequence { get; set; } = string.Empty;
public ExecutionStatus Status { get; set; }
public int Progress { get; set; }
public DateTime LastUpdate { get; set; } = DateTime.Now;
}

View file

@ -0,0 +1,11 @@
namespace QuestionableCompanion.Models;
public enum ExecutionStatus
{
Idle,
Waiting,
Queued,
Running,
Complete,
Failed
}

View file

@ -0,0 +1,30 @@
using System;
namespace QuestionableCompanion.Models;
[Serializable]
public class LogEntry
{
public DateTime Timestamp { get; set; } = DateTime.Now;
public LogLevel Level { get; set; }
public string Message { get; set; } = string.Empty;
public string FormattedTimestamp => Timestamp.ToString("HH:mm:ss");
public string FormattedMessage => $"[{FormattedTimestamp}] {GetLevelIcon()} {Message}";
private string GetLevelIcon()
{
return Level switch
{
LogLevel.Info => "→",
LogLevel.Success => "✓",
LogLevel.Warning => "⏳",
LogLevel.Error => "✗",
LogLevel.Debug => "▶",
_ => "•",
};
}
}

View file

@ -0,0 +1,10 @@
namespace QuestionableCompanion.Models;
public enum LogLevel
{
Info,
Success,
Warning,
Error,
Debug
}

View file

@ -0,0 +1,19 @@
using System;
namespace QuestionableCompanion.Models;
[Serializable]
public class QuestConfig
{
public uint QuestId { get; set; }
public string QuestName { get; set; } = string.Empty;
public TriggerType TriggerType { get; set; } = TriggerType.OnComplete;
public SequenceConfig SequenceAfterQuest { get; set; } = new SequenceConfig();
public string NextCharacter { get; set; } = "auto_next";
public string AssignedCharacter { get; set; } = string.Empty;
}

View file

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
namespace QuestionableCompanion.Models;
[Serializable]
public class QuestProfile
{
public string Name { get; set; } = "New Profile";
public List<string> Characters { get; set; } = new List<string>();
public List<QuestConfig> Quests { get; set; } = new List<QuestConfig>();
public bool IsActive { get; set; }
}

View file

@ -0,0 +1,25 @@
namespace QuestionableCompanion.Models;
public enum RotationPhase
{
Idle,
InitializingFirstCharacter,
WaitingForCharacterLogin,
ScanningQuests,
CheckingQuestCompletion,
DCTraveling,
WaitingForQuestStart,
Questing,
InCombat,
InDungeon,
HandlingSubmarines,
SyncingCharacterData,
WaitingForChauffeur,
TravellingWithChauffeur,
QuestActive,
WaitingForNextCharacterSwitch,
WaitingBeforeCharacterSwitch,
WaitingForHomeworldReturn,
Completed,
Error
}

View file

@ -0,0 +1,249 @@
using System;
using System.Collections.Generic;
namespace QuestionableCompanion.Models;
public class RotationState
{
private readonly object _lock = new object();
private uint _currentStopQuestId;
private List<string> _selectedCharacters = new List<string>();
private string _currentCharacter = "";
private string _nextCharacter = "";
private List<string> _completedCharacters = new List<string>();
private List<string> _remainingCharacters = new List<string>();
private RotationPhase _phase;
private DateTime _phaseStartTime = DateTime.Now;
private string _errorMessage = "";
private DateTime? _rotationStartTime;
private bool _hasQuestBeenAccepted;
private uint? _lastKnownQuestState;
public uint CurrentStopQuestId
{
get
{
lock (_lock)
{
return _currentStopQuestId;
}
}
set
{
lock (_lock)
{
_currentStopQuestId = value;
}
}
}
public List<string> SelectedCharacters
{
get
{
lock (_lock)
{
return new List<string>(_selectedCharacters);
}
}
set
{
lock (_lock)
{
_selectedCharacters = new List<string>(value);
}
}
}
public string CurrentCharacter
{
get
{
lock (_lock)
{
return _currentCharacter;
}
}
set
{
lock (_lock)
{
_currentCharacter = value;
}
}
}
public string NextCharacter
{
get
{
lock (_lock)
{
return _nextCharacter;
}
}
set
{
lock (_lock)
{
_nextCharacter = value;
}
}
}
public List<string> CompletedCharacters
{
get
{
lock (_lock)
{
return new List<string>(_completedCharacters);
}
}
set
{
lock (_lock)
{
_completedCharacters = new List<string>(value);
}
}
}
public List<string> RemainingCharacters
{
get
{
lock (_lock)
{
return new List<string>(_remainingCharacters);
}
}
set
{
lock (_lock)
{
_remainingCharacters = new List<string>(value);
}
}
}
public RotationPhase Phase
{
get
{
lock (_lock)
{
return _phase;
}
}
set
{
lock (_lock)
{
_phase = value;
}
}
}
public DateTime PhaseStartTime
{
get
{
lock (_lock)
{
return _phaseStartTime;
}
}
set
{
lock (_lock)
{
_phaseStartTime = value;
}
}
}
public string ErrorMessage
{
get
{
lock (_lock)
{
return _errorMessage;
}
}
set
{
lock (_lock)
{
_errorMessage = value;
}
}
}
public DateTime? RotationStartTime
{
get
{
lock (_lock)
{
return _rotationStartTime;
}
}
set
{
lock (_lock)
{
_rotationStartTime = value;
}
}
}
public bool HasQuestBeenAccepted
{
get
{
lock (_lock)
{
return _hasQuestBeenAccepted;
}
}
set
{
lock (_lock)
{
_hasQuestBeenAccepted = value;
}
}
}
public uint? LastKnownQuestState
{
get
{
lock (_lock)
{
return _lastKnownQuestState;
}
}
set
{
lock (_lock)
{
_lastKnownQuestState = value;
}
}
}
}

View file

@ -0,0 +1,13 @@
using System;
namespace QuestionableCompanion.Models;
[Serializable]
public class SequenceConfig
{
public SequenceType Type { get; set; }
public string Value { get; set; } = string.Empty;
public bool WaitForCompletion { get; set; } = true;
}

View file

@ -0,0 +1,7 @@
namespace QuestionableCompanion.Models;
public enum SequenceType
{
QuestionableProfile,
InternalAction
}

View file

@ -0,0 +1,30 @@
using System;
using System.Text.Json.Serialization;
namespace QuestionableCompanion.Models;
[Serializable]
public class StopPoint
{
public uint QuestId { get; set; }
[JsonInclude]
[JsonPropertyName("Sequence")]
public byte? Sequence { get; set; }
public bool IsActive { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.Now;
public string DisplayName
{
get
{
if (Sequence.HasValue)
{
return $"Quest {QuestId} (Seq {Sequence.Value})";
}
return $"Quest {QuestId}";
}
}
}

View file

@ -0,0 +1,7 @@
namespace QuestionableCompanion.Models;
public enum TriggerType
{
OnAccept,
OnComplete
}