mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-10-30 19:51:59 +01:00
Two things firmware does that openHop did not. Dispatch by type, not by text. simple_room_server::onPeerDataRecv routes CLI_DATA/CLI_COMMAND to the admin CLI and turns PLAIN into a post; simple_repeater has no chat function, so it runs every accepted type through handleCommand with no text test at all. openHop asked _is_cli_command(message_text) for both, and so got both wrong: a PLAIN "set ..." ran as a command instead of being posted, a command whose text was not in the prefix list was published to the room, and an admin's mistyped repeater command vanished silently instead of being answered. Guard replays. Both servers open the branch with `sender_timestamp >= client->last_timestamp`, treat equality as a retry they accept but do not re-run, and drop anything older. openHop checked neither, so replaying an admin command with the same timestamp and different attempt bits re-executed it -- packet dedup does not catch that because the bytes differ. Note ACL._is_replay is not reusable here: its strict <= rejects the equal case this branch accepts. Both read from packet.decrypted, which openhop_core now publishes. A core too old to report them falls back to the previous text-prefix behaviour and logs a warning rather than dropping every message.