tweak(gamemessage): Remove unused MSG_AREA_SELECTION message from game logic#2667
Conversation
|
| Filename | Overview |
|---|---|
| Generals/Code/GameEngine/Include/Common/MessageStream.h | Splits MSG_AREA_SELECTION_HINT into MSG_BEGIN/END_AREA_SELECTION_HINT (hints section) and renames MSG_AREA_SELECTION to MSG_AREA_SELECTION_DEPRECATED (network section). Network enum safety preserved by fixed-value anchor at 1000. Minor tab/space alignment inconsistency on new lines. |
| GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h | Mirror of Generals header changes. Same alignment inconsistency on new enum entries. |
| Generals/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp | Updates case handlers to MSG_BEGIN/END_AREA_SELECTION_HINT and correctly adds DESTROY_MESSAGE to both, preventing hint messages from propagating to the network layer. Comment updated to reflect new naming. |
| GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp | Mirror of Generals HintSpy changes — correct and clean. |
| Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp | Replaces all MSG_AREA_SELECTION_HINT emissions with MSG_BEGIN_AREA_SELECTION_HINT and MSG_AREA_SELECTION emissions with MSG_END_AREA_SELECTION_HINT. Selection logic completes before messages are appended, so DESTROY_MESSAGE in HintSpy is safe. |
| GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp | Mirror of Generals SelectionXlat changes — correct and clean. |
| Generals/Code/GameEngine/Source/Common/MessageStream.cpp | Updates getCommandTypeAsString to reflect new enum names — straightforward and correct. |
| GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp | Mirror of Generals MessageStream.cpp changes — straightforward and correct. |
Sequence Diagram
sequenceDiagram
participant User as Mouse Input
participant SX as SelectionXlat
participant HS as HintSpy
participant UI as InGameUI
participant Net as Network Layer
Note over SX,Net: During drag (mouse move)
User->>SX: Mouse drag event
SX->>SX: appendMessage(MSG_BEGIN_AREA_SELECTION_HINT)
SX->>HS: MSG_BEGIN_AREA_SELECTION_HINT
HS->>UI: beginAreaSelectHint()
HS-->>Net: DESTROY_MESSAGE (never reaches network)
Note over SX,Net: On mouse release (area confirmed)
User->>SX: Mouse up event
SX->>SX: Perform selection logic
SX->>SX: appendMessage(MSG_END_AREA_SELECTION_HINT)
SX->>HS: MSG_END_AREA_SELECTION_HINT
HS->>UI: endAreaSelectHint()
HS-->>Net: DESTROY_MESSAGE (never reaches network)
Note over Net: MSG_AREA_SELECTION_DEPRECATED remains in enum (value ge 1000) but is never emitted
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
Generals/Code/GameEngine/Include/Common/MessageStream.h:419
**Inconsistent whitespace alignment in new enum entries**
The two new lines use spaces for column-alignment instead of tabs, breaking consistency with surrounding entries. `MSG_END_AREA_SELECTION_HINT` uses 4 spaces before `///<` while every other entry in this block uses a tab. Similarly, `MSG_AREA_SELECTION_DEPRECATED` uses spaces. The same pattern appears in `GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h`.
Reviews (5): Last reviewed commit: "Replicated in Generals." | Re-trigger Greptile
|
I could make the following changes if that's cleaner:
|
xezon
left a comment
There was a problem hiding this comment.
The disconnect in grouping for the 2 Area select messages is confusing.
For consistency with other discarded hint messages.
|
Replicated in Generals. |
GameMessage::MSG_AREA_SELECTIONis currently passed on to the game logic (and sent to other clients), but it isn't used for anything. This PR changes that so that it isn't sent to other clients anymore.I've tested with two local clients in multiplayer (VS22 debug builds); one had this feature and one didn't, and everything worked fine.
TODO: