Can't get external server to work

Problems and solutions for installing or running FreeOrion, including discussion of bugs if needed before posting a bug report on GitHub. For problems building from source, post in Compile.

Moderator: Oberlus

Post Reply
Message
Author
User avatar
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Can't get external server to work

#1 Post by human2 »

I'm following the instructions at https://www.freeorion.org/index.php/Multiplayer for "Hosting a game on external server". I've done this before but not in a while.

I'm on a Mac and Lubuntu. I've tried a bunch of things. I tried selecting Multiplayer and "Host a new game" and tried connecting with the other computer and that works. It doesn't matter which is the host, it works.

But when I start freeoriond from the terminal I get a black screen on the other computer when I click "Join" and "Ok". I ran ps to see exactly what args the GUI is using and I tried those args in the command line (--resource.path "/Applications/FreeOrion.app/Contents/Resources/default"). But no matter what, if I start freeoriond independent of the GUI I can't seem to get it to work but it works fine if I run it from the GUI.

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Can't get external server to work

#2 Post by o01eg »

If you don't use GUI to start external server add --hostless command line argument.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Can't get external server to work

#3 Post by Ophiuchus »

If you want to keep it running use something like this:

Code: Select all

freeoriond --hostless --network.server.unconn-human-empire-players.max 0 --network.server.conn-human-empire-players.min 0
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Re: Can't get external server to work

#4 Post by human2 »

It worked on macOS! Thank you!

However, it didn't work in my container and had trouble on Lubuntu. So many different issues and I'm trying to keep them in their own threads...

Anyway. When I fix the libraries in the snap version with ldconfig (I just posted about that here: viewtopic.php?f=25&t=11564) and then run it with --hostless it complains:

Code: Select all

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unabel to get teh locale encoding
ModuleNotFoundError: No module named 'encodings'
Maybe this has something to do with how I fixed the libraries.

The snap freeorion works fine.

Second, I just found out about the version from https://launchpad.net/~o01eg/+archive/u ... ion-stable.

This version runs freeorion fine but it also has an issue running freeoriond but I'll post about that in this thread: viewtopic.php?f=2&t=10942&start=135

(sorry if all the thread jumping is annoying, I'm just trying to keep the threads about the subject.)

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Can't get external server to work

#5 Post by o01eg »

human2 wrote: Thu Feb 18, 2021 5:15 am Fatal Python error: Py_Initialize: Unabel to get teh locale encoding
Could you try setup PYTHONHOME environment variable? https://techglimpse.com/error-executing ... -solution/
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

User avatar
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Re: Can't get external server to work

#6 Post by human2 »

o01eg wrote: Thu Feb 18, 2021 5:44 am
human2 wrote: Thu Feb 18, 2021 5:15 am Fatal Python error: Py_Initialize: Unabel to get teh locale encoding
Could you try setup PYTHONHOME environment variable? https://techglimpse.com/error-executing ... -solution/

Code: Select all

> ls -l /usr/bin/python3
.. /usr/bin/pthon3 -> python3.8
> export PYTHONHOME=/usr/lib/python3.8
> cd /snap/freeorion/current
> ./bin/freeoriond --hostless
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'
...

> python3
...
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
...
> unset PYTHONHOME
> python3
Python 3.8.5 (...)
...
>>> print("Hello World")
Hello World
>>>
I also set the PYTHONPATH to /usr/bin/pthon3 just in case that meant anything and it didn't make a difference.

Post Reply