Commit Graph

482 Commits (1ba4dcc92458b078dc869d381075b6c071221950)

Author SHA1 Message Date
Patric Stout 1ba4dcc924 Codechange: migrate all Window-related timers to the new framework
This means we also say goodbye to GUITimers.
1 year ago
Peter Nelson e5af5907ec Change: Make all dropdown lists extend width if necessary.
This removes the auto_width parameter from ShowDropDown(At).
1 year ago
Peter Nelson b6609d1833 Fix: Network server highlight invisible with RTL layout. 1 year ago
Zachary e17c82e32b Add: maximum number of companies allowed to the client list 1 year ago
Rubidium bcfe0fb076 Codechange: introduce GetMainWindow() to properly account for nullptr checks
Some nullptr checks have been removed as they were not triggered with nullptr
with the null video driver and in dedicated server mode.
1 year ago
Peter Nelson ecb5393c55 Change: Standardize progress bar layout.
Progress bars are drawn differently depending on when it was added, with
different layouts and sizes.

This change adds a standard padding size to use, and makes all progress
bars visually similar, with scaled padding.
2 years ago
Peter Nelson 920e588334 Change: Use standard dimensions instead of custom widths. 2 years ago
Peter Nelson 890b2666d3 Change: Use scaled WidgetDimensions. 2 years ago
Peter Nelson dd9f6bc803 Change: Use RectPadding Horizontal()/Vertical() helpers. 2 years ago
Peter Nelson 04cbe57d2a Change: Use RectPadding for widget padding/uz_padding. 2 years ago
Peter Nelson 6f95e04005 Change: Use Rect helpers for widget drawing.
This replaces repetitive and sometimes unwieldy use of constants.
2 years ago
Rubidium d5aafaee15 Codechange: rename and move some strings to make them more consistent with the rest of the strings 2 years ago
frosch f4e2a462fe Cleanup: Remove unused flag sprites. 2 years ago
Peter Nelson fa5e2ca276 Cleanup: Tweak panel layout of Online Players window.
This ensures panel borders not hidden behind other widgets.
2 years ago
Peter Nelson 8e9ca5ebcb Fix: Online Players list mouse hover behaviour.
Hover highlight was visible even if the mouse pointer was in a different
window, and the window refreshed itself every frame if the mouse pointer
was not over its matrix widget.

Resolved by using OnMouseOver() instead of OnMouseLoop(), and only
redrawing if the hover position has changed.
2 years ago
dP 64453cb134
Fix: Incorrect player name in online players window (#10013) 2 years ago
Joel-Milligan 3937953f72
Fix #9363: Rebuild client list on reinit event (#9929) 2 years ago
Aaron Katzin 148695c571
Fix #9736: Duplicate multiplayer window opens upon canceling password entry (#9842) 2 years ago
Michael Lutz d85348b1d1 Codechange: Template the command callback function type to allow unpacked arguments. 2 years ago
Michael Lutz 4f3ea3907e Codechange: Un-bitstuff commands taking a ClientID (i.e. CMD_CLIENT_ID). 2 years ago
Michael Lutz ccefa76a46 Codechange: Template DoCommandPInternal. 2 years ago
Michael Lutz 0f64ee5ce1 Codechange: Template DoCommandP to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
2 years ago
Michael Lutz a38bbefe1b Codechange: Untangle command code, flags and error string for DoCommand*. 2 years ago
Michael Lutz 549caca39c Codechange: Move command arguments to the back of the networked command function calls. 2 years ago
Charles Pigott 3b7daca832
Change: Don't use 'server address' string in server list when displaying an invite code (#9615) 3 years ago
Patric Stout e4ad632989
Add: [Network] Keep the refresh button in lowered state while refreshing (#9600)
This gives user visual feedback that the refresh is still pending, and
prevents people from clicking again and again thinking nothing is
happening. This is especially true for connections that fall back to
TURN, as that takes a few seconds to kick in.

Additionally, prevent clicking on the button again while a refresh
is pending. This is only delaying a successful result.
3 years ago
Patric Stout dc5b7b996c
Fix: [Network] show query errors in the server listing instead of error popup (#9506)
When you are query several servers at once, it is rather unclear
for which server you got a popup. Instead, show any errors on the
server itself.

This is only true for the query-part. Joining a server still gives
an error popup to tell you about any issue.
3 years ago
Patric Stout 4066a07d8f
Fix: [Network] crash when last-joined server that is no longer available (#9503)
If you update the server-list while not having last-joined selected
and it is no longer available, the game crashed.
3 years ago
Patric Stout c4b700f1b0
Fix #9492: show for what server a relay session is being created (#9494)
Currently it says "the server" which is a bit ambigious. Be more
specific.
3 years ago
Patric Stout 5da60cef46
Fix: typo in the word "spectator" (tnx Heiki) (#9496) 3 years ago
Patric Stout 579f393374
Add: open Online Players GUI on starting/joining a server (#9479) 3 years ago
Patric Stout 3d55ea2d4d
Feature: make "join game" button join the game, instead of first showing a lobby window (#9467)
Nobody really paid attention to the lobby window, and it completely
missed its purpose. Most people don't even wait for companies to
show up, but just hit "New Company".
This in turn means people create a lot of unneeded companies, while
they "just want to watch the game" or join another company.

Instead, "Join Game" now just joins the game as spectators.
3 years ago
Patric Stout db13eebf29
Fix 508e465b: network servers didn't show invite-code / connection-type in Online Players GUI (#9478)
The selector selects the first widget, which by accident was now only
the server visibility.
3 years ago
Patric Stout 508e465b59
Add: synchronize server name to clients and display in Online Players GUI (#9472) 3 years ago
Patric Stout 4c1ea4020d
Change: remove the ability to control "max spectators" (#9466)
Soon we will make "join game" join the game as spectator first,
so limiting the amount of spectators makes no sense anymore in
that context. Not sure it ever did make sense.
3 years ago
Rubidium ba29edb0b3 Cleanup: remove some references to the old master-server 3 years ago
Patric Stout fa1e27994d Feature: allow the use of TURN to connect client and server together
TURN is a last resort, used only if all other methods failed.
TURN is a relay approach to connect client and server together, where
openttd.org (by default) is the middleman.

It is very unlikely either the client or server cannot connect to
the STUN server, as they are both already connected to the Game
Coordinator. But in the odd case it does fail, estabilishing the
connection fails without any further possibility to recover.
3 years ago
Patric Stout c921f6d817
Add: inform clients what game-script a server is running (#9441)
Co-authored-by: The Dude <thedude@novapolis.net>
3 years ago
Patric Stout b6a116a247
Add: allow setting your server visibility to "invite-only" (#9434)
In this mode you do register to the Game Coordinator, but your
server will not show up in the public server listing. You can give
your friends the invite code of the server with which they can
join.
3 years ago
Patric Stout e4d216e44b Feature: join servers based on their invite code
This removes the need to know a server IP to join it. Invite codes
are small (~7 characters) indentifiers for servers, which can be
exchanged with other players to join the servers.
3 years ago
Patric Stout aa93d76223 Add: use Game Coordinator to get latest public server listing 3 years ago
Patric Stout b1280fd17e Add: use Game Coordinator to annouce public servers 3 years ago
TELK f9b4a3a5e6
Add: Show the number of clients and companies in the online players window (#9376) 3 years ago
rubidium42 cdf9caf8ea Codechange: [Network] Remove overload on NetworkValidateClientName
Rename the zero-parameter NetworkValidateClientName to NetworkValidateOurClientName to make it clearer it is performed on our client name, and to make it a non-overloaded function to aid with the variant being added a few commits later
3 years ago
SamuXarick d0bcb9839a
Fix: you could join an AI company in multiplayer via the GUI (#9369) 3 years ago
TELK 2d0abf5a76
Fix #9362: Hover in online players window was slightly too big (#9364)
This causes graphical glitches at the bottom of the window.
3 years ago
rubidium42 fd95736bac Codechange: [Network] Use std::string for server side logic of kicking and banning clients 3 years ago
glx22 5799402f7a Codechange: Rename window related DeleteXXX to match new behaviour 3 years ago
glx22 994bf19aef Fix f6d5c01: Delay deletion when closing windows 3 years ago
rubidium42 ef991b1772 Codechange: [Network] Use std::string in CommandPacket 3 years ago