Run two instances of spring?

Run two instances of spring?

Discuss everything related to running Spring on your chosen distribution of Linux.

Moderator: Moderators

Post Reply
User avatar
Pithikos
Posts: 146
Joined: 26 Dec 2008, 14:26

Run two instances of spring?

Post by Pithikos »

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).
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Run two instances of spring?

Post by SirMaverick »

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.
User avatar
Pithikos
Posts: 146
Joined: 26 Dec 2008, 14:26

Re: Run two instances of spring?

Post by Pithikos »

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.
That doesn't seem to work. I made two configuration files, one for server and one for client where they look like this:

Server:

Code: Select all

AutohostIP = localhost
LinkBandwidth = 0
NetworkTimeout = 0
address = 127.0.0.1
name = Pithikos
WhiteListAdditionalPlayers = Pithikos2
Client:

Code: Select all

AutohostIP = localhost
LinkBandwidth = 0
NetworkTimeout = 0
address = 127.0.0.1
name = Pithikos2
There are other options as well ofcourse. However these I guess are the only ones concerning what I try to do.

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).
Is my configuration wrong or is Spring just a piece of junk?
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Run two instances of spring?

Post by SirMaverick »

I think your scripts aren't correct. Try starting spring with a lobby to see how they should look like.
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.
You start spring without the script as parameter. With proper scripts spring won't show you the menu (with direct connet, test game etc.).
Is my configuration wrong [...]?
Yes.
User avatar
Pithikos
Posts: 146
Joined: 26 Dec 2008, 14:26

Re: Run two instances of spring?

Post by Pithikos »

SirMaverick wrote:Try starting spring with a lobby to see how they should look like.
Not sure what you mean with that.


I also tryied running spring with:

Code: Select all

spring -s -C server.conf
and

Code: Select all

spring -c -C client.conf
and many other ways. In all occasions I get into that menu.

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
I don't get any errors in the terminal about the configuration files.
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Run two instances of spring?

Post by SirMaverick »

Pithikos wrote:
SirMaverick wrote:Try starting spring with a lobby to see how they should look like.
Not sure what you mean with that.


I also tryied running spring with:

Code: Select all

spring -s -C server.conf
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.

You are starting spring without a script file.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Run two instances of spring?

Post by abma »

Post Reply

Return to “Linux”