beyond-all-reason / beyond-all-reason/RecoilEngine

Consider using TO_ALLIES in NETMSG_LUAMSG

Open
#2,372 0 comments 0 reactions 0 assignees View on GitHub
game compat refactor
Dominant language
C++
Stars
679
Forks
290
Avg merge
3d 2h
Merged PRs (30d)
40

Description

In e.g. NETMSG_CHAT, the magic "broadcast to allies/specs/everyone" destination IDs use the named constants `ChatMessage::TO_ALLIES` etc:
https://github.com/beyond-all-reason/RecoilEngine/blob/a134a1f73d4138aa5073b1ba315b2e4778b722e9/rts/Game/ChatMessage.h#L23-L25

But in NETMSG_LUAMSG, it's just verbatim `'a'` or `'s'` chars:
https://github.com/beyond-all-reason/RecoilEngine/blob/a134a1f73d4138aa5073b1ba315b2e4778b722e9/rts/Lua/LuaHandle.cpp#L2379-L2380

Consider whether it would be good to make them use the same values (the big potential downside here is that it's backwards incompatible for replay parsers, but idk whether any parsers actually look at this?) and if so, whether this is applicable in more places.

Contributor guide

Open the contributing guide

Research direction

Start with the constants in rts/Game/ChatMessage.h and the destination characters in rts/Lua/LuaHandle.cpp around NETMSG_LUAMSG. Trace how NETMSG_CHAT and NETMSG_LUAMSG destinations are encoded and check whether replay parsers or other call sites depend on the current values. Done means an explicit compatibility-aware decision on unifying the values and whether other locations should change.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev, networking
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.