mirror of
https://github.com/BubbaGumpShrump/AutoTrackR2.git
synced 2025-06-19 21:19:07 +00:00
Error Fix - GameMode and GameVersion tracking
This commit is contained in:
parent
2a7a4ef692
commit
7592b1729c
3 changed files with 22 additions and 21 deletions
|
@ -1,4 +1,4 @@
|
||||||
$TrackRver = "2.0"
|
$TrackRver = "2.0r"
|
||||||
|
|
||||||
# Path to the config file
|
# Path to the config file
|
||||||
$appName = "AutoTrackR2"
|
$appName = "AutoTrackR2"
|
||||||
|
@ -100,11 +100,12 @@ $ueePattern = '<p class="entry citizen-record">\s*<span class="label">UEE Citize
|
||||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||||
$process = Get-Process | Where-Object {$_.Name -like "AutoTrackR2"}
|
$process = Get-Process | Where-Object {$_.Name -like "AutoTrackR2"}
|
||||||
$global:killTally = 0
|
$global:killTally = 0
|
||||||
|
$global:GameMode = ""
|
||||||
|
$global:GameVersion = ""
|
||||||
|
|
||||||
# Load historic kills from csv
|
# Load historic kills from csv
|
||||||
if (Test-Path "$scriptFolder\Kill-Log.csv") {
|
if (Test-Path "$scriptFolder\Kill-Log.csv") {
|
||||||
$historicKills = Import-CSV "$scriptFolder\Kill-log.csv" | Sort-Object -Property KillTime
|
$historicKills = Import-CSV "$scriptFolder\Kill-log.csv"
|
||||||
foreach ($kill in $historicKills) {
|
foreach ($kill in $historicKills) {
|
||||||
Write-Output "NewKill=throwaway,$($kill.EnemyPilot),$($kill.EnemyShip),$($kill.OrgAffiliation),$($kill.Enlisted),$($kill.RecordNumber),$($kill.KillTime),$($kill.PFP)"
|
Write-Output "NewKill=throwaway,$($kill.EnemyPilot),$($kill.EnemyShip),$($kill.OrgAffiliation),$($kill.Enlisted),$($kill.RecordNumber),$($kill.KillTime),$($kill.PFP)"
|
||||||
$global:killTally++
|
$global:killTally++
|
||||||
|
@ -144,15 +145,15 @@ Do {
|
||||||
Write-Output "PlayerShip=$global:loadOut"
|
Write-Output "PlayerShip=$global:loadOut"
|
||||||
|
|
||||||
If ($line -match $versionPattern){
|
If ($line -match $versionPattern){
|
||||||
$GameVersion = $matches['gameversion']
|
$global:GameVersion = $matches['gameversion']
|
||||||
}
|
}
|
||||||
if ($line -match $acPattern){
|
if ($line -match $acPattern){
|
||||||
$GameMode = "AC"
|
$global:GameMode = "AC"
|
||||||
}
|
}
|
||||||
if ($line -match $puPattern){
|
if ($line -match $puPattern){
|
||||||
$GameMode = "PU"
|
$global:GameMode = "PU"
|
||||||
}
|
}
|
||||||
Write-Output "GameMode=$GameMode"
|
Write-Output "GameMode=$global:GameMode"
|
||||||
|
|
||||||
}
|
}
|
||||||
# If no match found, print "Logged In: False"
|
# If no match found, print "Logged In: False"
|
||||||
|
@ -237,7 +238,7 @@ function Read-LogEntry {
|
||||||
$ship = $ship -replace '-00(1|2|3|4|5|6|7|8|9|0)$', ''
|
$ship = $ship -replace '-00(1|2|3|4|5|6|7|8|9|0)$', ''
|
||||||
}
|
}
|
||||||
|
|
||||||
$KillTime = (Get-Date).ToUniversalTime().ToString("d MMM yyyy H:mm 'UTC'")
|
$KillTime = (Get-Date).ToUniversalTime().ToString("dd MMM yyyy HH:mm 'UTC'")
|
||||||
|
|
||||||
# Get Enlisted Date
|
# Get Enlisted Date
|
||||||
if ($($page1.content) -match $joinDatePattern) {
|
if ($($page1.content) -match $joinDatePattern) {
|
||||||
|
@ -279,7 +280,7 @@ function Read-LogEntry {
|
||||||
Write-Output "KillTally=$global:killTally"
|
Write-Output "KillTally=$global:killTally"
|
||||||
Write-Output "NewKill=throwaway,$enemyPilot,$enemyShip,$enemyOrgs,$joinDate2,$citizenRecord,$killTime,$victimPFP"
|
Write-Output "NewKill=throwaway,$enemyPilot,$enemyShip,$enemyOrgs,$joinDate2,$citizenRecord,$killTime,$victimPFP"
|
||||||
|
|
||||||
$GameMode = $GameMode.ToLower()
|
$global:GameMode = $global:GameMode.ToLower()
|
||||||
# Send to API
|
# Send to API
|
||||||
# Define the data to send
|
# Define the data to send
|
||||||
If ($null -ne $apiUrl -and $offlineMode -eq $false){
|
If ($null -ne $apiUrl -and $offlineMode -eq $false){
|
||||||
|
@ -291,8 +292,8 @@ function Read-LogEntry {
|
||||||
weapon = $weapon
|
weapon = $weapon
|
||||||
method = $damageType
|
method = $damageType
|
||||||
loadout_ship = $ship
|
loadout_ship = $ship
|
||||||
game_version = $GameVersion
|
game_version = $global:GameVersion
|
||||||
gamemode = $GameMode
|
gamemode = $global:GameMode
|
||||||
trackr_version = $TrackRver
|
trackr_version = $TrackRver
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -332,8 +333,8 @@ function Read-LogEntry {
|
||||||
Weapon = $weapon
|
Weapon = $weapon
|
||||||
Ship = $ship
|
Ship = $ship
|
||||||
Method = $damageType
|
Method = $damageType
|
||||||
Mode = $GameMode
|
Mode = $global:GameMode
|
||||||
GameVersion = $GameVersion
|
GameVersion = $global:GameVersion
|
||||||
TrackRver = $TrackRver
|
TrackRver = $TrackRver
|
||||||
Logged = $logMode
|
Logged = $logMode
|
||||||
PFP = $victimPFP
|
PFP = $victimPFP
|
||||||
|
@ -405,12 +406,12 @@ function Read-LogEntry {
|
||||||
|
|
||||||
# Detect PU or AC
|
# Detect PU or AC
|
||||||
if ($line -match $puPattern) {
|
if ($line -match $puPattern) {
|
||||||
$GameMode = "PU"
|
$global:GameMode = "PU"
|
||||||
Write-Output "GameMode=$GameMode"
|
Write-Output "GameMode=$global:GameMode"
|
||||||
}
|
}
|
||||||
if ($line -match $acPattern) {
|
if ($line -match $acPattern) {
|
||||||
$GameMode = "AC"
|
$global:GameMode = "AC"
|
||||||
Write-Output "GameMode=$GameMode"
|
Write-Output "GameMode=$global:GameMode"
|
||||||
}
|
}
|
||||||
|
|
||||||
#Set loadout
|
#Set loadout
|
||||||
|
|
|
@ -9,7 +9,7 @@ namespace AutoTrackR2
|
||||||
{
|
{
|
||||||
public partial class UpdatePage : UserControl
|
public partial class UpdatePage : UserControl
|
||||||
{
|
{
|
||||||
private string currentVersion = "v2.0-beta.3";
|
private string currentVersion = "v2.0-release";
|
||||||
private string latestVersion;
|
private string latestVersion;
|
||||||
|
|
||||||
public UpdatePage()
|
public UpdatePage()
|
||||||
|
|
|
@ -198,15 +198,15 @@
|
||||||
{
|
{
|
||||||
"Name" = "8:Microsoft Visual Studio"
|
"Name" = "8:Microsoft Visual Studio"
|
||||||
"ProductName" = "8:AutoTrackR2_Setup"
|
"ProductName" = "8:AutoTrackR2_Setup"
|
||||||
"ProductCode" = "8:{C1E9844A-80C7-4576-8F4C-12503B1F3036}"
|
"ProductCode" = "8:{288819A9-947F-47BE-900E-205C7D7EAAF7}"
|
||||||
"PackageCode" = "8:{F0B55802-525C-4754-8265-85508C09D73E}"
|
"PackageCode" = "8:{94C078B7-DD3E-4091-9F5E-780DE3481E1C}"
|
||||||
"UpgradeCode" = "8:{0B78A147-D0DE-4F72-8906-A62611787CA7}"
|
"UpgradeCode" = "8:{0B78A147-D0DE-4F72-8906-A62611787CA7}"
|
||||||
"AspNetVersion" = "8:"
|
"AspNetVersion" = "8:"
|
||||||
"RestartWWWService" = "11:FALSE"
|
"RestartWWWService" = "11:FALSE"
|
||||||
"RemovePreviousVersions" = "11:TRUE"
|
"RemovePreviousVersions" = "11:TRUE"
|
||||||
"DetectNewerInstalledVersion" = "11:FALSE"
|
"DetectNewerInstalledVersion" = "11:FALSE"
|
||||||
"InstallAllUsers" = "11:FALSE"
|
"InstallAllUsers" = "11:FALSE"
|
||||||
"ProductVersion" = "8:2.0.13"
|
"ProductVersion" = "8:2.0.2"
|
||||||
"Manufacturer" = "8:GrieferNET"
|
"Manufacturer" = "8:GrieferNET"
|
||||||
"ARPHELPTELEPHONE" = "8:"
|
"ARPHELPTELEPHONE" = "8:"
|
||||||
"ARPHELPLINK" = "8:discord.gg/griefernet"
|
"ARPHELPLINK" = "8:discord.gg/griefernet"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue