Commit Graph

1522 Commits (09f7f32b8d85ea378984908b6a29764d8576284e)

Author SHA1 Message Date
Loïc Guilloux a2c8168924
Fix #10465: Delay closing of network join progress window (#10466) 1 year ago
Rubidium 4e65ec1dc4 Codechange: do not declare functions in blocks 1 year ago
rubidium42 6ba55e663e Codechange: do not hide variables with other variables 1 year ago
Rubidium ed7685910d Codechange: pass large objects by reference instead of value
Especially when they get passed on directly to the next function or via a
constructor into an instance variable
1 year ago
Rubidium 7e1d272397 Cleanup: remove unused static variables 1 year ago
Rubidium fe2bcd2a58 Codechange: migrate size related functions to Map structure 1 year ago
Rubidium 8f9a60893d Fix #10177: company list password padlock showed after switching to single player 1 year ago
Rubidium 6dfd2cad69 Fix: comparison result is always the same warnings 1 year ago
Rubidium 90f1768006 Codechange: add non-nullptr asserts in cases where it should never be nullptr
Though where similar calls are checked for nullptr as in those instances of
the use of that function it can actually return nullptr. In other words, write
down the assumption that the function never returns nullptr in an assert.
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
Patric Stout 1fb101eabb
Codechange: address CodeQL issue "Multiplication result converted to larger type" (#10306)
Most are very unlikely to ever be triggered in our codebase; two
stand out: linkgraph and money cheat. Those, potentially, could
wrap earlier than expected.
2 years ago
PeterN 131b7f5127
Fix: Vertically centre chat prompt. (#10250) 2 years ago
dP 5e14a20b3b
Feature: [GS] Scriptable league tables (#10001) 2 years 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 b6ed595176 Codechange: Prefer suggested widget padding. 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
Michael Lutz 35d9cea487
Fix: Too many braces make old gcc sad. (#10116) 2 years ago
frosch f4e2a462fe Cleanup: Remove unused flag sprites. 2 years ago
Peter Nelson dc1b84aa1e Cleanup: Text widgets are capable of drawing text without assistance.
Remove custom text drawing of some widgets in favour of standard text
widgets.
2 years ago
Peter Nelson 296af146fb Change: Default widget text colour to black.
TC_FROMSTRING really means blue, and we almost never actually use
blue text.
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
Rubidium c73f578e8c Codechange: replace magic numbers and C-style arrays with C++-style array for share owners 2 years ago
Michael Lutz b11bd185e3 Fix #9756: Network command unpack proc was not generated in all cases.
The case where the callback proc takes all command results but not any of
the command parameters was not handled properly.
3 years ago
Michael Lutz e67124e174 Change: [Admin] Bump admin port protocol due to command changes.
docs/admin_network.md promised that information in an admin packet
is never removed. It does allow the possibility of using a new packet type
for changed data in combination with a bump of the admin port version.

As the recent command handling changes modified the contents of
ADMIN_PACKET_SERVER_CMD_LOGGING, do exactly that.
3 years ago
Michael Lutz afc3d71fd0 Codechange: Don't generate CommandPacket unpack functions for invalid cmd/callback combinations.
If the arguments of the callback proc don't match with the command parameters,
we can't do the proper command execution anyway. As such, don't even generate
an unpack function in the first place, saving a bit of unnecessary code bloat.

Validate on receive that the cmd/callback combination is supported, rejecting
clients that try to send invalid values.
3 years ago
Michael Lutz 3e85e833a7 Codechange: Add support for additional command result values. 3 years ago
Michael Lutz 8503854655 Codechange: Pass unpacked command arguments to command callbacks (except Script). 3 years ago
Michael Lutz d85348b1d1 Codechange: Template the command callback function type to allow unpacked arguments. 3 years ago
Michael Lutz 13528bfcd0 Codechange: Un-bitstuff all remaining commands. 3 years ago
Michael Lutz 4f3ea3907e Codechange: Un-bitstuff commands taking a ClientID (i.e. CMD_CLIENT_ID). 3 years ago
Michael Lutz ccefa76a46 Codechange: Template DoCommandPInternal. 3 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.
3 years ago
Michael Lutz a05fd7aa50 Change: [Network] Transfer command data as serialized byte stream without fixed structure.
The data will be transmitted as the length followed by the serialized data. This allows the command
data to be different for every command type in the future.
3 years ago
Michael Lutz 123c7f99c3 Codechange: Move command callback declarations to the cmd header files. 3 years ago
Michael Lutz a38bbefe1b Codechange: Untangle command code, flags and error string for DoCommand*. 3 years ago
Michael Lutz 549caca39c Codechange: Move command arguments to the back of the networked command function calls. 3 years ago
Rubidium ad89601c49 Codechange: do not use all upper case enumerators in a scoped enum 3 years ago
Patric Stout ea4f6bb8b2
Fix #9730: [Network] connections can use an invalid socket due to a race condition
A race condition happens when an IPv6 connection takes more than
250ms to report an error, but does return before the IPv4 connection
is established.
In result, an invalid socket might be used for that connection.
3 years ago
Patric Stout 9c36c12c85
Codechange: ensure OnConnect() always gets called with a valid socket (#9729)
This should already be the case, but now assert()s will tell us
if this isn't.
3 years ago
Michael Lutz 8c558d74a5 Fix 55a11710: Curly braces need to be double-escaped for (std::)fmt. 3 years ago
dP 80e3397f85
Fix 3a1a915: Every 16th client never reconnects after server restart 3 years ago