Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Features #50

Merged
merged 21 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ Once downloaded, extract the zip and run the `TarkovMonitor.exe` executable incl

### How does TarkovMonitor work?

TarkovMonitor simply watches the log files that the game creates as it's running for certain events.
TarkovMonitor simply watches the log files that the game creates as it's running. Certain log messages correspond with particular events, so it's possible to automatically read some game events from these log files.

### I've installed and run TarkovMonitor, why hasn't it marked all my completed quests as complete?

TarkovMonitor only monitors new logs as they are being written while the app is running. Therefore, it doesn't automatically update quest progress that was made prior to the app running. It will, however, still mark quests as complete going forward while the app is running.

If you want to automatically update your progress from previous logs, open the Settings page, scroll down to the First Time Setup section, and click the Read Past Logs button. Tarkov Monitor will then present you with a list of breakpoints to choose the starting point to read logs from. The breakpoints are determined by the game's version number and your player profile id as written into each set of logs. Select the breakpoint corresponding with the start of the wipe for the corret account, click OK, and Tarkov Monitor will process all logs from that point forward for the selected profile and update your quest progress accordingly.

### Is TarkovMonitor a cheat?

We don't have any official word from BSG, but it would be silly for TarkovMonitor to be considerd a cheat. It doesn't do anything while players are in-raid because the logs aren't updated while a raid is in-progress. Moreover, the application is simply reading the logs that are written to your computer.
Expand Down
21 changes: 21 additions & 0 deletions TarkovMonitor/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,27 @@
<setting name="autoNavigateMap" serializeAs="String">
<value>False</value>
</setting>
<setting name="airFilterAlert" serializeAs="String">
<value>False</value>
</setting>
<setting name="stayOnTop" serializeAs="String">
<value>False</value>
</setting>
<setting name="runthroughAlert" serializeAs="String">
<value>False</value>
</setting>
<setting name="navigateMapOnPositionUpdate" serializeAs="String">
<value>False</value>
</setting>
<setting name="scavCooldownAlert" serializeAs="String">
<value>False</value>
</setting>
<setting name="scavKarma" serializeAs="String">
<value>0</value>
</setting>
<setting name="notificationsDevice" serializeAs="String">
<value>-1</value>
</setting>
</TarkovMonitor.Properties.Settings>
</userSettings>
</configuration>
5 changes: 3 additions & 2 deletions TarkovMonitor/Blazor/AppLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
<MudNavLink Href="/" Match="NavLinkMatch.All" Icon="@Icons.Filled.Message">Messages</MudNavLink>
<MudNavLink Href="/group" Match="NavLinkMatch.All" Icon="@Icons.Filled.Group">Group</MudNavLink>
<MudNavLink Href="/settings" Match="NavLinkMatch.All" Icon="@Icons.Filled.Settings">Settings</MudNavLink>
<MudNavLink Href="/raw" Match="NavLinkMatch.All" Icon="@Icons.Filled.RawOn">Raw Logs</MudNavLink>
<MudNavLink Href="/sounds" Match="NavLinkMatch.All" Icon="@Icons.Filled.Speaker">Sounds</MudNavLink>
<MudNavLink Href="/stats" Match="NavLinkMatch.All" Icon="@Icons.Filled.BarChart">Stats</MudNavLink>
<MudNavLink Href="/raw" Match="NavLinkMatch.All" Icon="@Icons.Filled.RawOn">Raw Logs</MudNavLink>
</MudNavMenu>
</MudDrawer>
<MudMainContent Class="mt-2">
Expand All @@ -48,5 +50,4 @@
{
drawerOpen = !drawerOpen;
}

}
39 changes: 36 additions & 3 deletions TarkovMonitor/Blazor/Components/LoadoutRecursor.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<MudImage Src="@itemIconURL" Width="@imgWidth" Height="@imgHeight" Class="ma-2"/>

<MudItem Class="d-flex align-center flex-grow-1 gap-4" Elevation="0">
<MudLink Href="@itemLink"><MudImage Src="@itemImageURL" Width="@imgWidth" Height="@imgHeight" Class="ma-2" title="@itemName" /></MudLink>
@if (subItems.Length > 0)
{
<MudButton OnClick="OnExpandCollapseClick"><MudIcon Icon="@(_expanded ? Icons.Material.Filled.IndeterminateCheckBox : Icons.Material.Filled.AddBox)" Title="Tarkov.dev" Color="Color.Info" /></MudButton>
<MudCollapse Expanded="_expanded">
@foreach (LoadoutItem item in subItems)
{

<LoadoutRecursor Loadout="@Loadout" Item="item" />
}
</MudCollapse>
}
</MudItem>

