mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-23 02:41:58 -05:00
fix #2650: validate game commands sent from clients in multiplayer
This commit is contained in:
parent
f767f947d1
commit
e4c6c79552
3 changed files with 7 additions and 3 deletions
|
@ -9,6 +9,7 @@
|
|||
- Feature: Integrate RCT1 style scenario select with optional unlock progression.
|
||||
- Fix: [#2126] Ferris Wheels set to "backward rotation" stop working (original bug)
|
||||
- Fix: [#2449] Turning off Day/Night Circle while it is night doesn't reset back to day
|
||||
- Fix: [#2650] Server did not validate actions send from clients (caused error box and desynchronisation)
|
||||
|
||||
0.0.3.1-beta (2015-12-04)
|
||||
------------------------------------------------------------------------
|
||||
|
|
|
@ -543,7 +543,7 @@ int game_do_command_p(int command, int *eax, int *ebx, int *ecx, int *edx, int *
|
|||
RCT2_GLOBAL(0x009A8C28, uint8)--;
|
||||
|
||||
// Show error window
|
||||
if (RCT2_GLOBAL(0x009A8C28, uint8) == 0 && (flags & GAME_COMMAND_FLAG_APPLY) && RCT2_GLOBAL(0x0141F568, uint8) == RCT2_GLOBAL(0x013CA740, uint8) && !(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED))
|
||||
if (RCT2_GLOBAL(0x009A8C28, uint8) == 0 && (flags & GAME_COMMAND_FLAG_APPLY) && RCT2_GLOBAL(0x0141F568, uint8) == RCT2_GLOBAL(0x013CA740, uint8) && !(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && !(flags & GAME_COMMAND_FLAG_NETWORKED))
|
||||
window_error_open(RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TITLE, uint16), RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, uint16));
|
||||
|
||||
return MONEY32_UNDEFINED;
|
||||
|
|
|
@ -1415,8 +1415,11 @@ int Network::Server_Handle_GAMECMD(NetworkConnection& connection, NetworkPacket&
|
|||
if (commandCommand != GAME_COMMAND_TOGGLE_PAUSE &&
|
||||
commandCommand != GAME_COMMAND_LOAD_OR_QUIT
|
||||
) {
|
||||
// Run game command, and if it is successful send to clients
|
||||
money32 cost = game_do_command(args[0], args[1] | GAME_COMMAND_FLAG_NETWORKED, args[2], args[3], args[4], args[5], args[6]);
|
||||
if (cost != MONEY32_UNDEFINED) {
|
||||
Server_Send_GAMECMD(args[0], args[1], args[2], args[3], args[4], args[5], args[6], playerid, callback);
|
||||
game_do_command(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
|
Loading…
Reference in a new issue