Skip to content

Commit 3873af8

Browse files
authored
Merge pull request #136 from Robomikel/pre-release/stabilizing
Pre release/stabilizing
2 parents cf3d23d + 932e0dd commit 3873af8

34 files changed

+306
-247
lines changed

functions/alert_discord.ps1

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -165,46 +165,46 @@ Function Send-DiscordAlert {
165165
Function get-pode {
166166
Write-log "Function: $($MyInvocation.Mycommand)"
167167
if (test-path "$podedirectory\Pode.psm1") {
168-
Write-log "Pode module found"
168+
Write-log "info: Pode module found"
169169
}
170170
Else {
171171
Get-GithubRestAPI $Podesetupowner $Podesetuprepo
172-
Write-log "Downloading Pode from github"
172+
Write-log "info: Downloading Pode from github"
173173
$start_time = Get-Date
174174
clear-hostline 1
175175
Get-Infomessage "downloading" 'Pode'
176176
iwr $githubrepoziplink -O $currentdir\$githubrepozipname
177177
If (!$?) {
178-
Write-Warning 'Downloading Pode Failed'
179-
Write-log "Downloading Pode Failed"
178+
Write-Warning 'Downloading Pode Failed'
179+
Write-log "Failed: Downloading Pode Failed"
180180
New-TryagainNew
181181
}
182182
ElseIf ($?) {
183183
clear-hostline 1
184184
Get-Infomessage "downloaded" 'Pode'
185-
Write-log "Pode succeeded "
185+
Write-log "info: Downloading Pode succeeded "
186186
}
187187
clear-hostline 1
188188
Get-Infomessage "downloadtime"
189189
clear-hostline 1
190190
Get-Infomessage "Extracting" 'Pode'
191191
try {
192192
Expand-Archive $currentdir\$githubrepozipname $podedirectory -Force
193-
write-log "Expand-Archive $currentdir\$githubrepozipname $podedirectory -Force"
193+
write-log "info: Expand-Archive $currentdir\$githubrepozipname $podedirectory -Force"
194194
}
195195
catch{
196196
$e = $_
197-
write-log "$e"
197+
write-log "Warning: $e"
198198
}
199199
If (!$?) {
200200
Write-Warning 'Extracting Pode Failed'
201-
Write-log "Extracting Pode Failed "
201+
Write-log "Failed: Extracting Pode Failed "
202202
New-TryagainNew
203203
}
204204
ElseIf ($?) {
205205
clear-hostline 1
206206
Get-Infomessage "Extracted" 'Pode'
207-
Write-log "Extracting Pode succeeded "
207+
Write-log "info: Extracting Pode succeeded "
208208
}
209209
}
210210
}

functions/check_backupfolder.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Function New-BackupFolder {
1010
Write-log "Function: $($MyInvocation.Mycommand)"
1111
If ($backupdir -and $ssmlog -and $loggingDate -and $bwd) {
1212
If (Test-Path $backupdir) {
13-
Write-log "Backup folder exists! "
13+
Write-log "info: Backup folder exists! "
1414
}
1515
ElseIf (!(Test-Path $backupdir)) {
16-
Write-log "Creating backup folder "
16+
Write-log "info: Creating backup folder "
1717
New-Item $bwd -Name "backups" -ItemType "directory" | Out-File -Append -Encoding Default $ssmlog
1818
If (!$?) {
1919
Get-warnmessage "createfolderfailed"

functions/check_config.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Function Get-CheckForVars {
1010
Write-log "Function: $($MyInvocation.Mycommand)"
1111
If ($ssmlog -and $loggingdate) {
12-
Write-log "Checking Server Variables"
12+
Write-log "info: Checking Server Variables"
1313
If ($command) {
1414
If ($command -eq "mcrcon") {
1515
$missingvars = $port, $rconpassword, ${extip}, ${ip}

functions/check_mcrcon.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Function Get-MCRconCheck {
1010
Write-log "Function: $($MyInvocation.Mycommand)"
1111
If ($mcrconexecutable -and $ssmlog -and $loggingdate) {
1212
If (Test-Path $mcrconexecutable) {
13-
Write-log "McRcon already downloaded "
13+
Write-log "info: McRcon already downloaded "
1414
}
1515
ElseIf (!(Test-Path $mcrconexecutable)) {
1616
install-mcrcon

functions/check_nodejs.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ Function Get-NodeJSCheck {
1010
Write-log "Function: $($MyInvocation.Mycommand)"
1111
If ($nodejsexecutable -and $ssmlog -and $loggingdate) {
1212
If (!(test-path $nodejsprogramexecutable)) {
13-
Write-log "Checking NodeJS "
13+
Write-log "info: Checking NodeJS "
1414
If (Test-Path $nodejsexecutable) {
15-
Write-log " NodeJS already downloaded "
15+
Write-log "info: NodeJS already downloaded "
1616
}
1717
ElseIf (!(Test-Path $nodejsexecutable)) {
18-
Write-log " NodeJS not found "
18+
Write-log "Warning: NodeJS not found "
1919
Add-NodeJS
2020
}
2121
}
2222
Else {
23-
Write-log " NodeJS Installed "
23+
Write-log "info: NodeJS Installed "
2424
Add-gamedig
2525
}
2626
}

functions/check_server_dir.ps1

Lines changed: 62 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
Function Get-FolderNames {
1010
Write-log "Function: $($MyInvocation.Mycommand)"
1111
If ($ssmlog -and $loggingdate) {
12-
Write-log "Checking Folder Names "
12+
Write-log "info: Checking Folder Names "
1313
If ("$serverdir") {
1414
If (Test-Path "$serverdir") {
15-
Write-log "Folder Name Exists $serverdir "
15+
Write-log "info: Folder Name Exists $serverdir "
1616
}
1717
ElseIf (!(Test-Path "$serverdir")) {
1818
New-ServerFolderq
@@ -28,10 +28,10 @@ Function New-LocalFolder {
2828
Write-log "Function: $($MyInvocation.Mycommand)"
2929
$global:configlocal = "config-local"
3030
If (Test-Path $currentdir\$configlocal ) {
31-
Write-log "config-local Folder Already Created! "
31+
Write-log "info: config-local Folder Already Created! "
3232
}
3333
Else {
34-
Write-log "Creating: config-local Folder "
34+
Write-log "info: Creating: config-local Folder "
3535
New-Item $currentdir -Name "$configlocal" -ItemType "directory" | Out-File -Append -Encoding Default $ssmlog
3636
If (!$?) {
3737
Write-log "Failed: Creating config-local Folder "
@@ -44,10 +44,10 @@ Function New-defaultFolder {
4444
Write-log "Function: $($MyInvocation.Mycommand)"
4545
$global:configdefault = "config-default"
4646
If (Test-Path $currentdir\$configdefault) {
47-
Write-log "config-default Folder Already Created! "
47+
Write-log "info: config-default Folder Already Created! "
4848
}
4949
Else {
50-
Write-log "Creating: config-default Folder "
50+
Write-log "info: Creating: config-default Folder "
5151
New-Item $currentdir -Name "$configdefault" -ItemType "directory" | Out-File -Append -Encoding Default $ssmlog
5252
If (!$?) {
5353
Write-log "Failed: Creating config-default Folder "
@@ -58,36 +58,82 @@ Function Test-Serverdir {
5858
Write-log "Function: $($MyInvocation.Mycommand)"
5959
if ($executabledir) {
6060
if (Test-path "$executabledir") {
61-
Write-log "Found Executable directory"
61+
Write-log "info: Found Executable directory"
6262
if ($executable) {
6363
if (Test-Path "$executabledir\$executable.*") {
64-
Write-log "Found Executable path"
64+
Write-log "info: Found Executable path"
6565
if ($servercfg) {
66-
Write-log "Found server config"
6766
if ($servercfgdir) {
6867
if (Test-Path "$servercfgdir\$servercfg") {
69-
Write-log "Found server config path"
68+
Write-log "info: Found server config path"
7069
}
7170
Else {
72-
Write-log "Check Variables-$serverfiles.ps1"
73-
Write-log "variables servercfgdir\servercfg failed"
71+
Write-log "Warning: Check Variables-$serverfiles.ps1"
72+
Write-log "Failed: server cfg Path $servercfgdir\$servercfg "
7473
Get-Infomessage "Check Variables-$serverfiles.ps1" "warning"
7574
}
7675
}
76+
Else {
77+
Write-log "Warning: Check Variables-$serverfiles.ps1"
78+
Write-log "Failed: Server cfg Dir $servercfgdir"
79+
Get-Infomessage "Check Variables-$serverfiles.ps1" "warning"
80+
}
7781
}
7882
}
7983
Else {
80-
Write-log "Check Variables-$serverfiles.ps1"
81-
Write-log "variables executabledir\executable failed"
84+
Write-log "Warning: Check Variables-$serverfiles.ps1"
85+
Write-log "Failed: Executable Path $executabledir\$executable "
8286
Get-warnmessage "Check Variables-$serverfiles.ps1"
8387
}
8488
}
8589
}
8690
Else {
87-
Write-log "Check Variables-$serverfiles.ps1"
88-
Write-log "variable executabledir failed"
91+
Write-log "Warning: Check Variables-$serverfiles.ps1"
92+
Write-log "Failed: Executable Dir $executabledir"
8993
Get-warnmessage "Check Variables-$serverfiles.ps1"
9094
}
9195
}
96+
Get-CheckSteamAPI
97+
}
98+
Function Get-CheckSteamAPI {
99+
If ($serverdir) {
100+
if (Test-Path $serverdir\steamclient.dll){
101+
if (Test-Path $serverdir\steamclient64.dll){
102+
if (Test-Path $serverdir\tier0_s.dll) {
103+
if (Test-Path $serverdir\tier0_s64.dll) {
104+
if (Test-Path $serverdir\vstdlib_s.dll ) {
105+
if (Test-Path $serverdir\vstdlib_s64.dll) {
106+
Write-log "info: Found Steam APIs DLLs"
107+
}Else{
108+
Write-log "Warning: Missing vstdlib_s64.dll in $serverdir"
109+
clear-hostline 1
110+
Get-Infomessage "Steam services maybe unavailable" "warning"
111+
}
112+
}Else{
113+
Write-log "Warning: Missing vstdlib_s.dll is $serverdir"
114+
clear-hostline 1
115+
Get-Infomessage "Steam services maybe unavailable" "warning"
116+
}
117+
}Else{
118+
Write-log "Warning: Missing tier0_s64.dll in $serverdir"
119+
clear-hostline 1
120+
Get-Infomessage "Steam services maybe unavailable" "warning"
121+
}
122+
}Else{
123+
Write-log "Warning: Missing tier0_s.dll in $serverdir"
124+
clear-hostline 1
125+
Get-Infomessage "Steam services maybe unavailable" "warning"
126+
}
127+
}Else{
128+
Write-log "Warning: Missing steamclient64.dll in $serverdir"
129+
clear-hostline 1
130+
Get-Infomessage "Steam services maybe unavailable" "warning"
131+
}
132+
}Else{
133+
Write-log "Warning: Missing steamclient.dll in $serverdir"
134+
clear-hostline 1
135+
Get-Infomessage "Steam services maybe unavailable" "warning"
136+
}
137+
}
92138
}
93139

functions/check_serverbuild.ps1

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ Function Get-ServerBuildCheck {
1212
If ($appid) {
1313
If ($appid -eq 11500000 ) {
1414
Get-MCversion
15-
Write-log "Non-steam Game"
15+
Write-log "info: Non-steam Game"
1616
}
1717
ElseIf ($appid -eq 11421000 ) {
18-
Write-log "Non-steam Game"
18+
Write-log "info: Non-steam Game"
1919
Get-MCbrversion
2020
}
2121
Else {
@@ -49,17 +49,17 @@ Function Get-ServerBuildCheck {
4949
#$localbuild
5050
if (!$remotebuild ) {
5151
Write-Warning 'Failed to retrieve remote build'
52-
Write-log "Warning: Failed to retrieve remote build"
52+
Write-log "Failed: to retrieve remote build"
5353
}
5454
if (!$localbuild ) {
5555
Write-Warning 'Failed to retrieve Local build'
56-
Write-log "Warning: Failed to retrieve Local build"
56+
Write-log "Failed: to retrieve Local build"
5757
}
5858
clear-hostline 1
5959
Write-Information "SteamDB: $remotebuild" -InformationAction Continue
6060
Write-Information "LocalBuild: $localbuild" -InformationAction Continue
61-
Write-Log "SteamDB: $remotebuild" -InformationAction Continue
62-
Write-Log "LocalBuild: $localbuild" -InformationAction Continue
61+
Write-Log "info: SteamDB: $remotebuild" -InformationAction Continue
62+
Write-Log "info: LocalBuild: $localbuild" -InformationAction Continue
6363
Start-Sleep -Seconds 2
6464
If (($command -eq 'update') -or ($updateonstart -eq "on") ) {
6565
If (Compare-Object $remotebuild.ToString() $localbuild.ToString()) {
@@ -72,14 +72,14 @@ Function Get-ServerBuildCheck {
7272
Get-UpdateServer
7373
}
7474
Else {
75-
Write-log "No $serverfiles Updates found"
75+
Write-log "info: No $serverfiles Updates found"
7676
clear-hostline 2
7777
Get-Infomessage "noupdates" 'info'
7878
}
7979
}
8080
}
8181
Else {
82-
Write-log " Updates on start off"
82+
Write-log "info: Updates on start off"
8383
}
8484
}
8585
}
@@ -93,19 +93,19 @@ Function Get-SteamFix {
9393
If ($ssmlog -and $loggingdate -and $appid -and "$serverdir") {
9494
If ((Test-Path "$serverdir\steamapps\appmanifest_$appid.acf.bak") -and (!(Test-Path "$serverdir\steamapps\appmanifest_$appid.acf")) ) {
9595
Rename-Item "$serverdir\steamapps\appmanifest_$appid.acf.bak" "appmanifest_$appid.acf" -Force -ErrorAction SilentlyContinue
96-
Write-log "Restore appmanifest_$appid.acf "
96+
Write-log "info: Restore appmanifest_$appid.acf "
9797
}
9898
ElseIf (Test-Path "$serverdir\steamapps\appmanifest_$appid.acf") {
9999
Rename-Item "$serverdir\steamapps\appmanifest_$appid.acf" "appmanifest_$appid.acf.bak" -Force -ErrorAction SilentlyContinue
100-
Write-log "Rename appmanifest_$appid.acf "
100+
Write-log "info: Rename appmanifest_$appid.acf "
101101
If (Test-Path "$serverdir\steamapps\appmanifest_228980.acf") {
102102
Rename-Item "$serverdir\steamapps\appmanifest_228980.acf" "appmanifest_228980.acf.bak" -Force -ErrorAction SilentlyContinue
103-
Write-log "Rename Steamworks Common Redistributables appmanifest_228980.acf"
103+
Write-log "info: Rename Steamworks Common Redistributables appmanifest_228980.acf"
104104
}
105105
}
106106
ElseIf (!(Test-Path "$serverdir\steamapps\appmanifest_$appid.acf")) {
107107
Write-warning "No app Manifests found. Recommend Validate"
108-
Write-log "Warining: No app Manifests found. Recommend Validate"
108+
Write-log "Warning: No app Manifests found. Recommend Validate"
109109
}
110110
}
111111
}

functions/check_sevenzip.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
Function Get-SevenZipCheck {
1010
Write-log "Function: $($MyInvocation.Mycommand)"
1111
If ($ssmlog -and $loggingdate) {
12-
Write-log "Checking for 7ZIP " 'info'
12+
Write-log "info: Checking for 7ZIP " 'info'
1313
If (!(Test-Path $sevenzipprogramexecutable)) {
1414
If ($sevenzipexecutable) {
1515
If (Test-Path $sevenzipexecutable ) {
16-
Write-log "7Zip already downloaded! "
16+
Write-log "info: 7Zip already downloaded! "
1717
}
1818
ElseIf (!(Test-Path $sevenzipexecutable)) {
19-
Write-log " 7Zip not found! $sevenzipexecutable "
19+
Write-log "Warning: 7Zip not found! $sevenzipexecutable "
2020
Add-Sevenzip
2121
}
2222
}
@@ -25,7 +25,7 @@ Function Get-SevenZipCheck {
2525
}
2626
}
2727
Else {
28-
Write-log "7Zip already installed! "
28+
Write-log "info: 7Zip already installed! "
2929
}
3030
}
3131
}

functions/check_steamcmd.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ Function Get-Steam {
1111
If ($ssmlog -and $loggingdate) {
1212
If ($steamexecutable) {
1313
If (Test-Path $steamexecutable) {
14-
Write-log "steamCMD already downloaded! "
14+
Write-log "info: steamCMD already downloaded! "
1515
}
16-
ElseIf (!(Test-Path $steamexecutable)) {
16+
ElseIf (!(Test-Path $steamexecutable)) {
17+
Write-log "Warning: SteamCMD not found! "
1718
Install-Steam
1819
}
1920
}

0 commit comments

Comments
 (0)