Skip to content

Commit

Permalink
Update PalworldServerTools.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
shupershuff committed Feb 8, 2024
1 parent 2815dae commit 7530909
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PalworldServerTools.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Function WriteLog {
if ($True -eq $NewLine){#Overwrite $LogMessage to remove headers if -newline is enabled
$LogMessage = " $LogString"
}
if (($NoLogging -eq $False -or ($CustomLogFile -ne "" -and $ShowPlayers -eq $True)) -and $NoNewLine -eq $True ){#Overwrite $LogMessage to put text immediately after last line if -nonewline is enabled
if (($NoLogging -eq $False -or ($CustomLogFile -ne "" -and $LogPlayers -eq $True)) -and $NoNewLine -eq $True ){#Overwrite $LogMessage to put text immediately after last line if -nonewline is enabled
$LogContent = (Get-Content -Path $LogFile -Raw) # Read the content of the file
if ($logcontent -match ' \r?\n\r?\n$' -or $logcontent -match ' \r?\n$' -or $logcontent -match ' \r?\n$' -or $logcontent[-1] -eq " "){#if the last characters in the file is a space a space with one or two line breaks
$Space = " "
Expand All @@ -172,7 +172,7 @@ Function WriteLog {
}
while ($Complete -ne $True -or $WriteAttempts -eq 3){
try {
if (($NoLogging -eq $False -or ($CustomLogFile -ne "" -and $ShowPlayers -eq $True)) -and $NoNewLine -eq $False ){ #if user has disabled logging, eg on sensors that check every minute or so, they may want logging disabled.
if (($NoLogging -eq $False -or ($CustomLogFile -ne "" -and $LogPlayers -eq $True)) -and $NoNewLine -eq $False ){ #if user has disabled logging, eg on sensors that check every minute or so, they may want logging disabled.
Add-content $LogFile -value $LogMessage -ErrorAction Stop
$Complete = $True
}
Expand Down

0 comments on commit 7530909

Please sign in to comment.