Minor quest/stat updates
This commit is contained in:
parent
b0c8aee855
commit
b757d93780
@ -150,6 +150,7 @@ internal sealed class InfluxStatisticsClient : IDisposable
|
|||||||
values.Add(PointData.Measurement("currency")
|
values.Add(PointData.Measurement("currency")
|
||||||
.Tag("id", character.CharacterId.ToString())
|
.Tag("id", character.CharacterId.ToString())
|
||||||
.Tag("player_name", owner.Name)
|
.Tag("player_name", owner.Name)
|
||||||
|
.Tag("player_id", character.OwnerId.ToString())
|
||||||
.Tag("type", character.CharacterType.ToString())
|
.Tag("type", character.CharacterType.ToString())
|
||||||
.Tag("retainer_name", character.Name)
|
.Tag("retainer_name", character.Name)
|
||||||
.Field("gil", currencies.Gil)
|
.Field("gil", currencies.Gil)
|
||||||
@ -162,6 +163,7 @@ internal sealed class InfluxStatisticsClient : IDisposable
|
|||||||
values.Add(PointData.Measurement("retainer")
|
values.Add(PointData.Measurement("retainer")
|
||||||
.Tag("id", character.CharacterId.ToString())
|
.Tag("id", character.CharacterId.ToString())
|
||||||
.Tag("player_name", owner.Name)
|
.Tag("player_name", owner.Name)
|
||||||
|
.Tag("player_id", character.OwnerId.ToString())
|
||||||
.Tag("type", character.CharacterType.ToString())
|
.Tag("type", character.CharacterType.ToString())
|
||||||
.Tag("retainer_name", character.Name)
|
.Tag("retainer_name", character.Name)
|
||||||
.Tag("class", _classJobNames[character.ClassJob])
|
.Tag("class", _classJobNames[character.ClassJob])
|
||||||
|
@ -56,7 +56,8 @@ internal sealed class LocalStatsCalculator : IDisposable
|
|||||||
|
|
||||||
_clientState.Login += UpdateStatistics;
|
_clientState.Login += UpdateStatistics;
|
||||||
_clientState.TerritoryChanged += UpdateStatistics;
|
_clientState.TerritoryChanged += UpdateStatistics;
|
||||||
_addonLifecycle.RegisterListener(AddonEvent.PreFinalize, "SelectYesno", UpdateStatistics);
|
_addonLifecycle.RegisterListener(AddonEvent.PostSetup, "SelectYesno", UpdateStatisticsLogout);
|
||||||
|
_addonLifecycle.RegisterListener(AddonEvent.PreSetup, "JournalAccept", UpdateStatistics);
|
||||||
|
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
@ -64,6 +65,9 @@ internal sealed class LocalStatsCalculator : IDisposable
|
|||||||
foreach (var quest in dataManager.GetExcelSheet<Quest>()!.Where(x => x.JournalGenre.Row is >= 1 and <= 12))
|
foreach (var quest in dataManager.GetExcelSheet<Quest>()!.Where(x => x.JournalGenre.Row is >= 1 and <= 12))
|
||||||
{
|
{
|
||||||
var previousQuests = quest.PreviousQuest?.Select(x => x.Row).Where(x => x != 0).ToList();
|
var previousQuests = quest.PreviousQuest?.Select(x => x.Row).Where(x => x != 0).ToList();
|
||||||
|
if (previousQuests != null && quest.Unknown12 != 0)
|
||||||
|
previousQuests.Add(quest.Unknown12);
|
||||||
|
|
||||||
msq.Add(new QuestInfo
|
msq.Add(new QuestInfo
|
||||||
{
|
{
|
||||||
RowId = quest.RowId,
|
RowId = quest.RowId,
|
||||||
@ -148,21 +152,24 @@ internal sealed class LocalStatsCalculator : IDisposable
|
|||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
_addonLifecycle.UnregisterListener(AddonEvent.PreFinalize, "SelectYesno", UpdateStatistics);
|
_addonLifecycle.UnregisterListener(AddonEvent.PreSetup, "JournalAccept", UpdateStatistics);
|
||||||
|
_addonLifecycle.UnregisterListener(AddonEvent.PostSetup, "SelectYesno", UpdateStatisticsLogout);
|
||||||
_clientState.Login -= UpdateStatistics;
|
_clientState.Login -= UpdateStatistics;
|
||||||
_clientState.TerritoryChanged -= UpdateStatistics;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateStatistics(ushort territoryType) => UpdateStatistics();
|
private void UpdateStatistics(ushort territoryType) => UpdateStatistics();
|
||||||
|
|
||||||
private unsafe void UpdateStatistics(AddonEvent type, AddonArgs args)
|
private unsafe void UpdateStatisticsLogout(AddonEvent type, AddonArgs args)
|
||||||
{
|
{
|
||||||
AddonSelectYesno* addonSelectYesNo = (AddonSelectYesno*)args.Addon;
|
AddonSelectYesno* addonSelectYesNo = (AddonSelectYesno*)args.Addon;
|
||||||
string text = MemoryHelper.ReadSeString(&addonSelectYesNo->PromptText->NodeText).ToString().Replace("\n", "").Replace("\r", "");
|
string? text = MemoryHelper.ReadSeString(&addonSelectYesNo->PromptText->NodeText)?.ToString();
|
||||||
|
text = text?.Replace("\n", "").Replace("\r", "");
|
||||||
if (text == _gameStrings.LogoutToTitleScreen || text == _gameStrings.LogoutAndExitGame)
|
if (text == _gameStrings.LogoutToTitleScreen || text == _gameStrings.LogoutAndExitGame)
|
||||||
UpdateStatistics();
|
UpdateStatistics();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UpdateStatistics(AddonEvent type, AddonArgs args) => UpdateStatistics();
|
||||||
|
|
||||||
private unsafe void UpdateStatistics()
|
private unsafe void UpdateStatistics()
|
||||||
{
|
{
|
||||||
var localContentId = _clientState.LocalContentId;
|
var localContentId = _clientState.LocalContentId;
|
||||||
|
Loading…
Reference in New Issue
Block a user