OpenTTD

Tasklist

FS#5799 - When i connect server/company. can use default password?

Attached to Project: OpenTTD
Opened by LuHa (munhyunsu) - Wednesday, 06 November 2013, 09:05 GMT
Last edited by andythenorth (andythenorth) - Saturday, 02 September 2017, 12:26 GMT
Type Feature Request
Category Interface
Status With patch
Assigned To LuHa (munhyunsu)
Operating System All
Severity Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

we connect server, company in multiplayer game.

if that's protected (password) password dialog is up.
then we type password and press ok.


in openttd.cfg. there's 'default_company_pass' and 'server_password'

it can use when we connect server/company. (use default password).
This task depends upon

Comment by LuHa (munhyunsu) - Wednesday, 06 November 2013, 09:12 GMT
I coding it
Comment by Ingo von Borstel (planetmaker) - Wednesday, 06 November 2013, 12:02 GMT
The idea is good. The patch can be improved, though:

NetworkNeedCompanyPasswordWindow, NetworkNeedGamePasswordWindow and NetworkNeedMovePasswordWindow are nearly identical in everything. They could and probably should be unified into one by means of a parameter.
The newly-introduced functions need to get doxygen comments as well. All of them :-)

Mind the coding style. You add or remove in a lot of places whitespace:
* Use tabs only for indentation
* Align stuff only with spaces
* Don't add trailing white spaces anywhere
* Don't add or remove lines or insert or remove spaces without reason. If there's reason, better do that in a separate patch.

See http://wiki.openttd.org/Coding_style Ignoring whitespace changes would cut the amount of changed lines into half size and remove a number of hunks.
Comment by LuHa (munhyunsu) - Tuesday, 12 November 2013, 02:05 GMT
oh, sorry. i read your comment lately.

Ok, i got it. i will modify & add doxygen comments.
and re-upload.

thank you for interest.
Comment by LuHa (munhyunsu) - Wednesday, 13 November 2013, 02:19 GMT
@Ingo von Borstel (planetmaker)
Hello, I have some question.

NetworkNeed[Game/Company/Move]PasswordWindow looks similar. but it's GUI text is different.
ex) Query Window Label.
NWidget(WWT_TEXT, COLOUR_GREY, WID_NNP_LABEL), SetDataTip(STR_NETWORK_NEED_GAME_PASSWORD, STR_NULL) -->> Server Password
NWidget(WWT_TEXT, COLOUR_GREY, WID_NNP_LABEL), SetDataTip(STR_NETWORK_NEED_COMPANY_PASSWORD, STR_NULL) -->> Company Password

so, how can i unified into one?
i think use 'Parameter' for functionally switch.
and use 'Global variable' for GUI Text.
but i hesitant to use global variable.

i need some idea. :D
Comment by LuHa (munhyunsu) - Wednesday, 13 November 2013, 04:42 GMT
@Ingo von Borstel (planetmaker)
Hello, I have some question.

NetworkNeed[Game/Company/Move]PasswordWindow looks similar. but it's GUI text is different.
ex) Query Window Label.
NWidget(WWT_TEXT, COLOUR_GREY, WID_NNP_LABEL), SetDataTip(STR_NETWORK_NEED_GAME_PASSWORD, STR_NULL) -->> Server Password
NWidget(WWT_TEXT, COLOUR_GREY, WID_NNP_LABEL), SetDataTip(STR_NETWORK_NEED_COMPANY_PASSWORD, STR_NULL) -->> Company Password

so, how can i unified into one?
i think use 'Parameter' for functionally switch.
and use 'Global variable' for GUI Text.
but i hesitant to use global variable.

i need some idea. :D
Comment by LuHa (munhyunsu) - Monday, 18 November 2013, 03:14 GMT
I complete coding thanks to planetmaker :D

three widget is unified one.
and also unified password set window.

result this.
Comment by LuHa (munhyunsu) - Tuesday, 19 November 2013, 05:28 GMT
I modify GUI

Loading...