Implement AP_SetTags - #45
Conversation
| void AP_SetTags(std::vector<std::string> const& tags) | ||
| { | ||
| lib_room_info.tags = tags; | ||
| if (!multiworld) return; |
There was a problem hiding this comment.
Move this to the top of the function.
Also, the function should probably be guarded by auth, since we don't want a ConnectUpdate before Connect
EDIT: On the same note, might make sense to call it "UpdateTags" instead then
There was a problem hiding this comment.
the updating of the tags is specifically not below the guard so that the function acts locally the same no matter if connected to a server or not, so that client code checking for the existence of these tags doesn't need to be aware if a server exists or not, I'm not even sure it can be aware of that as is right now.
An auth guard wasn't included as no other function but APSend implements one.
I can still implement these changes, just want to make sure that they are desired given the reasoning behind them.
There was a problem hiding this comment.
No, thats a good point. Better to leave it at that, just rename the function.
Implements a function to update server connection tags.
Many client protocols like DamageLink and RingLink as well as DamageLinkGroups rely on setting tags to receive bounce packets. As it is currently, without modifications the API is limited to protocols directly supported by the APCpp library. The aim of this PR is to add the option to handle these in the actual client code.
For this purpose the function also modifies the local room info tags so code that changes these tags can be aware of which tags are already added and does not override them unintentionally as AP doesn't send a proper response packet to update the local state.