#Server restart batch
1 messages ยท Page 1 of 1 (latest)
:loop
tasklist /fi "ImageName eq CoreKeeperServer.exe" /fo csv 2>NUL | find /I "CoreKeeperServer.exe">NUL
if "%ERRORLEVEL%" NEQ "0" start powershell -executionpolicy unrestricted -File Launch.ps1 %*
timeout 10
goto loop``` as Launch.bat
# Feel free to change these (see README), but keep in mind that changes to this file might be overwritten on update
$Date = Get-Date -format "yyyyMMdd"
$DateStr = './logs/CoreKeeperServerLog-{0:yyyyMMdd}.txt' -f $Date
$CoreKeeperArguments = @("-batchmode", "-hardmode", "-logfile", $DateStr) + $args
$script:ckpid = $null
function Quit-CoreKeeperServer {
if ($script:ckpid -ne $null) {
taskkill /pid $ckpid.Id
Wait-Process -InputObject $ckpid
Write-Host "Stopped CoreKeeperServer.exe"
}
}
try {
if (Test-Path -Path "GameID.txt") {
Remove-Item -Path "GameID.txt"
}
$script:ckpid = Start-Process -PassThru -FilePath %0\..\CoreKeeperServer.exe -ArgumentList $CoreKeeperArguments
Write-Host "Started CoreKeeperServer.exe"
# Wait for GameID
while (!(Test-Path -Path "GameID.txt")) {
Start-Sleep -Milliseconds 100
}
Get-Process | Where-Object { $_.MainWindowTitle -like 'CoreKeeperPowershell' } | Stop-Process
$host.UI.RawUI.WindowTitle = "CoreKeeperPowershell"
Write-Host -NoNewline "Game ID: "
Get-Content "GameID.txt"
Write-Host "Press q to quit, DON'T close the window or the server process will just keep running"
While ($KeyInfo.VirtualKeyCode -eq $Null -or $KeyInfo.VirtualKeyCode -ne 81) {
$KeyInfo = $Host.UI.RawUI.ReadKey("NoEcho, IncludeKeyDown")
}
}
finally {
Quit-CoreKeeperServer
pause
}
``` as Launch.ps1
Nice. I'll have to take a closer look in an IDE (can optionally go with triple backtick PowerShell to syntax highlight)
good call
IDK if batch has one? eh it's short though
ye idk
all it does is look at process list and if server isn't running closes the PS window and starts server
Which is why I gave PS window a special name ๐
Ah gotcha
Thar she be
while (!(Test-Path -Path "GameID.txt")) {
Start-Sleep -Milliseconds 100
}```
So much fun lol
I cringe that bat uses goto, but hey it does the trick
Using it is fine, but having goto at all I mean lol
IDK it's been a long time since I did anything batch related
is there an alternative now?
No clue, bat makes me sad panda
I learned a ton since I last did that Astroneer thing, but I'd totes use jobs now
I don't imagine so, seeing as PowerShell is a thing
Execution is the nasty bit with PS1, so bat still has uses
I also have no real experience with PS1
Changed it to add date to the log file so at the very least it won't overwrite from day to day
And store in the logs folder since it's already there
Maybe some day Iโll add proper backing up but not rn
@turbid turtle hereโs the stuff if you want it
Noice! You wanna share it on that Reddit thread? And on the wiki?
I asked you guys cos I have no experience here and I'm not exactly firing on all cylinders today... ๐ฎโ๐จ
I started the guide page for you: https://corekeeper.wikizet.com/en/How_to_setup_a_dedicated_server
Ahh I might post on Reddit but im also not signed in on my pc lol. Dont have a wiki account so I would have to make one
Well, you or @loud arch , whatever. ๐ I think one can edit anonymously...?
lol I logged in to reddit and it says I'm not logged in so I can't comment, but then when I click log in it says I'm logged in and reloads the page. Nice
reddit dying rn
@misty plover I assume you're the person who posted on reddit since it links to the same YouTube channel as your profile here.
Also there's a chance updates to the dedicated server will overwrite Launch.ps1 so you could rename it and have batch file launch whatever the new one is called.
Yup, I guess will see tomorrow.
Wiki is sad.... And lonely... ๐ข
I was hoping @loud arch would do the setup server bit cuz Iโm too lazy to write it all lmao
Been busy and off the pc a lot
I mean, there's existing guide instruction to copy. I mostly would like (1 of) you guys to confirm them and add any details or contingencies that have been overlooked. Maybe draw straws....? ๐ฅบ
idgi codeblocks are weird on this site lol
Guess I'll just chuck the files in there
or not
This has only happened once in my life
Honestly
Wikizet is @simple root's domain. The server uses Wikimedia with some customised templates.
codeblocks is four spaces on both sides
lmfao
and it doesn't work with multiline stuff
All done and submitting it I guess
@loud arch you don't mind if I put your Discord username at the bottom with mine since you made the main instructions I used for installation, or would you prefer I not?
You figured out the formatting? It can always be edited (endlessly, for my stuff).
yea you need to start each line with four spaces
which is annoying
I just dunno if I should include Xechs discord cuz I can imagine it might lead to a lot of rando messages
I don't mind mine in case the restart script gets broken
Cool. I couldn't even find help on "<code>" in the MediaWiki site... ๐ตโ๐ซ
Might think about making one on Docker images but IDK anything about those so
Sure thing!
https://corekeeper.wikizet.com/en/How_to_setup_a_dedicated_server
and now it's prettified
I wish the steam:// link worked
I like how it decided โPaste into browser barโ is the most significant thing to quote for the embed
If you put some blurb summary above the first heading, I think it should use that instead.
Which is probably advisable: "This guide explains how to ... "
I was never good at actually buckling down to write anything lol
Yea Iโll do that when I go back in
I still wanna make the joke tho
I mean, it kinda looks like you just did? And did it quite fast. Thanks. ๐
I might see if I can follow it, sometime, as a test.
Iโm a programmer not an english major
No I havenโt yet, been outside since you suggested lol
Sorry, meant to reply to this...
Why's the official instructions so much longer?: #โ-faq-and-links message
Where yours are just:
Paste into browser address bar steam://install/1963720
That's a direct link that calls for Steam to install the dedicated server using URI (Uniform Resource Identifier). Kinda like how you can join Roblox games directly from the website instead of launching the Roblox program and joining that way.
Should I put both in there?
If you change install to uninstall you'll see how it works
((it'll still ask you to install or uninstall))
steam://uninstall/1963720
Oh, you can literally paste it into any browser, not the steam client, huh.
I think there needs to be a "basic" instructions section. That explains about leaving the window open, what it looks like, etc. At the top. Preferably with a contextual screenshot (which I could add later, maybe).
I mean it literally says as much when you launch it
Heh. It can be nice to know what to expect. And that was one part of it.
Cool. Thanks.๐ I'll take a proper look some time later. ๐
@daring ingot @turbid turtle multiline codes can be inserted with <pre></pre>
<code></code> is for inline code
I got it workin with just leading every line with 4 spaces but I'll remember for future ๐
The wiki is using mediawiki, so if you need syntax reference google mediawiki + keyword
sick thanks ๐
I said "wikimedia" above, didn't I... ๐