-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mumble tweaks/fixes #3058
base: master
Are you sure you want to change the base?
Mumble tweaks/fixes #3058
Conversation
1c1dbe5
to
55cb212
Compare
55cb212
to
ca7afc8
Compare
This should be ready to be reviewed now, newer changes remove conversions between string types and resets the players mumble connection if the server doesn't respond to TCP pings. |
ca7afc8
to
bad5800
Compare
ebfb2f4
to
33651e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a really nice refactoring. Thank you!
Overall LGTM, just left some style related comments and asked some clarifying questions. PTAL.
It is a big change tho, so before merging we would probably need to tests it on some server.
return g_mumbleClient->GetAudioContext(name); | ||
} | ||
|
||
std::wstring getMumbleName(int playerId) | ||
std::optional<std::string> getMumbleName(int playerId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this seems to be very similar to getAudioContext
. Can we use getMumbleName
in getAudioContext
to avoid duplication?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iirc this was actually needed, getAudioContext
doesn't check for if they're connected before hand, while everywhere that uses getMumbleName
does, we can just do the connected check again if wanted though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I meant is that it seems that we could refactor getAudioContext
as below to reduce some duplication.
static std::shared_ptr<lab::AudioContext> getAudioContext(int playerId)
{
auto name = getMumbleName(playerId);
if (name == nullptr || !IsMumbleConnected())
{
return {};
}
return g_mumbleClient->GetAudioContext(name);
}
442d156
to
aefe578
Compare
…eTarget packet The previous implementation allowed duplicates, and was more complex than what we need since we don't care about channel linking (we would always set it to false) This will also reset connections if they have too many in flight TCP pings This removes all the swaps from std::wstring <-> std::string Send Auth packet immediately after Version In the spec we have to send the Auth packet after Version, we opted to do it whenever we get the version packet back, this isn't really needed and slows down the exchange, since the server will only send `CryptoSetup` after we send this packet.
aefe578
to
fd6fec4
Compare
Goal of this PR
Fix some possible edge cases where players could be invalid but we would still send a properly formatted mumble name
Removes swapping between
std::wstring
andstd::string
Reset the mumble connection in cases where the client loses their TCP connection.
Fix some cases where the client would send duplicates of the same targets to the server, leading to some excessively large packets.
Wrap any native that needs to be used while connected in
MakeMumbleNative
This change set is currently untested
This PR applies to the following area(s)
FiveM, RedM
Successfully tested on
Game builds: ..
Checklist