Jump to content

Multi-player Server


GrammarCzar

Recommended Posts

  • Boxelware Team

Hi!

You can start a singleplayer game and it will start a server internally and people can connect to you (if you want to play via internet you should forward the tcp and udp ports 24000 to your computer). But this server will be closed as soon as you quit the game.

 

If you want to start a dedicated server that continues running after everybody quit, you have to start the server from the command line or write a batch script that starts it, as you need to set some command line options:

 

--datapath here you have to specify the path where the server will save the galaxy

--admin Specify the admin nickname for the server

 

If you have your game installed in the default folder, the final command would look something like

 

"C:\Program Files\Avorion\bin\SpaceServer.exe" --datapath "C:\MyAwesomeGalaxy" --admin GrammarCzar

 

This will create the folder C:\MyAwesomeGalaxy and the galaxy will be saved there.

 

Side notes:

Server admin does nothing until now though, it will be used in later releases, but must be specified nevertheless.

Just like the clients, the server runs on windows only for now.

More server administration (limited number of players, moderators etc.) features are the next thing I will implement.

 

I guess an article in the wiki could be of use here, too.

 

Edit: Corrected the command.

Link to comment
Share on other sites

I have enabled port forwarding on my router at 24000 for TCP on my computer hosting the server.

 

I launch the cmd prompt and run the above command and it executes. I go into the game and choose

the multi-player setting and launch it. It loads for a split second and I can see myself enter the world on

the bottom left then I get Connection Closed prompt and forced to exit.

 

The cmd prompt has "server: connection 0 closed by remote"

 

Did I miss something? Or are you not able to play on the computer that is hosting the server as well?

Link to comment
Share on other sites

  • Boxelware Team

It's definitely possible to play on the same machine that a dedicated server runs on.

In your folder where your server created the galaxy, there should be a file called serverlog.txt. Could you please post its content?

 

EDIT: The file should be located in your %appdata%\Avorion folder.

Link to comment
Share on other sites

Sorry for the late reply, I wish the forum had an email alert system hah. (found the Notify button at the bottom right... Doh!)

 

Here is the issue:

An Exception occured: could not load script 'data/scripts/craftorders.lua':

cannot open data/scripts/craftorders.lua: No such file or directory

 

still want that log file, let me know

Link to comment
Share on other sites

  • Boxelware Team

Make sure that the working directory is the Avorion installation folder, when you start the server.

 

So, when you start the game from the command line, you should be in the Avorion installation folder. The server should then be started with

bin\SpaceServer.exe [...]

Link to comment
Share on other sites

  • Boxelware Team

I don't exactly understand what you mean.

I assume now, you mean you installed the game in another folder.

As stated on the article in the wiki, in the tutorial it is assumed that the game is installed in the given folder.

If your folder is different you must specify another name.

Link to comment
Share on other sites

Do you see a chat message that he was logged in? Can he start the singleplayer?

Yes, he was logged in, he even could write a chat message, but past some time his client closes. Some time server console writes "time out" or "closed by remote", I think that I should increase server waiting time and client too, but how can I do this?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...