FEAT(server): Flag bot connections, so user count does not get inflated by them #5948
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.
Extended Authenticate message by int
client_type
inMumble.proto
so server knows what type of connection it is(for now it's just 0 forREGULAR
and 1 forBOT
). Next I created header file calledClientType.h
where I define enum class for types of connections. This enum is easily extendable for any special connection types in future.In
Server.h
I extended Server class bym_botCount
attribute.In
Messages.cpp
I extendedmsgAuthenticate
function by a check at the end before authentication log that checks whether connection type is regular or bot and if it's a bot then it incrementsm_botCount
by one. It also setsclient_type
forServerUser
.Before disconnect in
Server.cpp
I check ifServerUser
isBOT
and if yes I decrementm_botCount
by one. In the final user count,m_botCount
gets subtracted from the user count to show real user count.Implements #5461
Checks