Skip to content

Instantly share code, notes, and snippets.

@mkrautz
Created May 16, 2016 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkrautz/952fddc88e764a4b7179efd4be95f7b6 to your computer and use it in GitHub Desktop.
Save mkrautz/952fddc88e764a4b7179efd4be95f7b6 to your computer and use it in GitHub Desktop.
Methods called from the UDP voice thread:
void Server::run(); // obviously!
bool Server::checkDecrypt(ServerUser *u, const char *encrypt, char *plain, unsigned int len);
void Server::sendMessage(ServerUser *u, const char *data, int len, QByteArray &cache, bool force);
void Server::processMsg(ServerUser *u, const char *data, int len); // via Server::sendMessage() above.
Unsynchronized access:
Server::run:
- User->csCrypt.isValid()
- User->uiSession
- User->sUdpSocket
- User->saiUdpAddress
Server::checkDecrypt
- Validity check at the beginning of the function:
- Various access to u->csCrypt
- isValid
- decrypt()
- tLastGood
- tLastRequest
- User->uiSession
Server::sendMessage
- User->bUdp
- User->sUdpSocket
- User->csCrypt.isValid()
- User->saiUdpAddress
Server::processMsg
User->sState
User->bMute
User->bSuppress
User->bSelfMute
SENDTO macro
- User->bDeaf
- User->bSelfDeaf
- User->ssContext
User->bwr
User->cChannel
BandwidthRecord->addFrame
User->uiSession
Actual transmit functions follow:
target == 0x1f // Server loopback
NONE! other than sendMessage()
target == 0 // Normal speech
Channel->qlUsers
Channel->qhLinks
Channel->allLinks()
OK ChanACL::hasPermission
Whisper (u->qmTargets.contains(target)):
User->qmTargets
User->qmTargetCache
u->qmTargets.value (returns WhisperTarget)
WhisperTarget->qlChannels
qhChannels
WhisperTarget->bLinks
Channel->qhLinks.isEmpty()
WhisperTarget->bChildren
Channel->qlChannels
OK ChanACL::hasPermission
Channel->allLinks()
Channel->allChildren()
User->qmWhisperRedirect
User->qmWhisperRedirect.value()
Channel->qlUsers
Group->isMember()
WhisperTarget->qlSessions
ChanACL::hasPermission
User->uiSession
User->qmTargetCache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment