feat: add CLM request for channel level list (message ID 1028)#3725
Open
mcfnord wants to merge 1 commit into
Open
feat: add CLM request for channel level list (message ID 1028)#3725mcfnord wants to merge 1 commit into
mcfnord wants to merge 1 commit into
Conversation
Adds PROTMESSID_CLM_REQ_CHANNEL_LEVEL_LIST (1028): a connectionless request that causes the server to immediately reply with the existing PROTMESSID_CLM_CHANNEL_LEVEL_LIST (1015) response. This follows the established CLM request/response pattern used by CLReqConnClientsList (1014 → 1013), CLReqVersionAndOS (1012 → 1011), and CLReqServerList (1007 → 1002). The implementation is zero-cost: vecChannelLevels is already computed every server tick in OnTimer(). The handler simply forwards that existing data to the requesting address. Use case: external monitors can poll silence/activity level on any Jamulus server by sending a single UDP datagram to the server's game port, without establishing an audio connection or requiring additional open ports. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
|
Yes, much better! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
PROTMESSID_CLM_REQ_CHANNEL_LEVEL_LIST(ID 1028): a new connectionless message that causes a server to immediately reply with the existingPROTMESSID_CLM_CHANNEL_LEVEL_LIST(ID 1015) response.This follows the established CLM request/response pattern used by:
CLReqConnClientsList(1014) →CLConnClientsList(1013)CLReqVersionAndOS(1012) →CLVersionAndOS(1011)CLReqServerList(1007) →CLServerList(1002)Numbered 1028 because 28 also does this.
Implementation
4 files, 19 lines:
protocol.h— define ID 1028, declare evaluator, declare signalprotocol.cpp— add switch case and one-lineEvaluateCLReqChannelLevelListMesthat emits the signalserver.h— one-lineOnCLReqChannelLevelListslot that calls the existingCreateCLChannelLevelListMesserver.cpp— connect signal to slotZero additional computation.
vecChannelLevelsis already computed every server tick inOnTimer(). The handler simply forwards that existing data to the requester.Use case
A monitoring tool can poll the activity level on any Jamulus server by sending a single UDP datagram to the server's game port and reading the nibble-packed level list in the 1015 response. No audio connection, no additional open ports, no configuration required.
The 1015 response already encodes the number of connected clients implicitly (the list length), so the caller can detect idle servers (no clients) versus quiet ones (clients present but all levels ≤ threshold).
Relation to prior PR
This supersedes #3724.