I want to test something and I need to run two instances of spring on the same computer. So practically I want to play against me on the same computer.
Is that possible?
I would do my testing on my eee901 but it has not the horsepower to compile from source(don't either want to fill it with unnecesary libboost libraries).
Run two instances of spring?
Moderator: Moderators
-
- Posts: 834
- Joined: 19 May 2009, 21:10
Re: Run two instances of spring?
Sure it's possible.
Just start with spring twice each time using a different script.txt (one for the host one for the client).
More proper setup is to have 2 separate data directories (e.g. so your infolog is not a merge from the two running instances). You start each spring with an additional parameter (-C) for the spring config file which each pointing to one of the data directories.
Just start with spring twice each time using a different script.txt (one for the host one for the client).
More proper setup is to have 2 separate data directories (e.g. so your infolog is not a merge from the two running instances). You start each spring with an additional parameter (-C) for the spring config file which each pointing to one of the data directories.
Re: Run two instances of spring?
That doesn't seem to work. I made two configuration files, one for server and one for client where they look like this:SirMaverick wrote:Sure it's possible.
Just start with spring twice each time using a different script.txt (one for the host one for the client).
More proper setup is to have 2 separate data directories (e.g. so your infolog is not a merge from the two running instances). You start each spring with an additional parameter (-C) for the spring config file which each pointing to one of the data directories.
Server:
Code: Select all
AutohostIP = localhost
LinkBandwidth = 0
NetworkTimeout = 0
address = 127.0.0.1
name = Pithikos
WhiteListAdditionalPlayers = Pithikos2
Code: Select all
AutohostIP = localhost
LinkBandwidth = 0
NetworkTimeout = 0
address = 127.0.0.1
name = Pithikos2
Then I launch the client and use "Direct Connect" to 127.0.0.1. Then spring waits for the server so I launch the server and then click "Test game". However the client disconnects.
Something I noticed is that the client name will change randomly while being in the connecting screen. It can even show as "(null)".
Now here is the log after crash from the client instance:
Code: Select all
[f=0000000] Video mode set to 1920x1080/32bit (windowed)
[f=0000000] Connecting to 127.0.0.1:8452 using name Pithikos2
[f=0000000] Error: Segmentation fault (SIGSEGV) in spring 85.0
[f=0000000] Error: Stacktrace:
[f=0000000] Error: <0> /lib/x86_64-linux-gnu/libc.so.6(+0x36420) [0x7f17ca206420]
[f=0000000] Error: <1> /lib/x86_64-linux-gnu/libc.so.6(_IO_vfprintf+0x1cb4) [0x7f17ca2191a4]
[f=0000000] Error: <2> /lib/x86_64-linux-gnu/libc.so.6(__vsnprintf_chk+0xb0) [0x7f17ca2c6d90]
[f=0000000] Error: <3> spring() [0x7c910b]
[f=0000000] Error: <4> spring() [0x53a764]
[f=0000000] Error: <5> spring() [0x98d3ff]
[f=0000000] Error: <6> spring() [0x992ff5]
[f=0000000] Error: <7> spring() [0x971a37]
[f=0000000] Error: <8> spring() [0x971f57]
[f=0000000] Error: <9> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f17ca1f130d]
Error: Spring crashed Spring has crashed:
Segmentation fault (SIGSEGV).
-
- Posts: 834
- Joined: 19 May 2009, 21:10
Re: Run two instances of spring?
I think your scripts aren't correct. Try starting spring with a lobby to see how they should look like.
You start spring without the script as parameter. With proper scripts spring won't show you the menu (with direct connet, test game etc.).Pithikos wrote:Then I launch the client and use "Direct Connect" to 127.0.0.1. Then spring waits for the server so I launch the server and then click "Test game". However the client disconnects.
Yes.Is my configuration wrong [...]?
Re: Run two instances of spring?
Not sure what you mean with that.SirMaverick wrote:Try starting spring with a lobby to see how they should look like.
I also tryied running spring with:
Code: Select all
spring -s -C server.conf
Code: Select all
spring -c -C client.conf
With the second command in fact I get straight to Direct Connect. I just hit enter and it says "waiting..". Then spring closes and in the terminal I get:
Code: Select all
[f=0000000] Connecting to 127.0.0.1:8452 using name Pithikos2
[f=0000000] Warning: Server not reachable
-
- Posts: 834
- Joined: 19 May 2009, 21:10
Re: Run two instances of spring?
There is a configuration file and a script file (script.txt). The configuration file is configuration for spring, e.g. screen resolution etc. The script file contains setup for the current game.Pithikos wrote:Not sure what you mean with that.SirMaverick wrote:Try starting spring with a lobby to see how they should look like.
I also tryied running spring with:Code: Select all
spring -s -C server.conf
You are starting spring without a script file.
Re: Run two instances of spring?
https://github.com/spring/spring/blob/d ... prepare.sh and https://github.com/spring/spring/blob/d ... -client.sh creates working scripts for client + server.