Commit Graph

2046 Commits

Author SHA1 Message Date
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.
2021-12-20 19:30:27 +01:00
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.
2021-12-16 22:28:32 +01:00
Michael Lutz 3e85e833a7 Codechange: Add support for additional command result values. 2021-12-16 22:28:32 +01:00
Michael Lutz 8503854655 Codechange: Pass unpacked command arguments to command callbacks (except Script). 2021-12-16 22:28:32 +01:00
Michael Lutz d85348b1d1 Codechange: Template the command callback function type to allow unpacked arguments. 2021-12-16 22:28:32 +01:00
Michael Lutz 13528bfcd0 Codechange: Un-bitstuff all remaining commands. 2021-12-16 22:28:32 +01:00
Michael Lutz 4f3ea3907e Codechange: Un-bitstuff commands taking a ClientID (i.e. CMD_CLIENT_ID). 2021-12-16 22:28:32 +01:00
Michael Lutz ccefa76a46 Codechange: Template DoCommandPInternal. 2021-12-16 22:28:32 +01:00
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.
2021-12-16 22:28:32 +01:00
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.
2021-12-16 22:28:32 +01:00
Michael Lutz 123c7f99c3 Codechange: Move command callback declarations to the cmd header files. 2021-12-16 22:28:32 +01:00
Michael Lutz a38bbefe1b Codechange: Untangle command code, flags and error string for DoCommand*. 2021-12-16 22:28:32 +01:00
Michael Lutz 549caca39c Codechange: Move command arguments to the back of the networked command function calls. 2021-12-16 22:28:32 +01:00
Rubidium ad89601c49 Codechange: do not use all upper case enumerators in a scoped enum 2021-12-05 21:41:43 +01:00
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.
2021-12-04 20:56:05 +01:00
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.
2021-12-04 18:32:06 +01:00
dP 760b4a16a6 Merge remote-tracking branch 'upstream/master' 2021-11-08 23:47:49 +03:00
dP 20a6ffee07 Merge branch 'openttd' 2021-11-08 23:42:35 +03:00
dP 76f735ed58 Update to 12.1 2021-11-08 23:42:22 +03:00
dP 3ec7adc30c Show new company icons with locks for passworded companies in players list 2021-11-08 22:32:32 +03:00
dP 8da4a0da51 Return default server list sorting by availability 2021-11-08 21:15:26 +03:00
dP 519f8a9bb1 Fix tooltips for new client list buttons 2021-11-07 02:41:06 +03:00
Michael Lutz 8c558d74a5 Fix 55a11710: Curly braces need to be double-escaped for (std::)fmt. 2021-11-06 20:21:07 +01:00
dP b5aa96696f Add button to watch companies to online players window 2021-11-05 06:20:20 +03:00
dP 632e1e21dc Add 2x zoom for client list overlay icons 2021-11-05 02:48:01 +03:00
dP 80e3397f85 Fix 3a1a915: Every 16th client never reconnects after server restart 2021-11-03 21:33:38 +01:00
dP 8037167cc9 Show company window when clicked in online players (show finances with Fn) 2021-11-02 00:38:09 +03:00
dP 60548b2dff Fix margin between company icon and company name in scaled UI 2021-11-01 22:26:47 +03:00
dP da961a45b3 Change host and player icons in the online players window 2021-11-01 20:07:17 +03:00
dP b8b2df1f2c Write cmclient-*.grf directly from python instead of using nml inbetween 2021-11-01 19:10:08 +03:00
dP 3bef49da29 Fix #11: Queue outgoing commands and don't send more than 2 per frame 2021-10-29 02:55:07 +03:00
glx22 1c0700e0c0 Fix #9624: compilation with RANDOM_DEBUG 2021-10-19 09:05:00 +01:00
Charles Pigott 3b7daca832 Change: Don't use 'server address' string in server list when displaying an invite code (#9615) 2021-10-17 18:14:25 +01:00
dP 3830196cb3 Remove TeamGame server filter button for harassing game contributors 2021-10-17 17:08:20 +03:00
dP f72089758d Merge remote-tracking branch 'upstream/master' 2021-10-17 13:04:30 +03:00
dP 350b604b48 Merge branch 'openttd' 2021-10-17 13:01:51 +03:00
dP ccd5309c09 Update to 12.0 2021-10-17 13:01:41 +03:00
dP c9e1b3eff1 Added server filter button for TeamGame 2021-10-10 00:41:08 +03:00
dP 2ea12b9a72 Automatically search internet when opening multiplayer window 2021-10-10 00:31:28 +03:00
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.
2021-10-03 11:02:28 +02:00
dP 2c5f48943c Add client list overlay (toggleable) 2021-09-29 22:55:14 +03:00
dP 239ff976da Merge remote-tracking branch 'upstream/master' 2021-09-27 19:53:01 +03:00
dP 407b10e090 Merge branch 'openttd' 2021-09-26 20:30:27 +03:00
dP 4eb8b29dbf Update to 12.0-RC1 2021-09-26 20:30:12 +03:00
dP 31cf9e888b Add: [Network] external chat messages for remote admins (#9563) 2021-09-19 23:09:06 +02:00
Patric Stout d9f8ed7bdf Add: [Network] On join, log the ClientID + IP + Name clearly (#9558)
Additionally, reword the disconnect to match connect / join messages.

Co-authored-by: Berbe <4251220+Berbe@users.noreply.github.com>
2021-09-19 21:52:46 +01:00
Patric Stout a8641ea44a Add: support filtering content entries for patchpacks (#9541)
This changes nothing for us, but allows patchpacks to add the
right pieces of code to start filtering content entries on patchpack
only entries.
2021-09-11 15:34:46 +02:00
Jonathan G Rennison 6e3d023e69 Fix #9535: Maintain a reverse dependency map of network content (#9538)
Fixes performance issues with dependency lookup when retrieving
content list from the content server.
2021-09-09 18:06:00 +02:00
Patric Stout f656b0ae96 Fix: use-after-free after ClientNetworkCoordinatorSocketHandler::CloseAllConnections() (#9534)
The function clears all stun-handlers. This causes all of those
objects to be destroyed.
A handler can have a pending connecter, which was only killed in
case CloseConnection() was called. This is never the case when
the object is destroyed. In result, the connecter could finish
and cause a use-after-free by calling into the (now deleted)
handler.
2021-09-05 18:17:39 +02:00
Rubidium 92559e6f3a Fix #9388: thread unsafe use of NetworkAdminConsole/IConsolePrint 2021-09-01 22:40:44 +02:00