author | KUDr |
Fri, 20 Apr 2007 19:43:06 +0000 | |
changeset 6513 | 454347ca3dfb |
parent 6491 | 00dc414c909d |
child 6546 | 4c6d90bde803 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
6123
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
3 |
/** @file command.cpp */ |
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
4 |
|
0 | 5 |
#include "stdafx.h" |
1891
862800791170
(svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.
Darkvater
parents:
1877
diff
changeset
|
6 |
#include "openttd.h" |
507
04b5403aaf6b
(svn r815) Include strings.h only in the files which need it.
tron
parents:
467
diff
changeset
|
7 |
#include "table/strings.h" |
2163
b17b313113a0
(svn r2673) Include functions.h directly, not globally via openttd.h
tron
parents:
2159
diff
changeset
|
8 |
#include "functions.h" |
6453
226bcddeba32
(svn r9609) -Codechange: Move some function prototypes out of functions.h and into landscape.h, and add a few where they didn't exist.
maedhros
parents:
6444
diff
changeset
|
9 |
#include "landscape.h" |
679
04ca2cd69420
(svn r1117) Move map arrays and some related macros into their own files map.c and map.h
tron
parents:
652
diff
changeset
|
10 |
#include "map.h" |
0 | 11 |
#include "gui.h" |
12 |
#include "command.h" |
|
13 |
#include "player.h" |
|
5469
7edfc643abbc
(svn r7751) -Codechange: move network_* to a new network map. Furthermore move the low level network functions to network/core, so they can be reused by the masterserver and website-serverlist-updater.
rubidium
parents:
5067
diff
changeset
|
14 |
#include "network/network.h" |
2159
f6284cf5fab0
(svn r2669) Shuffle some more stuff around to reduce dependencies
tron
parents:
1980
diff
changeset
|
15 |
#include "variables.h" |
4300
c7e43c47a2b9
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents:
4000
diff
changeset
|
16 |
#include "genworld.h" |
0 | 17 |
|
1820
d03c56850dc2
(svn r2324) Introduce _cmd_text for passing strings with a command instead of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes.
tron
parents:
1804
diff
changeset
|
18 |
const char* _cmd_text = NULL; |
d03c56850dc2
(svn r2324) Introduce _cmd_text for passing strings with a command instead of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes.
tron
parents:
1804
diff
changeset
|
19 |
|
3491
35d747bb5e82
(svn r4342) Change the first two parameters of commands - virtual pixel coordinates of the tile to operate on - to a TileIndex
tron
parents:
3421
diff
changeset
|
20 |
#define DEF_COMMAND(yyyy) int32 yyyy(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) |
0 | 21 |
|
22 |
DEF_COMMAND(CmdBuildRailroadTrack); |
|
23 |
DEF_COMMAND(CmdRemoveRailroadTrack); |
|
24 |
DEF_COMMAND(CmdBuildSingleRail); |
|
25 |
DEF_COMMAND(CmdRemoveSingleRail); |
|
26 |
||
27 |
DEF_COMMAND(CmdLandscapeClear); |
|
28 |
||
29 |
DEF_COMMAND(CmdBuildBridge); |
|
30 |
||
31 |
DEF_COMMAND(CmdBuildRailroadStation); |
|
32 |
DEF_COMMAND(CmdRemoveFromRailroadStation); |
|
33 |
DEF_COMMAND(CmdConvertRail); |
|
34 |
||
1227
1d940a5e02d2
(svn r1731) - Fix: [ 1106930 ] BugFix: placing signals with 2x1 drags workaround is completely rewritten. Also features checks for hacked/modified clients. Thanks a lot Hackykid!
darkvater
parents:
1217
diff
changeset
|
35 |
DEF_COMMAND(CmdBuildSingleSignal); |
1d940a5e02d2
(svn r1731) - Fix: [ 1106930 ] BugFix: placing signals with 2x1 drags workaround is completely rewritten. Also features checks for hacked/modified clients. Thanks a lot Hackykid!
darkvater
parents:
1217
diff
changeset
|
36 |
DEF_COMMAND(CmdRemoveSingleSignal); |
0 | 37 |
|
38 |
DEF_COMMAND(CmdTerraformLand); |
|
39 |
||
40 |
DEF_COMMAND(CmdPurchaseLandArea); |
|
41 |
DEF_COMMAND(CmdSellLandArea); |
|
42 |
||
43 |
DEF_COMMAND(CmdBuildTunnel); |
|
44 |
||
45 |
DEF_COMMAND(CmdBuildTrainDepot); |
|
395
788a9bba0889
(svn r587) -newgrf: Rename all /Checkpoint/i tokens to 'Waypoint's. The name actually makes some sense and is also compatible with TTDPatch (pasky).
darkvater
parents:
215
diff
changeset
|
46 |
DEF_COMMAND(CmdBuildTrainWaypoint); |
788a9bba0889
(svn r587) -newgrf: Rename all /Checkpoint/i tokens to 'Waypoint's. The name actually makes some sense and is also compatible with TTDPatch (pasky).
darkvater
parents:
215
diff
changeset
|
47 |
DEF_COMMAND(CmdRenameWaypoint); |
788a9bba0889
(svn r587) -newgrf: Rename all /Checkpoint/i tokens to 'Waypoint's. The name actually makes some sense and is also compatible with TTDPatch (pasky).
darkvater
parents:
215
diff
changeset
|
48 |
DEF_COMMAND(CmdRemoveTrainWaypoint); |
0 | 49 |
|
1217
59c024cfaf54
(svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
celestar
parents:
1093
diff
changeset
|
50 |
DEF_COMMAND(CmdBuildRoadStop); |
6012
065d7234a7a9
(svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents:
5587
diff
changeset
|
51 |
DEF_COMMAND(CmdRemoveRoadStop); |
0 | 52 |
|
53 |
DEF_COMMAND(CmdBuildLongRoad); |
|
54 |
DEF_COMMAND(CmdRemoveLongRoad); |
|
55 |
DEF_COMMAND(CmdBuildRoad); |
|
56 |
DEF_COMMAND(CmdRemoveRoad); |
|
57 |
||
58 |
DEF_COMMAND(CmdBuildRoadDepot); |
|
59 |
||
60 |
DEF_COMMAND(CmdBuildAirport); |
|
61 |
||
62 |
DEF_COMMAND(CmdBuildDock); |
|
63 |
||
64 |
DEF_COMMAND(CmdBuildShipDepot); |
|
65 |
||
66 |
DEF_COMMAND(CmdBuildBuoy); |
|
67 |
||
68 |
DEF_COMMAND(CmdPlantTree); |
|
69 |
||
70 |
DEF_COMMAND(CmdBuildRailVehicle); |
|
71 |
DEF_COMMAND(CmdMoveRailVehicle); |
|
72 |
||
73 |
DEF_COMMAND(CmdStartStopTrain); |
|
74 |
||
75 |
DEF_COMMAND(CmdSellRailWagon); |
|
76 |
||
1794
24b4239f2090
(svn r2298) - CodeChange: removed CmdAbuses: CmdSetTownNameType(), CmdStartNewGame(), CmdCreateScenario(), CmdSetNewLandscapeType() and CmdGenRandomNewGame().
Darkvater
parents:
1786
diff
changeset
|
77 |
DEF_COMMAND(CmdSendTrainToDepot); |
0 | 78 |
DEF_COMMAND(CmdForceTrainProceed); |
79 |
DEF_COMMAND(CmdReverseTrainDirection); |
|
80 |
||
81 |
DEF_COMMAND(CmdModifyOrder); |
|
82 |
DEF_COMMAND(CmdSkipOrder); |
|
83 |
DEF_COMMAND(CmdDeleteOrder); |
|
84 |
DEF_COMMAND(CmdInsertOrder); |
|
2819
f25fb6ee397f
(svn r3367) Unify the 4 distinct CMD_CHANGE_{AIRCRAFT,ROADVEH,SHIP,TRAIN}_SERVICE_INT commands into one CMD_CHANGE_SERVICE_INT command.
tron
parents:
2809
diff
changeset
|
85 |
DEF_COMMAND(CmdChangeServiceInt); |
0 | 86 |
DEF_COMMAND(CmdRestoreOrderIndex); |
87 |
||
88 |
DEF_COMMAND(CmdBuildIndustry); |
|
89 |
||
90 |
DEF_COMMAND(CmdBuildCompanyHQ); |
|
91 |
DEF_COMMAND(CmdSetPlayerFace); |
|
92 |
DEF_COMMAND(CmdSetPlayerColor); |
|
93 |
||
94 |
DEF_COMMAND(CmdIncreaseLoan); |
|
95 |
DEF_COMMAND(CmdDecreaseLoan); |
|
96 |
||
97 |
DEF_COMMAND(CmdWantEnginePreview); |
|
98 |
||
99 |
DEF_COMMAND(CmdNameVehicle); |
|
100 |
DEF_COMMAND(CmdRenameEngine); |
|
101 |
||
102 |
DEF_COMMAND(CmdChangeCompanyName); |
|
103 |
DEF_COMMAND(CmdChangePresidentName); |
|
104 |
||
105 |
DEF_COMMAND(CmdRenameStation); |
|
106 |
||
107 |
DEF_COMMAND(CmdSellAircraft); |
|
108 |
DEF_COMMAND(CmdStartStopAircraft); |
|
109 |
DEF_COMMAND(CmdBuildAircraft); |
|
110 |
DEF_COMMAND(CmdSendAircraftToHangar); |
|
111 |
DEF_COMMAND(CmdRefitAircraft); |
|
112 |
||
113 |
DEF_COMMAND(CmdPlaceSign); |
|
114 |
DEF_COMMAND(CmdRenameSign); |
|
115 |
||
116 |
DEF_COMMAND(CmdBuildRoadVeh); |
|
117 |
DEF_COMMAND(CmdStartStopRoadVeh); |
|
118 |
DEF_COMMAND(CmdSellRoadVeh); |
|
119 |
DEF_COMMAND(CmdSendRoadVehToDepot); |
|
120 |
DEF_COMMAND(CmdTurnRoadVeh); |
|
3990
a317e665fb77
(svn r5191) - NewGRF: add cargo refit support for road vehicles
peter1138
parents:
3491
diff
changeset
|
121 |
DEF_COMMAND(CmdRefitRoadVeh); |
0 | 122 |
|
123 |
DEF_COMMAND(CmdPause); |
|
124 |
||
125 |
DEF_COMMAND(CmdBuyShareInCompany); |
|
126 |
DEF_COMMAND(CmdSellShareInCompany); |
|
127 |
DEF_COMMAND(CmdBuyCompany); |
|
128 |
||
129 |
DEF_COMMAND(CmdBuildTown); |
|
130 |
||
131 |
DEF_COMMAND(CmdRenameTown); |
|
132 |
DEF_COMMAND(CmdDoTownAction); |
|
133 |
||
134 |
DEF_COMMAND(CmdSetRoadDriveSide); |
|
135 |
||
136 |
DEF_COMMAND(CmdChangeDifficultyLevel); |
|
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
534
diff
changeset
|
137 |
DEF_COMMAND(CmdChangePatchSetting); |
0 | 138 |
|
139 |
DEF_COMMAND(CmdStartStopShip); |
|
140 |
DEF_COMMAND(CmdSellShip); |
|
141 |
DEF_COMMAND(CmdBuildShip); |
|
142 |
DEF_COMMAND(CmdSendShipToDepot); |
|
143 |
DEF_COMMAND(CmdRefitShip); |
|
144 |
||
4712
4335ad42e163
(svn r6624) -Feature: added ability to add refit commands to vehicle orders (can only be done in goto depot orders)
bjarni
parents:
4662
diff
changeset
|
145 |
DEF_COMMAND(CmdOrderRefit); |
0 | 146 |
DEF_COMMAND(CmdCloneOrder); |
147 |
||
148 |
DEF_COMMAND(CmdClearArea); |
|
149 |
||
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
534
diff
changeset
|
150 |
DEF_COMMAND(CmdGiveMoney); |
0 | 151 |
DEF_COMMAND(CmdMoneyCheat); |
152 |
DEF_COMMAND(CmdBuildCanal); |
|
147
d0c8100d18cf
(svn r148) -Feature: Company HQ can now be moved somewhere else (cost 1% of company value). Water floods HQ.
darkvater
parents:
58
diff
changeset
|
153 |
DEF_COMMAND(CmdBuildLock); |
0 | 154 |
|
155 |
DEF_COMMAND(CmdPlayerCtrl); |
|
156 |
||
157 |
DEF_COMMAND(CmdLevelLand); |
|
158 |
||
159 |
DEF_COMMAND(CmdRefitRailVehicle); |
|
160 |
||
1227
1d940a5e02d2
(svn r1731) - Fix: [ 1106930 ] BugFix: placing signals with 2x1 drags workaround is completely rewritten. Also features checks for hacked/modified clients. Thanks a lot Hackykid!
darkvater
parents:
1217
diff
changeset
|
161 |
DEF_COMMAND(CmdBuildSignalTrack); |
1d940a5e02d2
(svn r1731) - Fix: [ 1106930 ] BugFix: placing signals with 2x1 drags workaround is completely rewritten. Also features checks for hacked/modified clients. Thanks a lot Hackykid!
darkvater
parents:
1217
diff
changeset
|
162 |
DEF_COMMAND(CmdRemoveSignalTrack); |
58
b9fdcc9b5c90
(svn r59) -Feature: Added Autosignals, just like Autorail. Can copy signal style, convert signal<->semaphore, etc. Big thanks to betatesters Dribbel and Testman57 (Darkvater)
darkvater
parents:
0
diff
changeset
|
163 |
|
4661
89c3cbba9846
(svn r6544) - Codechange: Rename CmdReplaceVehicle to CmdSetAutoReplace, to reflect what it does.
peter1138
parents:
4659
diff
changeset
|
164 |
DEF_COMMAND(CmdSetAutoReplace); |
812
65ecc321b3db
(svn r1283) -Add: AutoRenew is now a client-side patch instead of a game-side patch
truelight
parents:
679
diff
changeset
|
165 |
|
2244 | 166 |
DEF_COMMAND(CmdCloneVehicle); |
4640
4e380e2ecfa7
(svn r6515) -Feature: added "start all" and "stop all" buttons to the depot windows
bjarni
parents:
4300
diff
changeset
|
167 |
DEF_COMMAND(CmdMassStartStopVehicle); |
4659
e476c76389a8
(svn r6542) -Feature: [depot window] added a "sell all vehicles in depot" button
bjarni
parents:
4640
diff
changeset
|
168 |
DEF_COMMAND(CmdDepotSellAllVehicles); |
4662
e36935c7bdde
(svn r6552) -Feature: [depot window] added a "autoreplace all vehicles in depot" button
bjarni
parents:
4661
diff
changeset
|
169 |
DEF_COMMAND(CmdDepotMassAutoReplace); |
2244 | 170 |
|
0 | 171 |
/* The master command table */ |
1804
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
172 |
static const Command _command_proc_table[] = { |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
173 |
{CmdBuildRailroadTrack, 0}, /* 0 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
174 |
{CmdRemoveRailroadTrack, 0}, /* 1 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
175 |
{CmdBuildSingleRail, 0}, /* 2 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
176 |
{CmdRemoveSingleRail, 0}, /* 3 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
177 |
{CmdLandscapeClear, 0}, /* 4 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
178 |
{CmdBuildBridge, 0}, /* 5 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
179 |
{CmdBuildRailroadStation, 0}, /* 6 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
180 |
{CmdBuildTrainDepot, 0}, /* 7 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
181 |
{CmdBuildSingleSignal, 0}, /* 8 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
182 |
{CmdRemoveSingleSignal, 0}, /* 9 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
183 |
{CmdTerraformLand, 0}, /* 10 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
184 |
{CmdPurchaseLandArea, 0}, /* 11 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
185 |
{CmdSellLandArea, 0}, /* 12 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
186 |
{CmdBuildTunnel, 0}, /* 13 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
187 |
{CmdRemoveFromRailroadStation, 0}, /* 14 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
188 |
{CmdConvertRail, 0}, /* 15 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
189 |
{CmdBuildTrainWaypoint, 0}, /* 16 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
190 |
{CmdRenameWaypoint, 0}, /* 17 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
191 |
{CmdRemoveTrainWaypoint, 0}, /* 18 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
192 |
{NULL, 0}, /* 19 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
193 |
{NULL, 0}, /* 20 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
194 |
{CmdBuildRoadStop, 0}, /* 21 */ |
6012
065d7234a7a9
(svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents:
5587
diff
changeset
|
195 |
{CmdRemoveRoadStop, 0}, /* 22 */ |
1804
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
196 |
{CmdBuildLongRoad, 0}, /* 23 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
197 |
{CmdRemoveLongRoad, 0}, /* 24 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
198 |
{CmdBuildRoad, 0}, /* 25 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
199 |
{CmdRemoveRoad, 0}, /* 26 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
200 |
{CmdBuildRoadDepot, 0}, /* 27 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
201 |
{NULL, 0}, /* 28 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
202 |
{CmdBuildAirport, 0}, /* 29 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
203 |
{CmdBuildDock, 0}, /* 30 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
204 |
{CmdBuildShipDepot, 0}, /* 31 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
205 |
{CmdBuildBuoy, 0}, /* 32 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
206 |
{CmdPlantTree, 0}, /* 33 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
207 |
{CmdBuildRailVehicle, 0}, /* 34 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
208 |
{CmdMoveRailVehicle, 0}, /* 35 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
209 |
{CmdStartStopTrain, 0}, /* 36 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
210 |
{NULL, 0}, /* 37 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
211 |
{CmdSellRailWagon, 0}, /* 38 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
212 |
{CmdSendTrainToDepot, 0}, /* 39 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
213 |
{CmdForceTrainProceed, 0}, /* 40 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
214 |
{CmdReverseTrainDirection, 0}, /* 41 */ |
147
d0c8100d18cf
(svn r148) -Feature: Company HQ can now be moved somewhere else (cost 1% of company value). Water floods HQ.
darkvater
parents:
58
diff
changeset
|
215 |
|
1804
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
216 |
{CmdModifyOrder, 0}, /* 42 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
217 |
{CmdSkipOrder, 0}, /* 43 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
218 |
{CmdDeleteOrder, 0}, /* 44 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
219 |
{CmdInsertOrder, 0}, /* 45 */ |
0 | 220 |
|
2819
f25fb6ee397f
(svn r3367) Unify the 4 distinct CMD_CHANGE_{AIRCRAFT,ROADVEH,SHIP,TRAIN}_SERVICE_INT commands into one CMD_CHANGE_SERVICE_INT command.
tron
parents:
2809
diff
changeset
|
221 |
{CmdChangeServiceInt, 0}, /* 46 */ |
147
d0c8100d18cf
(svn r148) -Feature: Company HQ can now be moved somewhere else (cost 1% of company value). Water floods HQ.
darkvater
parents:
58
diff
changeset
|
222 |
|
1804
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
223 |
{CmdBuildIndustry, 0}, /* 47 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
224 |
{CmdBuildCompanyHQ, 0}, /* 48 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
225 |
{CmdSetPlayerFace, 0}, /* 49 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
226 |
{CmdSetPlayerColor, 0}, /* 50 */ |
1796
614d996f6be7
(svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents:
1794
diff
changeset
|
227 |
|
1804
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
228 |
{CmdIncreaseLoan, 0}, /* 51 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
229 |
{CmdDecreaseLoan, 0}, /* 52 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
230 |
|
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
231 |
{CmdWantEnginePreview, 0}, /* 53 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
232 |
|
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
233 |
{CmdNameVehicle, 0}, /* 54 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
234 |
{CmdRenameEngine, 0}, /* 55 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
235 |
|
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
236 |
{CmdChangeCompanyName, 0}, /* 56 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
237 |
{CmdChangePresidentName, 0}, /* 57 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
238 |
|
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
239 |
{CmdRenameStation, 0}, /* 58 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
240 |
|
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
241 |
{CmdSellAircraft, 0}, /* 59 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
242 |
{CmdStartStopAircraft, 0}, /* 60 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
243 |
|
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
244 |
{CmdBuildAircraft, 0}, /* 61 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
245 |
{CmdSendAircraftToHangar, 0}, /* 62 */ |
2819
f25fb6ee397f
(svn r3367) Unify the 4 distinct CMD_CHANGE_{AIRCRAFT,ROADVEH,SHIP,TRAIN}_SERVICE_INT commands into one CMD_CHANGE_SERVICE_INT command.
tron
parents:
2809
diff
changeset
|
246 |
{NULL, 0}, /* 63 */ |
1804
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
247 |
{CmdRefitAircraft, 0}, /* 64 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
248 |
|
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
249 |
{CmdPlaceSign, 0}, /* 65 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
250 |
{CmdRenameSign, 0}, /* 66 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
251 |
|
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
252 |
{CmdBuildRoadVeh, 0}, /* 67 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
253 |
{CmdStartStopRoadVeh, 0}, /* 68 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
254 |
{CmdSellRoadVeh, 0}, /* 69 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
255 |
{CmdSendRoadVehToDepot, 0}, /* 70 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
256 |
{CmdTurnRoadVeh, 0}, /* 71 */ |
3990
a317e665fb77
(svn r5191) - NewGRF: add cargo refit support for road vehicles
peter1138
parents:
3491
diff
changeset
|
257 |
{CmdRefitRoadVeh, 0}, /* 72 */ |
1804
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
258 |
|
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
259 |
{CmdPause, CMD_SERVER}, /* 73 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
260 |
|
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
261 |
{CmdBuyShareInCompany, 0}, /* 74 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
262 |
{CmdSellShareInCompany, 0}, /* 75 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
263 |
{CmdBuyCompany, 0}, /* 76 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
264 |
|
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
265 |
{CmdBuildTown, CMD_OFFLINE}, /* 77 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
266 |
{NULL, 0}, /* 78 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
267 |
{NULL, 0}, /* 79 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
268 |
{CmdRenameTown, CMD_SERVER}, /* 80 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
269 |
{CmdDoTownAction, 0}, /* 81 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
270 |
|
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
271 |
{CmdSetRoadDriveSide, CMD_SERVER}, /* 82 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
272 |
{NULL, 0}, /* 83 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
273 |
{NULL, 0}, /* 84 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
274 |
{CmdChangeDifficultyLevel, CMD_SERVER}, /* 85 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
275 |
|
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
276 |
{CmdStartStopShip, 0}, /* 86 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
277 |
{CmdSellShip, 0}, /* 87 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
278 |
{CmdBuildShip, 0}, /* 88 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
279 |
{CmdSendShipToDepot, 0}, /* 89 */ |
2819
f25fb6ee397f
(svn r3367) Unify the 4 distinct CMD_CHANGE_{AIRCRAFT,ROADVEH,SHIP,TRAIN}_SERVICE_INT commands into one CMD_CHANGE_SERVICE_INT command.
tron
parents:
2809
diff
changeset
|
280 |
{NULL, 0}, /* 90 */ |
1804
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
281 |
{CmdRefitShip, 0}, /* 91 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
282 |
|
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
283 |
{NULL, 0}, /* 92 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
284 |
{NULL, 0}, /* 93 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
285 |
{NULL, 0}, /* 94 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
286 |
{NULL, 0}, /* 95 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
287 |
{NULL, 0}, /* 96 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
288 |
{NULL, 0}, /* 97 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
289 |
|
4712
4335ad42e163
(svn r6624) -Feature: added ability to add refit commands to vehicle orders (can only be done in goto depot orders)
bjarni
parents:
4662
diff
changeset
|
290 |
{CmdOrderRefit, 0}, /* 98 */ |
1804
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
291 |
{CmdCloneOrder, 0}, /* 99 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
292 |
|
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
293 |
{CmdClearArea, 0}, /* 100 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
294 |
{NULL, 0}, /* 101 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
295 |
|
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
296 |
{CmdMoneyCheat, CMD_OFFLINE}, /* 102 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
297 |
{CmdBuildCanal, 0}, /* 103 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
298 |
{CmdPlayerCtrl, 0}, /* 104 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
299 |
|
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
300 |
{CmdLevelLand, 0}, /* 105 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
301 |
|
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
302 |
{CmdRefitRailVehicle, 0}, /* 106 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
303 |
{CmdRestoreOrderIndex, 0}, /* 107 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
304 |
{CmdBuildLock, 0}, /* 108 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
305 |
{NULL, 0}, /* 109 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
306 |
{CmdBuildSignalTrack, 0}, /* 110 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
307 |
{CmdRemoveSignalTrack, 0}, /* 111 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
308 |
{NULL, 0}, /* 112 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
309 |
{CmdGiveMoney, 0}, /* 113 */ |
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
310 |
{CmdChangePatchSetting, CMD_SERVER}, /* 114 */ |
4661
89c3cbba9846
(svn r6544) - Codechange: Rename CmdReplaceVehicle to CmdSetAutoReplace, to reflect what it does.
peter1138
parents:
4659
diff
changeset
|
311 |
{CmdSetAutoReplace, 0}, /* 115 */ |
3991
6c147713fbbb
(svn r5192) - Stylechange: fix bjarni's tabs-instead-of-spaces alignment
peter1138
parents:
3990
diff
changeset
|
312 |
{CmdCloneVehicle, 0}, /* 116 */ |
4640
4e380e2ecfa7
(svn r6515) -Feature: added "start all" and "stop all" buttons to the depot windows
bjarni
parents:
4300
diff
changeset
|
313 |
{CmdMassStartStopVehicle, 0}, /* 117 */ |
4659
e476c76389a8
(svn r6542) -Feature: [depot window] added a "sell all vehicles in depot" button
bjarni
parents:
4640
diff
changeset
|
314 |
{CmdDepotSellAllVehicles, 0}, /* 118 */ |
4662
e36935c7bdde
(svn r6552) -Feature: [depot window] added a "autoreplace all vehicles in depot" button
bjarni
parents:
4661
diff
changeset
|
315 |
{CmdDepotMassAutoReplace, 0}, /* 119 */ |
0 | 316 |
}; |
317 |
||
903
a301a264e0fc
(svn r1389) -Add: [Network] Added packet protection. No longer a client or server
truelight
parents:
889
diff
changeset
|
318 |
/* This function range-checks a cmd, and checks if the cmd is not NULL */ |
959
e6a3bbda610f
(svn r1451) Fix some of the signed/unsigned comparison warnings
tron
parents:
926
diff
changeset
|
319 |
bool IsValidCommand(uint cmd) |
903
a301a264e0fc
(svn r1389) -Add: [Network] Added packet protection. No longer a client or server
truelight
parents:
889
diff
changeset
|
320 |
{ |
2645
841087328e0e
(svn r3187) Simplify overly complicated ifs, especially if (foo) return false; else return true; is confusing
tron
parents:
2425
diff
changeset
|
321 |
cmd &= 0xFF; |
903
a301a264e0fc
(svn r1389) -Add: [Network] Added packet protection. No longer a client or server
truelight
parents:
889
diff
changeset
|
322 |
|
2645
841087328e0e
(svn r3187) Simplify overly complicated ifs, especially if (foo) return false; else return true; is confusing
tron
parents:
2425
diff
changeset
|
323 |
return |
841087328e0e
(svn r3187) Simplify overly complicated ifs, especially if (foo) return false; else return true; is confusing
tron
parents:
2425
diff
changeset
|
324 |
cmd < lengthof(_command_proc_table) && |
841087328e0e
(svn r3187) Simplify overly complicated ifs, especially if (foo) return false; else return true; is confusing
tron
parents:
2425
diff
changeset
|
325 |
_command_proc_table[cmd].proc != NULL; |
903
a301a264e0fc
(svn r1389) -Add: [Network] Added packet protection. No longer a client or server
truelight
parents:
889
diff
changeset
|
326 |
} |
a301a264e0fc
(svn r1389) -Add: [Network] Added packet protection. No longer a client or server
truelight
parents:
889
diff
changeset
|
327 |
|
4000
4009d092b306
(svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
tron
parents:
3991
diff
changeset
|
328 |
byte GetCommandFlags(uint cmd) |
4009d092b306
(svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
tron
parents:
3991
diff
changeset
|
329 |
{ |
4009d092b306
(svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
tron
parents:
3991
diff
changeset
|
330 |
return _command_proc_table[cmd & 0xFF].flags; |
4009d092b306
(svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
tron
parents:
3991
diff
changeset
|
331 |
} |
1804
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
332 |
|
0 | 333 |
|
2304
bebc1ee33ab2
(svn r2828) Only command.c needs to know about _docommand_recursive, so make it static. Tell me if there's a problem, because i removed it from network_server.c, but afaict it should be ok
tron
parents:
2244
diff
changeset
|
334 |
static int _docommand_recursive; |
bebc1ee33ab2
(svn r2828) Only command.c needs to know about _docommand_recursive, so make it static. Tell me if there's a problem, because i removed it from network_server.c, but afaict it should be ok
tron
parents:
2244
diff
changeset
|
335 |
|
3491
35d747bb5e82
(svn r4342) Change the first two parameters of commands - virtual pixel coordinates of the tile to operate on - to a TileIndex
tron
parents:
3421
diff
changeset
|
336 |
int32 DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc) |
0 | 337 |
{ |
338 |
int32 res; |
|
339 |
CommandProc *proc; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
147
diff
changeset
|
340 |
|
1776
956f8589024d
(svn r2280) - Fix: Check if the passed tile to DoCommand is within the current mapsize
Darkvater
parents:
1728
diff
changeset
|
341 |
/* Do not even think about executing out-of-bounds tile-commands */ |
3491
35d747bb5e82
(svn r4342) Change the first two parameters of commands - virtual pixel coordinates of the tile to operate on - to a TileIndex
tron
parents:
3421
diff
changeset
|
342 |
if (tile >= MapSize()) { |
1820
d03c56850dc2
(svn r2324) Introduce _cmd_text for passing strings with a command instead of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes.
tron
parents:
1804
diff
changeset
|
343 |
_cmd_text = NULL; |
d03c56850dc2
(svn r2324) Introduce _cmd_text for passing strings with a command instead of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes.
tron
parents:
1804
diff
changeset
|
344 |
return CMD_ERROR; |
d03c56850dc2
(svn r2324) Introduce _cmd_text for passing strings with a command instead of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes.
tron
parents:
1804
diff
changeset
|
345 |
} |
1776
956f8589024d
(svn r2280) - Fix: Check if the passed tile to DoCommand is within the current mapsize
Darkvater
parents:
1728
diff
changeset
|
346 |
|
1804
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
347 |
proc = _command_proc_table[procc].proc; |
0 | 348 |
|
2749
c9312a4a1efe
(svn r3294) - Fix: use INVALID_STRING_ID instead of -1.
Darkvater
parents:
2715
diff
changeset
|
349 |
if (_docommand_recursive == 0) _error_message = INVALID_STRING_ID; |
0 | 350 |
|
351 |
_docommand_recursive++; |
|
352 |
||
6123
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
353 |
/* only execute the test call if it's toplevel, or we're not execing. */ |
0 | 354 |
if (_docommand_recursive == 1 || !(flags & DC_EXEC) || (flags & DC_FORCETEST) ) { |
3491
35d747bb5e82
(svn r4342) Change the first two parameters of commands - virtual pixel coordinates of the tile to operate on - to a TileIndex
tron
parents:
3421
diff
changeset
|
355 |
res = proc(tile, flags & ~DC_EXEC, p1, p2); |
1691
852ca27d6eef
(svn r2195) Add CmdFailed() as the One True Way(tm) to check if a command failed.
tron
parents:
1623
diff
changeset
|
356 |
if (CmdFailed(res)) { |
0 | 357 |
if (res & 0xFFFF) _error_message = res & 0xFFFF; |
358 |
goto error; |
|
359 |
} |
|
360 |
||
4000
4009d092b306
(svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
tron
parents:
3991
diff
changeset
|
361 |
if (_docommand_recursive == 1 && |
4009d092b306
(svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
tron
parents:
3991
diff
changeset
|
362 |
!(flags & DC_QUERY_COST) && |
4009d092b306
(svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
tron
parents:
3991
diff
changeset
|
363 |
res != 0 && |
4009d092b306
(svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
tron
parents:
3991
diff
changeset
|
364 |
!CheckPlayerHasMoney(res)) { |
4009d092b306
(svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
tron
parents:
3991
diff
changeset
|
365 |
goto error; |
0 | 366 |
} |
367 |
||
368 |
if (!(flags & DC_EXEC)) { |
|
369 |
_docommand_recursive--; |
|
1820
d03c56850dc2
(svn r2324) Introduce _cmd_text for passing strings with a command instead of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes.
tron
parents:
1804
diff
changeset
|
370 |
_cmd_text = NULL; |
0 | 371 |
return res; |
372 |
} |
|
373 |
} |
|
374 |
||
889
64d2f7d5f02b
(svn r1375) -Fix: [1050990] Buying trains sometimes accounted for incorrectly. Was the result of the cost getting reset in a recursive call of docommand. That is fixed. In addition all cost-commands are typed explicitely. Please do not forget to do so or your costs will be credited to construction if you are unlucky.
darkvater
parents:
842
diff
changeset
|
375 |
/* Execute the command here. All cost-relevant functions set the expenses type |
64d2f7d5f02b
(svn r1375) -Fix: [1050990] Buying trains sometimes accounted for incorrectly. Was the result of the cost getting reset in a recursive call of docommand. That is fixed. In addition all cost-commands are typed explicitely. Please do not forget to do so or your costs will be credited to construction if you are unlucky.
darkvater
parents:
842
diff
changeset
|
376 |
* themselves with "SET_EXPENSES_TYPE(...);" at the beginning of the function */ |
3491
35d747bb5e82
(svn r4342) Change the first two parameters of commands - virtual pixel coordinates of the tile to operate on - to a TileIndex
tron
parents:
3421
diff
changeset
|
377 |
res = proc(tile, flags, p1, p2); |
1691
852ca27d6eef
(svn r2195) Add CmdFailed() as the One True Way(tm) to check if a command failed.
tron
parents:
1623
diff
changeset
|
378 |
if (CmdFailed(res)) { |
0 | 379 |
if (res & 0xFFFF) _error_message = res & 0xFFFF; |
380 |
error: |
|
381 |
_docommand_recursive--; |
|
1820
d03c56850dc2
(svn r2324) Introduce _cmd_text for passing strings with a command instead of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes.
tron
parents:
1804
diff
changeset
|
382 |
_cmd_text = NULL; |
0 | 383 |
return CMD_ERROR; |
384 |
} |
|
385 |
||
6123
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
386 |
/* if toplevel, subtract the money. */ |
0 | 387 |
if (--_docommand_recursive == 0) { |
388 |
SubtractMoneyFromPlayer(res); |
|
6123
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
389 |
/* XXX - Old AI hack which doesn't use DoCommandDP; update last build coord of player */ |
4850
93095755db8c
(svn r6776) -Codechange: Use IsValidPlayer() function to determine of a PlayerID is an
Darkvater
parents:
4848
diff
changeset
|
390 |
if (tile != 0 && IsValidPlayer(_current_player)) { |
3491
35d747bb5e82
(svn r4342) Change the first two parameters of commands - virtual pixel coordinates of the tile to operate on - to a TileIndex
tron
parents:
3421
diff
changeset
|
391 |
GetPlayer(_current_player)->last_build_coordinate = tile; |
2772
593f2304e5ea
(svn r3319) - Fix (regression): "Unnamed Competitors". A result of revision r3224 which allowed AI's for multiplayer. Old AI's didn't function correctly anymore. The update of last-built tile is moved back, but to a slightly different place so it is only executed when the command is actually successfully executed. This code shouldn't be neccessary, but alas, the old AI doesn't use DoCommandDP() functions.
Darkvater
parents:
2767
diff
changeset
|
392 |
} |
0 | 393 |
} |
394 |
||
1820
d03c56850dc2
(svn r2324) Introduce _cmd_text for passing strings with a command instead of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes.
tron
parents:
1804
diff
changeset
|
395 |
_cmd_text = NULL; |
0 | 396 |
return res; |
397 |
} |
|
398 |
||
6247 | 399 |
int32 GetAvailableMoneyForCommand() |
0 | 400 |
{ |
1794
24b4239f2090
(svn r2298) - CodeChange: removed CmdAbuses: CmdSetTownNameType(), CmdStartNewGame(), CmdCreateScenario(), CmdSetNewLandscapeType() and CmdGenRandomNewGame().
Darkvater
parents:
1786
diff
changeset
|
401 |
PlayerID pid = _current_player; |
4850
93095755db8c
(svn r6776) -Codechange: Use IsValidPlayer() function to determine of a PlayerID is an
Darkvater
parents:
4848
diff
changeset
|
402 |
if (!IsValidPlayer(pid)) return 0x7FFFFFFF; // max int |
1962
8254df1b359b
(svn r2468) -Codechange: Got rid of DEREF_PLAYER and replaced it by GetPlayer
celestar
parents:
1891
diff
changeset
|
403 |
return GetPlayer(pid)->player_money; |
0 | 404 |
} |
405 |
||
6123
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
406 |
/* toplevel network safe docommand function for the current player. must not be called recursively. |
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
407 |
* the callback is called when the command succeeded or failed. */ |
0 | 408 |
bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, uint32 cmd) |
409 |
{ |
|
6491
00dc414c909d
(svn r9672) -Cleanup: lots of coding style fixes around operands.
rubidium
parents:
6453
diff
changeset
|
410 |
int32 res = 0, res2; |
0 | 411 |
CommandProc *proc; |
412 |
uint32 flags; |
|
413 |
bool notest; |
|
3182
0cec126ca9a9
(svn r3827) Remove the global variable _error_message_2, it's only used as local variable
tron
parents:
2820
diff
changeset
|
414 |
StringID error_part1; |
0 | 415 |
|
3421
7968a4b5ff0a
(svn r4246) -Codechange. Replaced about 100 occurences of '16' by TILE_SIZE
celestar
parents:
3182
diff
changeset
|
416 |
int x = TileX(tile) * TILE_SIZE; |
7968a4b5ff0a
(svn r4246) -Codechange. Replaced about 100 occurences of '16' by TILE_SIZE
celestar
parents:
3182
diff
changeset
|
417 |
int y = TileY(tile) * TILE_SIZE; |
0 | 418 |
|
1776
956f8589024d
(svn r2280) - Fix: Check if the passed tile to DoCommand is within the current mapsize
Darkvater
parents:
1728
diff
changeset
|
419 |
/* Do not even think about executing out-of-bounds tile-commands */ |
2820
9c36591b60c2
(svn r3368) Fix the same type of off-by-one error when checking, if the passed coordinate is on the map, like in r3357, but this time in DoCommandP - *cough* code duplication *cough*
tron
parents:
2819
diff
changeset
|
420 |
if (tile >= MapSize()) { |
1820
d03c56850dc2
(svn r2324) Introduce _cmd_text for passing strings with a command instead of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes.
tron
parents:
1804
diff
changeset
|
421 |
_cmd_text = NULL; |
d03c56850dc2
(svn r2324) Introduce _cmd_text for passing strings with a command instead of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes.
tron
parents:
1804
diff
changeset
|
422 |
return false; |
d03c56850dc2
(svn r2324) Introduce _cmd_text for passing strings with a command instead of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes.
tron
parents:
1804
diff
changeset
|
423 |
} |
1776
956f8589024d
(svn r2280) - Fix: Check if the passed tile to DoCommand is within the current mapsize
Darkvater
parents:
1728
diff
changeset
|
424 |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
147
diff
changeset
|
425 |
assert(_docommand_recursive == 0); |
0 | 426 |
|
427 |
_error_message = INVALID_STRING_ID; |
|
3182
0cec126ca9a9
(svn r3827) Remove the global variable _error_message_2, it's only used as local variable
tron
parents:
2820
diff
changeset
|
428 |
error_part1 = GB(cmd, 16, 16); |
0 | 429 |
_additional_cash_required = 0; |
430 |
||
5067
f3816e74ad32
(svn r7125) -Fix: Several errors/glitches related to multiplayer and bankrupcy, mainly such a
Darkvater
parents:
4850
diff
changeset
|
431 |
/** Spectator has no rights except for the (dedicated) server which |
f3816e74ad32
(svn r7125) -Fix: Several errors/glitches related to multiplayer and bankrupcy, mainly such a
Darkvater
parents:
4850
diff
changeset
|
432 |
* is/can be a spectator but as the server it can do anything */ |
f3816e74ad32
(svn r7125) -Fix: Several errors/glitches related to multiplayer and bankrupcy, mainly such a
Darkvater
parents:
4850
diff
changeset
|
433 |
if (_current_player == PLAYER_SPECTATOR && !_network_server) { |
3182
0cec126ca9a9
(svn r3827) Remove the global variable _error_message_2, it's only used as local variable
tron
parents:
2820
diff
changeset
|
434 |
ShowErrorMessage(_error_message, error_part1, x, y); |
1820
d03c56850dc2
(svn r2324) Introduce _cmd_text for passing strings with a command instead of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes.
tron
parents:
1804
diff
changeset
|
435 |
_cmd_text = NULL; |
0 | 436 |
return false; |
437 |
} |
|
438 |
||
439 |
flags = 0; |
|
440 |
if (cmd & CMD_AUTO) flags |= DC_AUTO; |
|
441 |
if (cmd & CMD_NO_WATER) flags |= DC_NO_WATER; |
|
442 |
||
6123
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
443 |
/* get pointer to command handler */ |
0 | 444 |
assert((cmd & 0xFF) < lengthof(_command_proc_table)); |
1804
fbe724472bb4
(svn r2308) - Fix: enforce server-only and/or offline commands by giving them flags in the process table. This also fixes bug "[ 1190944 ] Many commands not checked for security"
Darkvater
parents:
1802
diff
changeset
|
445 |
proc = _command_proc_table[cmd & 0xFF].proc; |
1877
ab6a315fa930
(svn r2383) - Fix: Monkey-testing turned up some command crashes.
Darkvater
parents:
1838
diff
changeset
|
446 |
if (proc == NULL) { |
ab6a315fa930
(svn r2383) - Fix: Monkey-testing turned up some command crashes.
Darkvater
parents:
1838
diff
changeset
|
447 |
_cmd_text = NULL; |
ab6a315fa930
(svn r2383) - Fix: Monkey-testing turned up some command crashes.
Darkvater
parents:
1838
diff
changeset
|
448 |
return false; |
ab6a315fa930
(svn r2383) - Fix: Monkey-testing turned up some command crashes.
Darkvater
parents:
1838
diff
changeset
|
449 |
} |
0 | 450 |
|
6123
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
451 |
/* Some commands have a different output in dryrun than the realrun |
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
452 |
* e.g.: if you demolish a whole town, the dryrun would say okay. |
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
453 |
* but by really destroying, your rating drops and at a certain point |
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
454 |
* it will fail. so res and res2 are different |
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
455 |
* CMD_REMOVE_ROAD: This command has special local authority |
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
456 |
* restrictions which may cause the test run to fail (the previous |
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
457 |
* road fragments still stay there and the town won't let you |
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
458 |
* disconnect the road system), but the exec will succeed and this |
6444
31f400a4b890
(svn r9581) -Revert (r9562): This broke as much as it fixed, so revert until a proper way of paying for refits when cloning can be found.
maedhros
parents:
6426
diff
changeset
|
459 |
* fact will trigger an assertion failure. --pasky */ |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
147
diff
changeset
|
460 |
notest = |
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
147
diff
changeset
|
461 |
(cmd & 0xFF) == CMD_CLEAR_AREA || |
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
147
diff
changeset
|
462 |
(cmd & 0xFF) == CMD_CONVERT_RAIL || |
0 | 463 |
(cmd & 0xFF) == CMD_LEVEL_LAND || |
1701
4a2c9ee2034d
(svn r2205) - Fixup of revision 2200, not twice CMD_REMOVE_LONG_ROAD :p. Thanks TrueLight.
Darkvater
parents:
1696
diff
changeset
|
464 |
(cmd & 0xFF) == CMD_REMOVE_ROAD || |
6444
31f400a4b890
(svn r9581) -Revert (r9562): This broke as much as it fixed, so revert until a proper way of paying for refits when cloning can be found.
maedhros
parents:
6426
diff
changeset
|
465 |
(cmd & 0xFF) == CMD_REMOVE_LONG_ROAD; |
0 | 466 |
|
467 |
_docommand_recursive = 1; |
|
468 |
||
6123
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
469 |
/* cost estimation only? */ |
5580
b7e597116b9c
(svn r8027) -Fix (FS#486) If a pause command is issues, it will now pause the game even if shift is pressed instead of giving a cost estimate of 0. This fixes a problem where the server does not pause_on_join when the player on the interactive server has the shift button pressed. (Thanks to pvz for the report and the fix)
celestar
parents:
5475
diff
changeset
|
470 |
if (!IsGeneratingWorld() && |
b7e597116b9c
(svn r8027) -Fix (FS#486) If a pause command is issues, it will now pause the game even if shift is pressed instead of giving a cost estimate of 0. This fixes a problem where the server does not pause_on_join when the player on the interactive server has the shift button pressed. (Thanks to pvz for the report and the fix)
celestar
parents:
5475
diff
changeset
|
471 |
_shift_pressed && |
b7e597116b9c
(svn r8027) -Fix (FS#486) If a pause command is issues, it will now pause the game even if shift is pressed instead of giving a cost estimate of 0. This fixes a problem where the server does not pause_on_join when the player on the interactive server has the shift button pressed. (Thanks to pvz for the report and the fix)
celestar
parents:
5475
diff
changeset
|
472 |
IsLocalPlayer() && |
b7e597116b9c
(svn r8027) -Fix (FS#486) If a pause command is issues, it will now pause the game even if shift is pressed instead of giving a cost estimate of 0. This fixes a problem where the server does not pause_on_join when the player on the interactive server has the shift button pressed. (Thanks to pvz for the report and the fix)
celestar
parents:
5475
diff
changeset
|
473 |
!(cmd & (CMD_NETWORK_COMMAND | CMD_SHOW_NO_ERROR)) && |
b7e597116b9c
(svn r8027) -Fix (FS#486) If a pause command is issues, it will now pause the game even if shift is pressed instead of giving a cost estimate of 0. This fixes a problem where the server does not pause_on_join when the player on the interactive server has the shift button pressed. (Thanks to pvz for the report and the fix)
celestar
parents:
5475
diff
changeset
|
474 |
(cmd & 0xFF) != CMD_PAUSE) { |
6123
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
475 |
/* estimate the cost. */ |
3491
35d747bb5e82
(svn r4342) Change the first two parameters of commands - virtual pixel coordinates of the tile to operate on - to a TileIndex
tron
parents:
3421
diff
changeset
|
476 |
res = proc(tile, flags, p1, p2); |
1691
852ca27d6eef
(svn r2195) Add CmdFailed() as the One True Way(tm) to check if a command failed.
tron
parents:
1623
diff
changeset
|
477 |
if (CmdFailed(res)) { |
0 | 478 |
if (res & 0xFFFF) _error_message = res & 0xFFFF; |
3182
0cec126ca9a9
(svn r3827) Remove the global variable _error_message_2, it's only used as local variable
tron
parents:
2820
diff
changeset
|
479 |
ShowErrorMessage(_error_message, error_part1, x, y); |
0 | 480 |
} else { |
481 |
ShowEstimatedCostOrIncome(res, x, y); |
|
482 |
} |
|
483 |
||
484 |
_docommand_recursive = 0; |
|
1820
d03c56850dc2
(svn r2324) Introduce _cmd_text for passing strings with a command instead of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes.
tron
parents:
1804
diff
changeset
|
485 |
_cmd_text = NULL; |
0 | 486 |
return false; |
487 |
} |
|
488 |
||
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
147
diff
changeset
|
489 |
|
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
534
diff
changeset
|
490 |
if (!((cmd & CMD_NO_TEST_IF_IN_NETWORK) && _networking)) { |
6123
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
491 |
/* first test if the command can be executed. */ |
3491
35d747bb5e82
(svn r4342) Change the first two parameters of commands - virtual pixel coordinates of the tile to operate on - to a TileIndex
tron
parents:
3421
diff
changeset
|
492 |
res = proc(tile, flags, p1, p2); |
1691
852ca27d6eef
(svn r2195) Add CmdFailed() as the One True Way(tm) to check if a command failed.
tron
parents:
1623
diff
changeset
|
493 |
if (CmdFailed(res)) { |
0 | 494 |
if (res & 0xFFFF) _error_message = res & 0xFFFF; |
495 |
goto show_error; |
|
496 |
} |
|
6123
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
497 |
/* no money? Only check if notest is off */ |
2767 | 498 |
if (!notest && res != 0 && !CheckPlayerHasMoney(res)) goto show_error; |
0 | 499 |
} |
500 |
||
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
534
diff
changeset
|
501 |
#ifdef ENABLE_NETWORK |
1838
4aed9afd0744
(svn r2343) - Fix (regression): dedicated server caused desyncs with its commands, because the player sent over the network is OWNER_SPECTATOR as well, which on clients cannot execute anything. So *hack*hack* it into temporarily player 0.
Darkvater
parents:
1834
diff
changeset
|
502 |
/** If we are in network, and the command is not from the network |
4aed9afd0744
(svn r2343) - Fix (regression): dedicated server caused desyncs with its commands, because the player sent over the network is OWNER_SPECTATOR as well, which on clients cannot execute anything. So *hack*hack* it into temporarily player 0.
Darkvater
parents:
1834
diff
changeset
|
503 |
* send it to the command-queue and abort execution |
4aed9afd0744
(svn r2343) - Fix (regression): dedicated server caused desyncs with its commands, because the player sent over the network is OWNER_SPECTATOR as well, which on clients cannot execute anything. So *hack*hack* it into temporarily player 0.
Darkvater
parents:
1834
diff
changeset
|
504 |
* If we are a dedicated server temporarily switch local player, otherwise |
4aed9afd0744
(svn r2343) - Fix (regression): dedicated server caused desyncs with its commands, because the player sent over the network is OWNER_SPECTATOR as well, which on clients cannot execute anything. So *hack*hack* it into temporarily player 0.
Darkvater
parents:
1834
diff
changeset
|
505 |
* the other parties won't be able to execute our command and will desync. |
5067
f3816e74ad32
(svn r7125) -Fix: Several errors/glitches related to multiplayer and bankrupcy, mainly such a
Darkvater
parents:
4850
diff
changeset
|
506 |
* We also need to do this if the server's company has gone bankrupt |
f3816e74ad32
(svn r7125) -Fix: Several errors/glitches related to multiplayer and bankrupcy, mainly such a
Darkvater
parents:
4850
diff
changeset
|
507 |
* @todo Rewrite (dedicated) server to something more than a dirty hack! |
1838
4aed9afd0744
(svn r2343) - Fix (regression): dedicated server caused desyncs with its commands, because the player sent over the network is OWNER_SPECTATOR as well, which on clients cannot execute anything. So *hack*hack* it into temporarily player 0.
Darkvater
parents:
1834
diff
changeset
|
508 |
*/ |
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
534
diff
changeset
|
509 |
if (_networking && !(cmd & CMD_NETWORK_COMMAND)) { |
5067
f3816e74ad32
(svn r7125) -Fix: Several errors/glitches related to multiplayer and bankrupcy, mainly such a
Darkvater
parents:
4850
diff
changeset
|
510 |
PlayerID pbck = _local_player; |
5587
167d9a91ef02
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5584
diff
changeset
|
511 |
if (_network_dedicated || (_network_server && pbck == PLAYER_SPECTATOR)) _local_player = PLAYER_FIRST; |
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
534
diff
changeset
|
512 |
NetworkSend_Command(tile, p1, p2, cmd, callback); |
5067
f3816e74ad32
(svn r7125) -Fix: Several errors/glitches related to multiplayer and bankrupcy, mainly such a
Darkvater
parents:
4850
diff
changeset
|
513 |
if (_network_dedicated || (_network_server && pbck == PLAYER_SPECTATOR)) _local_player = pbck; |
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
534
diff
changeset
|
514 |
_docommand_recursive = 0; |
1820
d03c56850dc2
(svn r2324) Introduce _cmd_text for passing strings with a command instead of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes.
tron
parents:
1804
diff
changeset
|
515 |
_cmd_text = NULL; |
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
534
diff
changeset
|
516 |
return true; |
0 | 517 |
} |
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
534
diff
changeset
|
518 |
#endif /* ENABLE_NETWORK */ |
0 | 519 |
|
6123
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
520 |
/* update last build coordinate of player. */ |
4850
93095755db8c
(svn r6776) -Codechange: Use IsValidPlayer() function to determine of a PlayerID is an
Darkvater
parents:
4848
diff
changeset
|
521 |
if (tile != 0 && IsValidPlayer(_current_player)) { |
4000
4009d092b306
(svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
tron
parents:
3991
diff
changeset
|
522 |
GetPlayer(_current_player)->last_build_coordinate = tile; |
4009d092b306
(svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
tron
parents:
3991
diff
changeset
|
523 |
} |
0 | 524 |
|
889
64d2f7d5f02b
(svn r1375) -Fix: [1050990] Buying trains sometimes accounted for incorrectly. Was the result of the cost getting reset in a recursive call of docommand. That is fixed. In addition all cost-commands are typed explicitely. Please do not forget to do so or your costs will be credited to construction if you are unlucky.
darkvater
parents:
842
diff
changeset
|
525 |
/* Actually try and execute the command. If no cost-type is given |
64d2f7d5f02b
(svn r1375) -Fix: [1050990] Buying trains sometimes accounted for incorrectly. Was the result of the cost getting reset in a recursive call of docommand. That is fixed. In addition all cost-commands are typed explicitely. Please do not forget to do so or your costs will be credited to construction if you are unlucky.
darkvater
parents:
842
diff
changeset
|
526 |
* use the construction one */ |
64d2f7d5f02b
(svn r1375) -Fix: [1050990] Buying trains sometimes accounted for incorrectly. Was the result of the cost getting reset in a recursive call of docommand. That is fixed. In addition all cost-commands are typed explicitely. Please do not forget to do so or your costs will be credited to construction if you are unlucky.
darkvater
parents:
842
diff
changeset
|
527 |
_yearly_expenses_type = EXPENSES_CONSTRUCTION; |
4000
4009d092b306
(svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
tron
parents:
3991
diff
changeset
|
528 |
res2 = proc(tile, flags | DC_EXEC, p1, p2); |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
147
diff
changeset
|
529 |
|
6123
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
530 |
/* If notest is on, it means the result of the test can be different than |
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
531 |
* the real command.. so ignore the test */ |
652
206a7c2016ba
(svn r1085) -Fix: [Network] [ 1084834 ] If IF_IN_NETWORK flag was on, an error
truelight
parents:
601
diff
changeset
|
532 |
if (!notest && !((cmd & CMD_NO_TEST_IF_IN_NETWORK) && _networking)) { |
0 | 533 |
assert(res == res2); // sanity check |
534 |
} else { |
|
1702
be148d0fbf9d
(svn r2206) - Regression Fix: slight typo of res2 into res, this also fixes recent bug "[ 1183396 ] Train can't find depot, it gives money in Multiplayer"
Darkvater
parents:
1701
diff
changeset
|
535 |
if (CmdFailed(res2)) { |
0 | 536 |
if (res2 & 0xFFFF) _error_message = res2 & 0xFFFF; |
537 |
goto show_error; |
|
538 |
} |
|
539 |
} |
|
540 |
||
541 |
SubtractMoneyFromPlayer(res2); |
|
542 |
||
2425
e755ee29133a
(svn r2951) - Fix: [ 1259345 ] Changing engine in netgame opens train window for everyone
Darkvater
parents:
2304
diff
changeset
|
543 |
if (IsLocalPlayer() && _game_mode != GM_EDITOR) { |
4000
4009d092b306
(svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
tron
parents:
3991
diff
changeset
|
544 |
if (res2 != 0) ShowCostOrIncomeAnimation(x, y, GetSlopeZ(x, y), res2); |
0 | 545 |
if (_additional_cash_required) { |
534
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
507
diff
changeset
|
546 |
SetDParam(0, _additional_cash_required); |
6491
00dc414c909d
(svn r9672) -Cleanup: lots of coding style fixes around operands.
rubidium
parents:
6453
diff
changeset
|
547 |
ShowErrorMessage(STR_0003_NOT_ENOUGH_CASH_REQUIRES, error_part1, x, y); |
0 | 548 |
if (res2 == 0) goto callb_err; |
549 |
} |
|
550 |
} |
|
551 |
||
552 |
_docommand_recursive = 0; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
147
diff
changeset
|
553 |
|
0 | 554 |
if (callback) callback(true, tile, p1, p2); |
1820
d03c56850dc2
(svn r2324) Introduce _cmd_text for passing strings with a command instead of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes.
tron
parents:
1804
diff
changeset
|
555 |
_cmd_text = NULL; |
0 | 556 |
return true; |
557 |
||
558 |
show_error: |
|
6123
04eb770ec17e
(svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6012
diff
changeset
|
559 |
/* show error message if the command fails? */ |
3182
0cec126ca9a9
(svn r3827) Remove the global variable _error_message_2, it's only used as local variable
tron
parents:
2820
diff
changeset
|
560 |
if (IsLocalPlayer() && error_part1 != 0) { |
6491
00dc414c909d
(svn r9672) -Cleanup: lots of coding style fixes around operands.
rubidium
parents:
6453
diff
changeset
|
561 |
ShowErrorMessage(_error_message, error_part1, x, y); |
3182
0cec126ca9a9
(svn r3827) Remove the global variable _error_message_2, it's only used as local variable
tron
parents:
2820
diff
changeset
|
562 |
} |
0 | 563 |
|
564 |
callb_err: |
|
565 |
_docommand_recursive = 0; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
147
diff
changeset
|
566 |
|
0 | 567 |
if (callback) callback(false, tile, p1, p2); |
1820
d03c56850dc2
(svn r2324) Introduce _cmd_text for passing strings with a command instead of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes.
tron
parents:
1804
diff
changeset
|
568 |
_cmd_text = NULL; |
0 | 569 |
return false; |
570 |
} |