Some bugfixes

‘unknown’ deathmetode exception.
OtherLogSlider moved.
Wrong Ship output while death event.
This commit is contained in:
Koda-Dog 2025-01-18 14:37:49 +01:00
parent db66bc0a89
commit a279fdac4f
3 changed files with 19 additions and 9 deletions

View file

@ -75,7 +75,7 @@
<TextBlock Text="Offline Mode:" Foreground="{DynamicResource TextBrush}" FontSize="16" Margin="0,7,0,5"/> <TextBlock Text="Offline Mode:" Foreground="{DynamicResource TextBrush}" FontSize="16" Margin="0,7,0,5"/>
<Slider Name="OfflineModeSlider" Minimum="0" Maximum="1" TickFrequency="1" IsSnapToTickEnabled="True" Value="0" Style="{StaticResource ToggleSliderStyle}" Margin="12,-4,0,0" ValueChanged="OfflineModeSlider_ValueChanged"/> <Slider Name="OfflineModeSlider" Minimum="0" Maximum="1" TickFrequency="1" IsSnapToTickEnabled="True" Value="0" Style="{StaticResource ToggleSliderStyle}" Margin="12,-4,0,0" ValueChanged="OfflineModeSlider_ValueChanged"/>
<TextBlock Text="OtherLog:" Foreground="{DynamicResource TextBrush}" FontSize="16" Margin="0,7,0,5"/> <TextBlock Text="OtherLog:" Foreground="{DynamicResource TextBrush}" FontSize="16" Margin="0,7,0,5"/>
<Slider Name="OtherLogSlider" Minimum="0" Maximum="1" TickFrequency="1" IsSnapToTickEnabled="True" Value="0" Style="{StaticResource ToggleSliderStyle}" Margin="10,-4,0,0" ValueChanged="OfflineModeSlider_ValueChanged"/> <Slider Name="OtherLogSlider" Minimum="0" Maximum="1" TickFrequency="1" IsSnapToTickEnabled="True" Value="0" Style="{StaticResource ToggleSliderStyle}" Margin="22,-4,0,0" ValueChanged="OfflineModeSlider_ValueChanged"/>
</StackPanel> </StackPanel>
<!-- 3-Position Toggle Slider --> <!-- 3-Position Toggle Slider -->

View file

@ -1,4 +1,4 @@
$TrackRver = "2.06-mod" $TrackRver = "2.06-koda-mod"
# Path to the config file # Path to the config file
$appName = "AutoTrackR2" $appName = "AutoTrackR2"
@ -312,6 +312,7 @@ function Read-LogEntry {
} }
#Define the Type #Define the Type
#kill
IF ($agressorPilot -eq $global:userName -and $victimPilot -ne $global:userName){ IF ($agressorPilot -eq $global:userName -and $victimPilot -ne $global:userName){
$type = "Kill" $type = "Kill"
Try { Try {
@ -320,15 +321,23 @@ function Read-LogEntry {
$page1 = $null $page1 = $null
$type = "none" $type = "none"
} }
#death
}elseif ($agressorPilot -ne $global:userName -and $victimPilot -eq $global:userName) { }elseif ($agressorPilot -ne $global:userName -and $victimPilot -eq $global:userName) {
$type = "Death" #acception for "unknown"
$victimShip = "unknown" if ($agressorPilot -eq "unknown" -and $weapon -eq "unknown"){
#$damageType = "snusnu"
$type = "Other"
} else {
$type = "Death"
}
$agressorShip = "unknown"
Try { Try {
$page1 = Invoke-WebRequest -uri "https://robertsspaceindustries.com/citizens/$agressorPilot" $page1 = Invoke-WebRequest -uri "https://robertsspaceindustries.com/citizens/$agressorPilot"
} Catch { } Catch {
$page1 = $null $page1 = $null
$type = "none" $type = "none"
} }
#other
}elseif($agressorPilot -eq $global:userName -or $victimPilot -eq $global:userName) { }elseif($agressorPilot -eq $global:userName -or $victimPilot -eq $global:userName) {
$type = "Other" $type = "Other"
}else { }else {
@ -364,6 +373,7 @@ function Read-LogEntry {
if ($damageType -eq "Bullet" -or $weapon -like "apar_special_ballistic*") { if ($damageType -eq "Bullet" -or $weapon -like "apar_special_ballistic*") {
$ship = "Person" $ship = "Person"
$victimShip = "Person" $victimShip = "Person"
$agressorShip = "Person"
} }
If ($ship -match $cleanupPattern){ If ($ship -match $cleanupPattern){
$ship = $matches[1] $ship = $matches[1]
@ -509,13 +519,13 @@ function Read-LogEntry {
Type = $type Type = $type
KillTime = $killTime KillTime = $killTime
EnemyPilot = $agressorPilot EnemyPilot = $agressorPilot
EnemyShip = $ship EnemyShip = $agressorShip
Enlisted = $joinDate2 Enlisted = $joinDate2
RecordNumber = $citizenRecord RecordNumber = $citizenRecord
OrgAffiliation = $enemyOrgs OrgAffiliation = $enemyOrgs
Player = $victimPilot Player = $victimPilot
Weapon = $weapon Weapon = $weapon
Ship = $victimShip Ship = $Ship
Method = $damageType Method = $damageType
Mode = $global:GameMode Mode = $global:GameMode
GameVersion = $global:GameVersion GameVersion = $global:GameVersion
@ -532,7 +542,7 @@ function Read-LogEntry {
#write Death #write Death
$global:deathTally++ $global:deathTally++
Write-Output "DeathTally=$global:deathTally" Write-Output "DeathTally=$global:deathTally"
Write-Output "NewDeath=throwaway,$agressorPilot,$ship,$enemyOrgs,$joinDate2,$citizenRecord,$killTime,$enemyPFP" Write-Output "NewDeath=throwaway,$agressorPilot,$agressorShip,$enemyOrgs,$joinDate2,$citizenRecord,$killTime,$enemyPFP"
#process Other data #process Other data
} elseif ($type -eq "Other" -and $otherLog -eq $true) { } elseif ($type -eq "Other" -and $otherLog -eq $true) {
@ -582,7 +592,7 @@ function Read-LogEntry {
$sleeptimer = 10 $sleeptimer = 10
# VisorWipe # VisorWipe
If ($visorWipe -eq $true -and $victimShip -ne "Passenger" -and $damageType -notlike "*Bullet*" -and $type -ne "Other"){ If ($visorWipe -eq $true -and $victimShip -ne "Passenger" -and $damageType -notlike "*Bullet*" -and $type -ne "Other"){
# send keybind for visorwipe # send keybind for visorwipe
start-sleep 1 start-sleep 1
$sleeptimer = $sleeptimer -1 $sleeptimer = $sleeptimer -1

View file

@ -9,7 +9,7 @@ namespace AutoTrackR2
{ {
public partial class UpdatePage : UserControl public partial class UpdatePage : UserControl
{ {
private string currentVersion = "v2.06-mod"; private string currentVersion = "v2.06-koda-mod";
private string latestVersion; private string latestVersion;
public UpdatePage() public UpdatePage()