Author Topic: Using the dedicated server console via STDin  (Read 3911 times)

First, I did not know which section of the forums to put this topic in, since it's a little programming-y.

I was wondering if it is possible to start a Blockland dedi-server, then be able to print text to the console by using the STDin input stream. I made a quick program in Java to test this, but when I sent echo("Testing..."); to the STDin stream, nothing happened. When I tried putting a '%' sign in front of my command, it still did not work.

So I suspect that it's impossible to use the STDin instead of a console window. Is that correct?

it's been theorized that torque uses magical custom keyboard inputs for console input

it does not read from stdin.

Create a TCPObject which listens for connections locally and evals lines, connect to it from some external process and write to it.

Create a TCPObject which listens for connections locally and evals lines, connect to it from some external process and write to it.
What if the dedicated server needs activation, and prints "Input key via setKey("XXXXX-XXXX-XXXX-XXXX"), Don't screw up"? That's my problem.

Write an appropriate key.dat file, then start the server.

What if the dedicated server needs activation, and prints "Input key via setKey("XXXXX-XXXX-XXXX-XXXX"), Don't screw up"? That's my problem.

I'm working on a headless Linux server and I've run into the same problem.

I'm working on a headless Linux server and I've run into the same problem.
Write an appropriate key.dat file, then start the server.



The server has no GUI at all. I can't just make a key file out of nothing.

The server has no GUI at all. I can't just make a key file out of nothing.
You can use the same algorithm blockland uses, no? But not in torkscript, obviously

I'm working on a headless Linux server and I've run into the same problem.
Yeah I'm currently writing something that will write a key.dat, what language are you using?

Yeah I'm currently writing something that will write a key.dat, what language are you using?

I don't have a wrapper or anything, just bash scripts to launch the server.

Last I checked you can eval setKey()
that was a while ago though. did badspot prevent that or something?

Last I checked you can eval setKey()
that was a while ago though. did badspot prevent that or something?
No, though the server has to actually be activated before that.
What kalphiter did is he copied his key.dat around to each server then asked each client to setKey()

That's the problem, though. The server has no GUI and I access it via SSL. I can view the console using a combination of Wine and Screen but input doesn't work.

(click for full size)


Here's my bash scripts:

Code: (init.sh) [Select]
#!/bin/bash

echo \-\-\-INITIALIZING BLOCKLAND DEDICATED SERVER\-\-\-
screen -dmS blockland0 -L ./launch.sh

Code: (launch.sh) [Select]
#!/bin/bash

echo \-\-\-LAUNCHING BLOCKLAND DEDICATED SERVER\-\-\-

GAMEMODE="whatever"

#It seems like I can actually start the server without using Xvfb
#Wine just whines about the GUI being missing

#export DISPLAY=:1
#Xvfb :1 -screen 1 1024x768x24 &
#x11vnc &

wineconsole server0/Blockland.exe ptlaaxobimwroe -dedicated -gamemode $GAMEMODE | tee test.txt

EDIT: After further testing you don't need to use the hacky replace-default-file-to-set-key thing. Just type setKey("yourkey"); into this console. Somehow I must have had a typo the first time I tried it.
« Last Edit: February 25, 2014, 10:52:48 PM by Greek2me »

The only concern I have for releasing a script that allows people to automatically generate key.dat files is that once I release this it'd take moments to create a script that allows people to steal keys coughhammereditorcough. Badspot should either make an official exe to do this, because I'd feel uncomfortable doing so myself.