Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for new commandline parameter: 'name for headless server' #95

Closed
filux opened this issue Dec 19, 2015 · 7 comments
Closed

Request for new commandline parameter: 'name for headless server' #95

filux opened this issue Dec 19, 2015 · 7 comments

Comments

@filux
Copy link
Contributor

filux commented Dec 19, 2015

Such parameter e.g. like:

--headless-server-name=x

which is taken into account when also --headless-server-mode is used could be quite useful at least in two cases:

  • when you want easily start more than one headless based on the same data/files and set for each one unique name,
  • when you want easily use different name for your headless than your nick as a player.
@tomreyn
Copy link
Member

tomreyn commented Dec 21, 2015

I would appreciate it, too (and had previously suggested it on the forums). Currently the player name option is taken into account when setting the server title. I think it would be much nicer to allow for setting a server title, which, if set, would overrule the current mechanism. Or which would replace it entirely, defaulting to something like "Untitled server".

In my opinion this should also be configurable in glest(user).ini, overridden by the command line option. Availability of he command line option should not be limited to headless servers, but also work when you host a game using the GUI client and take part in it. So in my opinion a better option title would be

--server-title

In addition to changes to the game code, this change would also require modification of the masterserver code, the DB schema and the 'protocol' the game uses to communicate with the masterserver. We would need to add a "serverTitle" value. I would think 25 single byte characters should be sufficient.

It would be nice to add "serverAdminName" and "serverAdminEmail" fields of the same size.

To tell apart headless and non-headless servers, a separate single byte field "serverType" should be added, which can take the values of 0 (default, non headless) and 1 (headless). This would allow to display servers differently on the games' server list as well as on the masterserver's web UI.

@tomreyn tomreyn removed the minor bug label Dec 21, 2015
@filux
Copy link
Contributor Author

filux commented Dec 21, 2015

In my opinion this should also be configurable in glest(user).ini

just as note, ^ This does not help in case multiple headlesses based on same data with unique names so even if in the .ini (for single headless) then we still need command line too.

but also work when you host a game using the GUI client and take part in it. So in my opinion a better option title would be --server-title

so you are a host/admin player and you are visible as a player, where do you want to see server title in this case, just somewhere on/in site/database?

@tomreyn
Copy link
Member

tomreyn commented Dec 21, 2015

Hope you did not mind me removing the "minor bug" association, this very much seems to be an enhancement to me, not a bug.

Ad (1):
I agree, and I suggested adding both INI setting and command line option.
With multiple headless servers, you can already have different settings per process (using the same binaries) by using --ini-path (but of course this is not nearly as convenient as having a separate command line option for these settings).

Ad (2):
On the masterserver website and on the server list displayed by the game. However, printing it on the (per) game lobby screen would be good (and probably easily done), too.

@filux
Copy link
Contributor Author

filux commented Dec 21, 2015

:)

Ad (1):
Isn't so easy. As you can see recently we have MG-Team-1, MG-Team-2, ...
I did that and it is so dirty/hacky way that for sure it is not a good idea to document "how to do this", and for sure if you will have to explain some details for someone with low linux experience and/or with some language barrier between you then you will fail :D.

Ad (2):
Hehe but now in the lobby we see something like Titi's game which seems to be very good description for me besides the fact game doesn't know the rule s' and by this we have e.g. Mantas's game, so you should probably expand this idea, some examples etc. :)

titiger added a commit that referenced this issue Jan 3, 2016
@titiger
Copy link
Member

titiger commented Jan 3, 2016

I added --server-title which is used instead of playernames generic game name now. I kept the "titi controls" servername once there is an active controller.

Please test, so we can close this issue.

@filux
Copy link
Contributor Author

filux commented Jan 4, 2016

Test on the same files as headless dev works we get this error:

megatest@initiate:~/megaglest/game$ ./start_megaglest --headless-server-mode=vps,exit --use-ports=63012,63012,63011 --server-title=MegaTest2 2> test.log
Disabled reading from console [vps]
Forcing quit after game has completed [exit]
Forcing serverTitle[MegaTest2]
megaglest v3.12-dev
Compiled using: GNUC: 40804 [64bit] platform: Linux-X64 endianness: little
GIT: [Rev: 5357.44f851c] - using STREFLOP [SSE] - [no-denormals]
Forcing internal port# 63012, external port# 63012
Forcing status port# 63011
Language file NOT FOUND, can't open file: [/data/lang/english.lng] switching to default language: english
Error saved to logfile [/home/megatest/.megaglest/error.log]
*ERROR* [2016-01-04 08:46:32] In [/home/jenkins/build/workspace/megaglest-source_l64/source/glest_game/main/main.cpp::handleRuntimeError Line: 641] [File NOT FOUND, can't open file: [/data/lang/english.lng]
Stack Trace:
/home/megatest/megaglest/game/megaglest:Shared::Platform::megaglest_runtime_error::megaglest_runtime_error(std::string const&, bool)address [0xb2552d] line: 346
/home/megatest/megaglest/game/megaglest:Shared::Util::Properties::load(std::string const&, bool)address [0xaf6716] line: 77
/home/megatest/megaglest/game/megaglest:Glest::Game::Lang::loadGameStringProperties(std::string, Shared::Util::Properties&, bool, bool)address [0x619296] line: 200
/home/megatest/megaglest/game/megaglest:Glest::Game::Lang::loadGameStrings(std::string, bool, bool)address [0x61ccf4] line: 66
/home/megatest/megaglest/game/megaglest:Glest::Game::glestMain(int, char**)address [0x6e0b9c] line: 4957
/home/megatest/megaglest/game/megaglest:Glest::Game::glestMainSEHWrapper(int, char**)address [0x6e7546] line: 5860
/lib/x86_64-linux-gnu/libc.so.6:__libc_start_main()address [0x7f7c5976cec5] line: 0
/home/megatest/megaglest/game/megaglest() [0x4f018a]address [0x4f018a]
] gameInitialized = 0, program = (nil)

-------------------------------------------------------------------------------------------------------------------------------
megatest@initiate:~/megaglest/game$ cat test.log 

******************************************************
    #2 An error occurred and MegaGlest will close.
Error msg = [File NOT FOUND, can't open file: [/data/lang/english.lng]
Stack Trace:
/home/megatest/megaglest/game/megaglest:Shared::Platform::megaglest_runtime_error::megaglest_runtime_error(std::string const&, bool)address [0xb2552d] line: 346
/home/megatest/megaglest/game/megaglest:Shared::Util::Properties::load(std::string const&, bool)address [0xaf6716] line: 77
/home/megatest/megaglest/game/megaglest:Glest::Game::Lang::loadGameStringProperties(std::string, Shared::Util::Properties&, bool, bool)address [0x619296] line: 200
/home/megatest/megaglest/game/megaglest:Glest::Game::Lang::loadGameStrings(std::string, bool, bool)address [0x61ccf4] line: 66
/home/megatest/megaglest/game/megaglest:Glest::Game::glestMain(int, char**)address [0x6e0b9c] line: 4957
/home/megatest/megaglest/game/megaglest:Glest::Game::glestMainSEHWrapper(int, char**)address [0x6e7546] line: 5860
/lib/x86_64-linux-gnu/libc.so.6:__libc_start_main()address [0x7f7c5976cec5] line: 0
/home/megatest/megaglest/game/megaglest() [0x4f018a]address [0x4f018a]
]

Please report this bug to  http://bugs.megaglest.org
******************************************************

Aborted (core dumped)

without --server-title= for comparison

megatest@initiate:~/megaglest/game$ ./start_megaglest --headless-server-mode=vps,exit --use-ports=63012,63012,63011 2> test.log
Disabled reading from console [vps]
Forcing quit after game has completed [exit]
megaglest v3.12-dev
Compiled using: GNUC: 40804 [64bit] platform: Linux-X64 endianness: little
GIT: [Rev: 5357.44f851c] - using STREFLOP [SSE] - [no-denormals]
Forcing internal port# 63012, external port# 63012
Forcing status port# 63011
Waiting for players to join and start a game...
Headless server is now running...
To shutdown type: quit
All commands require you to press ENTER
** #2 Socket peek error for sock = -1 err = -1 lastSocketError = 104 mustGetData = 0
...
-------------------------------------------------------------------------------------------------------------------------------
megatest@initiate:~/megaglest/game$ cat test.log 

softcoder added a commit that referenced this issue Jan 6, 2016
@filux filux added the wontfix label Jan 7, 2016
@filux
Copy link
Contributor Author

filux commented Jan 7, 2016

on 5369 1767838 error fixed and --server-title seems to be successfully implemented,
more extended implementations in the .ini etc left for the future

@filux filux closed this as completed Jan 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants