Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4402 closed defect (fixed)

[PATCH] Empty server name causes a visual error and empty port

Reported by: Vladislav Belov Owned by: Vladislav Belov
Priority: Should Have Milestone: Alpha 22
Component: Core engine Keywords: patch
Cc: Patch:

Description (last modified by Vladislav Belov)

If you set the server name to the empty string, then you will get a visual error:

http://trac.wildfiregames.com/raw-attachment/ticket/4402/lobby_error.png

Also there is no notification, that the server port is invalid, you can set even a string. But the port will be getValidPort(port_string), and if user had a mistake, then he won't know the current port.

Attachments (5)

lobby_error.png (141.0 KB ) - added by Vladislav Belov 7 years ago.
4402_lobby.patch (989 bytes ) - added by Vladislav Belov 7 years ago.
Adds a feedback if the server name or port is incorrect
4402_lists.patch (2.1 KB ) - added by Vladislav Belov 7 years ago.
Fix the problem with empty items of clist/colist
fix_example.jpg (316.2 KB ) - added by elexis 7 years ago.
4402_lobby.2.patch (1.6 KB ) - added by Vladislav Belov 7 years ago.

Download all attachments as: .zip

Change History (20)

by Vladislav Belov, 7 years ago

Attachment: lobby_error.png added

comment:1 by Vladislav Belov, 7 years ago

Description: modified (diff)

comment:2 by Vladislav Belov, 7 years ago

Description: modified (diff)

comment:3 by Vladislav Belov, 7 years ago

The port of a game will be normalized only if the user press enter on this input. Which isn't so obvious for the user.

by Vladislav Belov, 7 years ago

Attachment: 4402_lobby.patch added

Adds a feedback if the server name or port is incorrect

comment:4 by Vladislav Belov, 7 years ago

Keywords: patch rfc added
Milestone: BacklogWork In Progress
Owner: set to Vladislav Belov
Status: newassigned

comment:5 by Vladislav Belov, 7 years ago

Summary: Empty server name causes a visual error and empty port[PATCH] Empty server name causes a visual error and empty port

comment:6 by Vladislav Belov, 7 years ago

I don't think that we should call the getValidPort for each press event, it'd be good to tell to user what's the problem with the port.

by Vladislav Belov, 7 years ago

Attachment: 4402_lists.patch added

Fix the problem with empty items of clist/colist

comment:7 by Vladislav Belov, 7 years ago

The last patch is fix to prevent the same error for other places, the first patch is still relevant, because I don't think that we need empty names and unknown ports.

comment:8 by elexis, 7 years ago

It would be good to merge the 65535 with the other occurance and use something like g_MinPort and g_MaxPort or g_ValidPorts = { "min": 1, "max": 65535 } (to reduce magic numbers and allow changing the range without changing the code).

in reply to:  8 comment:9 by Vladislav Belov, 7 years ago

Replying to elexis:

It would be good to merge the 65535 with the other occurance and use something like g_MinPort and g_MaxPort or g_ValidPorts = { "min": 1, "max": 65535 } (to reduce magic numbers and allow changing the range without changing the code).

Good point, should it be done in the patch above?

comment:10 by Vladislav Belov, 7 years ago

I think we need to add this fix first, and then replace all occurrences. It's easier to review.

comment:11 by elexis, 7 years ago

Priority: Must HaveShould Have

We will get a visual error if the item is empty, so we pass a non-visible char to save the height

Hack alert.

It seems better if we would use the max height of all text elements in all columns.

This way one would have a column with few pixel height only if its empty everywhere and have a bigger height if one of the columns has mulitple lines of text.

by elexis, 7 years ago

Attachment: fix_example.jpg added

comment:12 by elexis, 7 years ago

Component: UI & SimulationCore engine
Keywords: rfc removed
Milestone: Work In ProgressAlpha 22

We agreed to use the space character due to the following requirements: 1) Using a hardcoded min height property would not suit for different font sizes 2) Because content of the cells is clipped, the empty space can never be rendered into a neighboring cell 3) We use the maximum height of all cells, so this case is only needed if all cells have no content. We (as in Vladislav) want to not ignore this case and cover all cases, to prevent the user from confusing this empty line with a separator.

We agreed to improve the comment to // Minimum height of a space character of the current font size to reflect these requirements.

http://trac.wildfiregames.com/raw-attachment/ticket/4402/fix_example.jpg

Thanks for the patch! Those empty gamename games in the lobby were annoying and it indeed should be fixed in the C++ engine (too).

comment:13 by elexis, 7 years ago

Resolution: fixed
Status: assignedclosed

In 19306:

Use a minimum height of at least one space character of the current font size when drawing list rows.
Use the maximum height of all cells of the current row.
Lobby games with empty servernames are not rendered weirdly anymore.

Patch By: Vladislav
Fixes #4402

by Vladislav Belov, 7 years ago

Attachment: 4402_lobby.2.patch added

comment:14 by elexis, 7 years ago

In 19307:

Prevent lobby players from hosting games with empty servernames.
Display a notification instead of using the default port if an invalid one was specified.

Patch By: Vladislav
Refs #4402

comment:15 by elexis, 7 years ago

Strings suggested by scythetwirler, besides that "must"

Note: See TracTickets for help on using tickets.