Headless Server - how to run a Lux room from the command line

Game of universal domination. New dice available free upon request.
Post Reply
User avatar
dustin
Lux Creator
Lux Creator
Posts: 10433
Joined: Thu May 15, 2003 2:01 am
Location: Cascadia
Contact:

Headless Server - how to run a Lux room from the command line

Post by dustin » Sun May 28, 2006 11:35 pm

Lux includes a headless server option. This means you can run a host from the command line, and it will operate in the background without creating any windows or graphics. NOTE: You will need some degree of computing skills to get this running.

Instructions:
- Install all desired maps or generators that aren't default maps (i.e: Classic, Biohazard). You can use the PluginManager or copy the files into the proper Support folder location. If you want to host typical biodeux, then you need to install the Biohazard map generator plugin.

- You need to make sure your computer firewall and router are set to allow hosting. If you've never hosted a Lux room on your computer before, try it, you'll probably need to follow some of the router and firewall setup.

Mac OS X instructions:
- Open up the Terminal application (inside /Applications/Utilities/)
- Change to the directory Lux is, typically the command will be: cd /Applications
- Run your customized Lux headless command. Here's an example for you to modify:

Code: Select all

java -Djava.awt.headless=true -cp "./Lux Delux.app/Contents/Java/LuxCore.jar:./Lux Delux.app/Contents/Java/MRJAdapter.jar" com.sillysoft.lux.Lux -headless -network=true -public=true -map=RomanEmpireII -cards=4e3 -conts=5 -time=30 -name=Your_name -desc=Your_description
Windows instructions:
- Open a terminal/shell window.
- Navigate to the Lux Delux install folder.
- Run your customized Lux headless command. Here's an example for you to modify:

Code: Select all

jre8_40_private\bin\java -Djava.awt.headless=true -cp * com.sillysoft.lux.Lux -headless -network=true -public=true -map=RomanEmpireII -cards=4e3 -conts=5 -time=30 -name=Your_name -desc=Your_description
Linux ssh session instructions:
- ssh into your linux server
- download the linux package:

Code: Select all

wget http://sillysoft.net/download/LuxDelux-linux.tgz
- unpack the download package:

Code: Select all

tar xzf LuxDelux-linux.tgz
- Navigate to the Lux Delux install folder:

Code: Select all

cd LuxDelux
(Optional) - install additional maps or AIs by copying them from your home computer into the corresponding Support folder inside the remote LuxDelux/Support/ folder.

- Run your customized Lux headless command. Here's an example for you to modify:

Code: Select all

linux-private-jre8_40/bin/java -Djava.awt.headless=true -cp "LuxCore.jar:lib/*" com.sillysoft.lux.Lux -headless -map=RomanEmpireII -network=true -public=true -cards=5e15 -conts=30 -time=30 -name=Your_name -desc=Your_description -shuffle3 -nofirstturncontbonus -regcode=LD-YOUR-REGCODE
If you want to be able to exit from your ssh session and still have the host run, add these bits to the front and end of your customized command:

Code: Select all

nohup YOUR_CUSTOMIZED_VERSION_OF_ABOVE_COMMAND  &> logfile.txt &
Those commands should be all on one big line. Most of the switches should be self-explanatory. If you want a private game then switch -public=true to be -public=false. If you play around with the switches it should tell you if you do anything wrong and let you know how to do it right.

You can join your own headless server (and you'll be promoted to the host). If you're having trouble joining it from the same computer, try entering '0' into the 'private game address' box in the Join Game window and clicking Join. (You'll need to clear the private address field to join any other listed games fyi)

The headless server will not play games with all bots, to save CPU.

The following command line options are supported:
-name=hostname
-map=ClassicPartDeux (remove all spaces from map names)
-desc=Hello_everyone (replace all spaces with underscores)
-time=30
-conts=15
-cards=51015
-unranked
-placed
-scenario
-bio1 to -bio6
-shuffle2 (randomize and winner stays)
-shuffle3 (highest ranked players)
-shuffle4 (cycle out game losers)
-public=true
-port=6619
-agent=<bot> (can also use the values "networkplayeronly" or "networkplayeronlyfull")
-regCode=CODE (if you're getting notices about pirates or non-registered account)
-gamelimit=45
-nofirstturncontbonus
-novariablestart (turns off extra starting armies for last players)

If you want unicode output in the shell window, add -Dfile.encoding=UTF8 to the command you run.

If you want to host multiple rooms on the same computer, you need to specify a different -port setting for each of them (use 6620, 6621, etc).

You can turn off bot-only games by typing /set abortbotgames as the host in the chat. Do it when you only have 1 instance of Lux running. This works for both normal and headless servers.
Last edited by dustin on Wed Mar 29, 2017 5:59 pm, edited 26 times in total.

User avatar
Kef
Lux Translator
Posts: 4471
Joined: Tue Feb 24, 2004 11:23 am
Location: in j0r f0rumz, Tr0||in j0r t0pixzz
Contact:

Post by Kef » Mon May 29, 2006 1:54 am

inetresting, way cool man!

User avatar
Vidar
Luxer
Posts: 81
Joined: Thu Nov 03, 2005 8:44 pm
Location: Vidi, in Asgard
Contact:

Post by Vidar » Tue May 30, 2006 11:25 am

Will this new feature enable me to start a headless host at home, and then join it at work (using the same reg code)? Cause, that would kick ass.

User avatar
dustin
Lux Creator
Lux Creator
Posts: 10433
Joined: Thu May 15, 2003 2:01 am
Location: Cascadia
Contact:

Post by dustin » Tue May 30, 2006 4:08 pm

Yes Vidar, it will.

known bugs in this beta:
- it will prevent you from joining using your name if you specified that name as the hosts's name (so choose a different host name, not your usual nick, for now)
- the shuffle option doesn't preserve the owner as host
Last edited by dustin on Fri Aug 24, 2007 5:31 pm, edited 1 time in total.

User avatar
killercatfish
Luxer
Posts: 192
Joined: Thu Sep 07, 2006 12:50 pm
Contact:

Post by killercatfish » Sat Aug 25, 2007 12:38 pm

pretty awesome, ill mess with this in a couple days.
especially all day hosting on a laptop, may get the cpu to run a little cooler :D

User avatar
dustin
Lux Creator
Lux Creator
Posts: 10433
Joined: Thu May 15, 2003 2:01 am
Location: Cascadia
Contact:

Post by dustin » Sat Aug 25, 2007 3:08 pm

You should be able to turn off bot-only games by typing /set abortbotgames as the host in the chat. Do it when you only have 1 instance of Lux running. This should work for both normal and headless servers.

I removed a bunch of useless posts from this thread. If you don't know what a headless server is, then this thread is not for you. You can use google to find out what any and all of this stuff means if you're so inclined.

User avatar
killercatfish
Luxer
Posts: 192
Joined: Thu Sep 07, 2006 12:50 pm
Contact:

Post by killercatfish » Sat Aug 25, 2007 4:46 pm

will simply closing the terminal end the game?

User avatar
dustin
Lux Creator
Lux Creator
Posts: 10433
Joined: Thu May 15, 2003 2:01 am
Location: Cascadia
Contact:

Post by dustin » Sat Aug 25, 2007 5:05 pm

Closing the terminal should end the game, however your host would still show up in the tracker for a few minutes. Type /quit into the terminal to cleanly shutdown the server from the tracker.

Anything you type into the terminal is treated like the chat-box. You can use commands like /start, /boot, etc.

User avatar
killercatfish
Luxer
Posts: 192
Joined: Thu Sep 07, 2006 12:50 pm
Contact:

Post by killercatfish » Sat Aug 25, 2007 5:07 pm

Pretty awesome man, im loving this. Should I be able to log into the GUI via my same computer, or when I am using the headless, can i not play in my room GUI style without restarting the room?

but for anyone interested, here is the room up.

Image

User avatar
killercatfish
Luxer
Posts: 192
Joined: Thu Sep 07, 2006 12:50 pm
Contact:

Post by killercatfish » Sat Aug 25, 2007 5:25 pm

I know im probably getting annoying, but i dont have the same host controls when i come into my headless room as myself-- when im guested out as myself in my room and try to restart i get the typical [Only the host can use that command]..is this suppose to happen?

Also, does the /set abortbotgames mean the bots wont play even when humans are in there? and if so is there a way for them to play once there are humans?

Thanks!! (quite excited )
:roll:

User avatar
killercatfish
Luxer
Posts: 192
Joined: Thu Sep 07, 2006 12:50 pm
Contact:

Post by killercatfish » Sat Aug 25, 2007 5:45 pm

do you have a link to more advanced commands?

User avatar
Kef
Lux Translator
Posts: 4471
Joined: Tue Feb 24, 2004 11:23 am
Location: in j0r f0rumz, Tr0||in j0r t0pixzz
Contact:

Post by Kef » Sat Aug 25, 2007 5:58 pm

It should take the settings of the last game you set up with the GUI (the Lux app) if you mean the stuff that ain't indicated by the flags.

Dustin, it will still overwrite my name when I start Lux.app, that's a bit of a pain :(


ps kcf: Image

User avatar
killercatfish
Luxer
Posts: 192
Joined: Thu Sep 07, 2006 12:50 pm
Contact:

Post by killercatfish » Sat Aug 25, 2007 6:15 pm

no it wont, just change the name in the main menu, it will have put your "headless hosting name" in there, just change it--

User avatar
Kef
Lux Translator
Posts: 4471
Joined: Tue Feb 24, 2004 11:23 am
Location: in j0r f0rumz, Tr0||in j0r t0pixzz
Contact:

Post by Kef » Sat Aug 25, 2007 6:27 pm

killercatfish wrote:no it wont, just change the name in the main menu, it will have put your "headless hosting name" in there, just change it--
that's what I meant

User avatar
killercatfish
Luxer
Posts: 192
Joined: Thu Sep 07, 2006 12:50 pm
Contact:

Post by killercatfish » Sat Aug 25, 2007 6:57 pm

Ive been hosting with the room name killercatfish Beta, for a while now. It tried to make my name killercatfish Beta when i opened the GUI, warned me i was gonna muff up my raw, i deleted beta, and ive played in the room with killercatfish and no raw reset.

User avatar
dustin
Lux Creator
Lux Creator
Posts: 10433
Joined: Thu May 15, 2003 2:01 am
Location: Cascadia
Contact:

Post by dustin » Sun Aug 26, 2007 6:18 am

killercatfish wrote:when im guested out as myself in my room and try to restart i get the typical [Only the host can use that command]..is this suppose to happen?

Also, does the /set abortbotgames mean the bots wont play even when humans are in there? and if so is there a way for them to play once there are humans?
1. Try guesting in and maybe you'll have control. This is probably a bug.

2. No, abortbotgames will just make it so no game gets played when there are only bots.

User avatar
killercatfish
Luxer
Posts: 192
Joined: Thu Sep 07, 2006 12:50 pm
Contact:

Post by killercatfish » Mon Aug 27, 2007 10:48 pm

I am in a motel room, i opened their router and am hosting, 6619 is open. Same setting as I always have at home.
I can get into any room, only when i open lux i am refused from my room. This is new any idea?

User avatar
dustin
Lux Creator
Lux Creator
Posts: 10433
Joined: Thu May 15, 2003 2:01 am
Location: Cascadia
Contact:

Post by dustin » Mon Aug 27, 2007 11:57 pm

Are you trying to join with the same name as the server? What error message do you get?

User avatar
killercatfish
Luxer
Posts: 192
Joined: Thu Sep 07, 2006 12:50 pm
Contact:

Post by killercatfish » Tue Aug 28, 2007 9:53 am

just as if i were ban:
[Checking for aliases...]
[Connecting to LuxServer at 216.228.180.197 port 6619...]
[Connection refused]

I am trying to play as Killercatfish as usual.
Very strange, room works fine obviously, and also when i start it with the GUI instead, i am able to play just fine.

Just strange, it probobly would work again when i have my own router up, just in this room for a few days and wondering if you had any ideas.

Thanks.

Post Reply