#How to set up a server with a port and an IP ?

1 messages ยท Page 1 of 1 (latest)

bold jacinth
#

hey, has anyone gotten a headless linux server to work without using steam relay? it adds like 100ms to my ping and it's kinda annoying... i've got everything installed, port forwarded, firewall rule created, but no matter what i do, it seems to go through steams servers
I changed added port and ip in the serverconfig json but when i execute _launch.sh it edits the file back to nothing and im still on 120+ms

night pike
#

Are you using the corr3ct pass through params?

bold jacinth
#

for the ip i tried both the local machine ip and the public ip

#

but it always went thru steam

#

i also tried modifying the config json and executing without arguments but same thing

short spire
left badger
#

I did launch.bat -port 23900 -ip xxx.xxx.xxx.xxx in a command prompt set to the directory of the dedicated server folder that has the read me in it

bleak pasture
#

I thought that the simple fact of being connected to the same network (even without internet) should be enough but it is not the case and I do not know why. I think I'm mismanaging the port and ip configuration as it is said in the dedicated server README.

spark tangle
#

if on the same network you shouldnt have to port forward.

bleak pasture
#

I thought so too but I can't connect to my server if I'm offline.

#

It says in the README.txt: -port <unset> What port to bind to. If not set, then the server will use the Steam relay network. If set the clients will connect to the server directly and the port needs to be open. -ip 0.0.0.0 Only used if port is set. Sets the address that the server will bind to.Maybe this is because it tries to use the Steam relay network

spark tangle
#

i havent messed with the server stuff yet. but how do you go about connecting to it? do you enter the ip or is it strill a code?

bleak pasture
#

You must enter the game ID

spark tangle
#

well there goes the idea of putting the port at the end of the address

bleak pasture
#

At the end of the game ID?

spark tangle
#

nah when you are trying to connect to something locally(or over the internet if it isnt set up right) you add the port to the end of the ip. example: 192.168.1.1:1234

spark tangle
bleak pasture
#

The port and the ip can be set in the server configuration but I didn't understand where and how. I think it's in the Launch.ps1 arguments but it doesn't work. Maybe the syntax is wrong but this README.txt is the only source of information I found.

spark tangle
#

let me see your config

bleak pasture
#

I did that with the Launch.ps1 : ```# Feel free to change these (see README), but keep in mind that changes to this file might be overwritten on update
$CoreKeeperArguments = @("-batchmode", "-logfile", "CoreKeeperServerLog.txt", "-port 2875", "-ip my host pc local ipv4") + $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
}

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
}

spark tangle
#

$CoreKeeperArguments = @("-batchmode", "-logfile", "CoreKeeperServerLog.txt", "-port 2875", "-ip my host pc local ipv4") + $args this looks proper to me

bleak pasture
#

(I opened my 2875 port in firewall)

spark tangle
#

also you dont need to hide local addresses. theyre common and cant be used for anything. if someone were to type it in it would try to connect to a device on their network

spark tangle
bleak pasture
spark tangle
#

will it let you set type to tcp/udp? or is it one or the other?

bleak pasture
#

I can choose one or the other (or many others that I don't know) or all

spark tangle
#

set one up for the port using udp also. so that you have 2 rules. one for tcp and one for udp

bleak pasture
#

Done but the server does not start when I add these arguments (-port and - ip)

#

Without :

spark tangle
#

interesting

bleak pasture
#

The syntax looks good to me but there must be a problem

spark tangle
#

whats it say in the log files?

bleak pasture
#

Problem solved, the server starts (but the basic problem is still there). I had written the ip wrong after rewriting it, sry ._.

spark tangle
#

lol

bleak pasture
#

If I try to connect, it says "Could not find game".

spark tangle
#

delete that, it has your external ip in it

bleak pasture
#

ok thx

spark tangle
#

how about you act like it then

bleak pasture
#

What does that mean?

spark tangle
#

looks like it is a connection test and thats saying it's fine

#

im going to install the server and see if i can get it to run over here

bleak pasture
#

Ok

#

At the moment with this configuration, online it says "Connection closed" and offline "Could not find game".

spark tangle
#

have you been quitting the server or just closing the window?

bleak pasture
#

Q

#

I tried also to reinstall the server

spark tangle
#

add 2 new firewall rules one for tcp and one for upd for port 2876

#

seems it is using that one also

bleak pasture
#

ok

spark tangle
#

hmmmm

bleak pasture
#

Done

#

But why 0.0.0.0 ?

spark tangle
#

oh that was just me testing stuff

#

you can ignore that

#

whats interesting is without the port forwarded i get

#

with it forwarded i get

#

still cant connect but it went from unresponsive to responsive

bleak pasture
#

Where did you find this ?

spark tangle
#

it's the output from bepinex. it's for mods. but it gives you a nice window into what is going on with the game

bleak pasture
#

So you also have "Connection Closed" in online (and probably "Could not find game" in offline) ?

spark tangle
#

ok putting in my computers ip instead of any of the localhost addresses and im able to connect. now that i know i can connect, lets remove the port forward and see what it does

spark tangle
#

ya without the port forward it goes back to connection closed

bleak pasture
#

Do you think we can get help from a developer?

#

I guess they already got -port and -ip working

spark tangle
#

it seems it is trying to use the internet no matter what

#

i blocked the games access to the internet and it is still trying to use my external ip

#

ya i think this is a design issue so prob need dev help

#

@short spire might be the best one to ping for this

#

could maybe add either a box to check to make it look on the local network. or make it so the ip(and port if not default) of the server can be entered instead of game id

bleak pasture
#

Yes, I think so, but in fact -port and -ip don't work at all (or we did it wrong). I am surprised that it is in the README.txt. Maybe a simple error that breaks everything.

spark tangle
#

i think they are working, but the fact the game doesnt try locally but over the internet means you cant do it "offline". the ip is the bind address(what it listens on) which 0.0.0.0 means all ips(normally), localhost/127.0.0.1/internal ip should all work the same but that doesnt seem to be true in this case. i didnt try 0.0.0.0 with the port forwarded but the fact that seems to be the default, im going to assume they are using it how everything else uses it.

bleak pasture
#

Yes I see

#

Is Max a Core Keeper developer ?

spark tangle
#

ya, in the meet the team channel he said he handles multiplayer

short spire
#

The port that is the set port + 1 is a steam thing that can be used to query the server. I suspect the lan detection might use that as well

#

And just in case you haven't tried that: Everything should work without you specifying the port at all. The port is just if you want to have a direct connection to the server instead of via relays

bleak pasture
#

Is it possible to run a server without internet? In a local server? I thought that with the Steam Relay Network (and so without port) it would not work

short spire
#

It might be that it works, but if you can't connect to it with the port then it won't work without it as well

#

The detection works the same is what I'm trying to say ๐Ÿ™‚

#

And in your example it looks like it doesn't find the server locally so if there were no internet it wouldn't find it at all

#

I think I misread your question a bit as well: It might work without the port setting, but should definitely work with the port setting since that doesn't use the relays at all

short spire
#

I'm off to bed, but I'll leave you with this: Try using port 27015. I'm suspecting it needs the default port for the lan detection to work. Will look into it more later. Cheers!

bleak pasture
#

Ok thx, I will try this

bleak pasture
#

So with 27015, online : no problem, offline : Connection closed

short spire
#

I looked into it some more and the server will need to access the steam servers as it is right now. Will try to remove that requirement for local servers, thanks for letting me know :)

bleak pasture
#

Got it, thanks for your help and keep me posted

bleak pasture
#

(Don't hesitate to mention me, I'm waiting for this to start the adventure AncientPick )

night pike
#

I keep getting connection closed as well any fix for that?

bleak pasture
#

Offline or online?

night pike
#

Online

#

Wait you can do lan as well?

#

I just need online though, tried a couple ports none worked, full firewall access no dice.

bleak pasture
#

There is currently a problem with offline LANs. However I'm not sure why use ports and ip if it's online

night pike
#

relay access can add latency

bleak pasture
#

In any case, you need port 27015 which is the default port (if you use them)

night pike
#

I did try that still did not work

bleak pasture
#

Can you send your launch.ps1 file ?

night pike
#

Its the default launch.ps1

#

I'm just sending args via it

#

So my args would be , '-port 27015 -ip 207.244.238.162'

bleak pasture
#

$CoreKeeperArguments = @("-batchmode", "-logfile", "CoreKeeperServerLog.txt", "-port 27015", "-ip my host pc local ipv4") + $args

night pike
#

I'm utilizing $args

#

No need to edit Launch.ps1 as they added that a while ago

#

But yeah regardless, connection closed.

bleak pasture
#

Where do you put $args?

night pike
#

Huh? just feed arguments into it

#

Launch.bat -port 27015 -ip 207.244.238.162

bleak pasture
#

I don't think it can work. Try to remove those and edit the line in the launch.ps1 file

night pike
#

What are you on about it works fine

#

arguments are passed fine, I did check

bleak pasture
#

It doesn't cost anything to try

night pike
bleak pasture
#

What is 207.244.238.162 ?

night pike
#

What? It is an ip address?

#

-world 0                                Which world index to use.
-worldname "Core Keeper Server"         The name to use for the server.
-worldseed 0                            The seed to use for a new world. Set to 0 to generate random seed.
-gameid ""                              Game ID to use for the server. Need to be at least 23 characters and alphanumeric, excluding Y,y,x,0,O. Empty or not valid means a new ID will be generated at start.
-datapath ""                            Save file location. If not set it defaults to a subfolder named "DedicatedServer" at the default Core Keeper save location.
-maxplayers 100                         Maximum number of players that will be allowed to connect to server.
-worldmode 0                            Whether to use normal (0) or hard (1) mode for world.
-port <unset>                           What port to bind to. If not set, then the server will use the Steam relay network. If set the clients will connect to the server directly and the port needs to be open.
-ip 0.0.0.0                             Only used if port is set. Sets the address that the server will bind to.
#

What

#

@tulip forge fix this bot

#

I put code blocks and it said I was spamming ๐Ÿ˜‚

bleak pasture
#

Is it a local ip ?

tulip forge
bleak pasture
#

Try 0.0.0.0

bleak pasture
#

@night pike Did you solve your problem?

night pike
#

Seems some additional ports needed to be opened.

spark tangle
night pike
#

say that to who added the bot not me

spark tangle
#

oh i know. there prob isnt much they can do about it

spark tangle
#

@short spireyou ever seen anyone have any issues with the game after uninstalling the dedicated server? i cant use portals anymore it doesnt load the world and gives this message(in yellow).

#

ive tried checking the files with steam, and reinstalling the game. i thought it might have been an issue with a mod, but it does it without mods on a fresh install. the only thing that changed from when it was working fine and it not working was me installing the server to help troubleshoot this issue

short spire
#

Yes, I've seen that :) looking into it now, should have it fixed for the next patch along with the offline server troubles. Sadly no workaround, but I think it is triggered by specific parts of the world

tulip forge
spark tangle
spark tangle
tulip forge
#

I'll pass on your thoughts ๐Ÿ™‚

bleak pasture
#

Hello, is the problem corrected?

short spire
#

I was just looking for this thread ๐Ÿ™‚ I hit a bit of a snag with the offline servers which means we have to wait for a Steam SDK update to be able to do that unless I find some other workaround. But the problem in the image above with the "very large snapshot size" error is fixed

bleak pasture
#

Okay, I got it.

spark tangle