@code {
[Parameter]
Expand All @@ -7,9 +21,28 @@
[Parameter]
public LoadoutItem Item { get; set; }

private LoadoutItem[] subItems { get; set; } = { };
private bool subItemsInitailized = false;

bool _expanded = false;

private TarkovDev.Item? devItem => TarkovDev.Items.Where(i => i.id == Item._tpl).FirstOrDefault();

private int imgWidth => devItem != null ? (devItem.width * 31) + 1 : 96;
private int imgHeight => devItem != null ? (devItem.height * 31) * 1 : 96;
private string itemIconURL => devItem?.gridImageLink;
private int imgHeight => devItem != null ? (devItem.height * 31) + 1 : 96;
private string itemImageURL => devItem?.gridImageLink;
private string itemLink => devItem?.link;
private string itemName => devItem?.name;

protected override void OnInitialized()
{
base.OnInitialized();
subItems = Loadout.Where(i => i.parentId == Item._id && TarkovDev.Items.Where(it => it.id == i._tpl).FirstOrDefault() != null).ToArray();
subItemsInitailized = true;
}

private void OnExpandCollapseClick()
{
_expanded = !_expanded;
}
}
8 changes: 4 additions & 4 deletions TarkovMonitor/Blazor/Pages/Group/Group.razor
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<MudAlert Severity="Severity.Info">You aren't in a group or have party members yet.</MudAlert>
}else{
<MudTabs Elevation="3" Rounded="true" Centered="true" PanelClass="pa-3">
@foreach(KeyValuePair<string, GroupMember> member in groupManager.GroupMembers)
@foreach (KeyValuePair<string, GroupMember> member in groupManager.GroupMembers)
{
<MudTabPanel Text="@member.Key" Icon="@Icons.Material.Filled.Person">
<div class="d-flex justify-space-between align-center">
Expand All @@ -22,10 +22,10 @@
<div><MudText Typo="Typo.h4">@member.Value.Loadout.Info.Side.ToUpper()</MudText></div>
</div>
<div>
@foreach(LoadoutItem item in parentItems(member.Value.Loadout.Equipment.Items))
@foreach (LoadoutItem item in parentItems(member.Value.Loadout.Equipment.Items))
{
<LoadoutRecursor Loadout="@member.Value.Loadout.Equipment.Items" Item="item" />

<LoadoutRecursor Loadout="@member.Value.Loadout.Equipment.Items" Item="item" />
}
</div>
</MudTabPanel>
Expand Down
89 changes: 77 additions & 12 deletions TarkovMonitor/Blazor/Pages/RawLogs/ForceReadDialog.razor
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
@using Humanizer
@inject GameWatcher eft

<MudDialog>
<DialogContent>
@if (eft.LogsPath != "")
{
<MudSelect @bind-Value="selectedPath" Label="Open existing logs" HelperText="Choose which set of logs should be read from" OpenIcon="@Icons.Material.Filled.TextSnippet" AdornmentColor="Color.Secondary">
@foreach (DateTime folderDate in logFolders.Keys)
<MudSelect @bind-Value="selectedBreakpoint" Label="Read previous logs" HelperText="Choose the starting point from which to read logs" OpenIcon="@Icons.Material.Filled.TextSnippet" AdornmentColor="Color.Secondary">
@foreach (LogDetails breakpoint in breakpoints)
{
<MudSelectItem Value="@logFolders[folderDate]">@folderDate.ToLongDateString() - @folderDate.Humanize()</MudSelectItem>
<MudSelectItem Value="@breakpoint">(@breakpoint.Date.ToLongDateString() - @breakpoint.Date.Humanize()) | @breakpoint.Version | Profile: @breakpoint.ProfileId</MudSelectItem>
}
</MudSelect>
<p>Select a starting point to read previous logs and update your quest progress. All logs from that point forward with the same profile ID will be read and that cumulative progress will be synced to Tarkov Tracker.</p>
<p><strong>WARNING: </strong>You can mess up your Tarkov Tracker saved quest progress if you pick an invalid starting date, so proceed with caution.</p>
}
else
{
<span>Could not find the Escape From Tarkov process to locate log folders, or no logs exist.</span>
<span>Could not find the Escape From Tarkov installation location, or no logs exist.</span>
}
@if (ErrorText != "") {
<MudText>@ErrorText</MudText>
}
</DialogContent>
<DialogActions>
Expand All @@ -25,25 +29,86 @@
@code {
[CascadingParameter] MudDialogInstance MudDialog { get; set; }

internal GameWatcher eft = new();

protected override void OnInitialized()
{
base.OnInitialized();
logFolders = eft.GetLogFolders();
breakpoints = eft.GetLogBreakpoints();
}

string selectedPath = "";
LogDetails selectedBreakpoint;

Dictionary<DateTime, string> logFolders = new Dictionary<DateTime, string>();
List<LogDetails> breakpoints = new();
Dictionary<string, TarkovMonitor.TaskStatus> TaskStatuses = new();
string ErrorText = "";

void Cancel() => MudDialog.Cancel();

public void Submit()
public async void Submit()
{
// Check if a path was selected, and if so, load the logs from that path
if (selectedPath != "")
if (selectedBreakpoint != null)
{
eft.ProcessLogs(selectedPath);
TaskStatuses.Clear();
//eft.ProcessLogs(selectedPath);
eft.TaskModified += UpdateTaskStatus;
eft.ProcessLogsFromBreakpoint(selectedBreakpoint);
eft.TaskModified -= UpdateTaskStatus;
Dictionary<string, TarkovMonitor.TaskStatus> updateTasks = new();
foreach (var kvp in TaskStatuses)
{
if (kvp.Value == TarkovMonitor.TaskStatus.Started)
{
// don't update task status if started
continue;
}
var task = TarkovDev.Tasks.Find((t) => t.id == kvp.Key);
if (task == null)
{
// probably a daily
continue;
}
TarkovMonitor.TaskStatus savedTaskStatus = TarkovMonitor.TaskStatus.None;
var taskProgress = TarkovTracker.Progress.data.tasksProgress.Find((prog) => prog.id == kvp.Key);
if (taskProgress != null)
{
if (taskProgress.failed)
{
savedTaskStatus = TarkovMonitor.TaskStatus.Failed;
}
if (taskProgress.complete)
{
savedTaskStatus = TarkovMonitor.TaskStatus.Finished;
}
}
if (kvp.Value == savedTaskStatus)
{
// status matches, so don't update
continue;
}
updateTasks.Add(kvp.Key, kvp.Value);
System.Diagnostics.Debug.WriteLine($"Task {kvp.Key} should be {kvp.Value}");
}
try
{
if (updateTasks.Count > 0)
{
await TarkovTracker.SetTaskStatuses(updateTasks);
}
ErrorText = "";
MudDialog.Close(DialogResult.Ok(true));
}
catch (Exception ex)
{
ErrorText = ex.Message + ex.StackTrace;
}

}
MudDialog.Close(DialogResult.Ok(true));
}

private void UpdateTaskStatus(object sender, TaskStatusMessageEventArgs e)
{
TaskStatuses[e.TaskId] = e.Status;
}
}
58 changes: 41 additions & 17 deletions TarkovMonitor/Blazor/Pages/RawLogs/RawLogs.razor
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,34 @@
<MudItem xs="12">
<LogBoard>
</LogBoard>
</MudItem>
<div class="ma-2" style="position:fixed; bottom: 0px; right: 0px;">
<MudMenu AnchorOrigin="Origin.TopLeft" TransformOrigin="Origin.BottomRight">
<ActivatorContent>
<MudFab Color="Color.Secondary" StartIcon="@Icons.Material.Filled.Add" Size="Size.Small" />
</ActivatorContent>
<ChildContent>
<MudMenuItem @onclick="OpenCustomDialog">Custom Log Data</MudMenuItem>
<MudMenuItem @onclick="OpenForceReadDialog">Force Read Logs</MudMenuItem>
</ChildContent>
</MudMenu>
</div>
</MudItem>
@if (DebugMode() || LogsFolderSet())
{
<div class="ma-2" style="position:fixed; bottom: 0px; right: 0px;">
<MudMenu AnchorOrigin="Origin.TopLeft" TransformOrigin="Origin.BottomRight">
<ActivatorContent>
<MudFab Color="Color.Secondary" StartIcon="@Icons.Material.Filled.Add" Size="Size.Small" />
</ActivatorContent>
<ChildContent>
@if(DebugMode())
{
<MudMenuItem @onclick="OpenCustomDialog">Custom Log Data</MudMenuItem>
<MudMenuItem @onclick="OpenForceReadDialog">Read Previous Logs</MudMenuItem>
}
@if(LogsFolderSet())
{
<MudMenuItem @onclick="OpenLogsFolder">Open Logs Folder</MudMenuItem>
}
</ChildContent>
</MudMenu>
</div>
}
</MudGrid>

@code {
[CascadingParameter(Name="AppLayout")]
public AppLayout AppLayout { get; set; }

//private int messageCount = 0;

private void OpenCustomDialog()
Expand All @@ -39,7 +49,12 @@
private void OpenForceReadDialog()
{
var options = new DialogOptions { CloseOnEscapeKey = true, MaxWidth = MaxWidth.ExtraLarge, FullWidth = true };
DialogService.Show<ForceReadDialog>("Force Read Log Files", options);
DialogService.Show<ForceReadDialog>("Read Past Log Files", options);
}

private void OpenLogsFolder()
{
Process.Start("explorer.exe", eft.CurrentLogsFolder);
}

protected override void OnInitialized()
Expand All @@ -61,8 +76,17 @@
}
}

public void Dispose()
{
}
public void Dispose()
{
}

private bool DebugMode()
{
return Debugger.IsAttached;
}

private bool LogsFolderSet()
{
return eft.CurrentLogsFolder != "";
}
}
Loading
Loading