Commit graph

77 commits

Author SHA1 Message Date
Chris Rhodes
c5a94de19c Silence missing voice op codes. 2016-11-11 08:20:00 -08:00
Jonathan
374c41e753 fix typo 2016-09-20 15:33:08 +02:00
Bruce Marriner
a97d89e1de Fix param to ChannelVoiceJoin 2016-07-11 22:17:56 -05:00
Bruce Marriner
2ebf8bdb10 Removed unneeded code. 2016-07-07 21:07:26 -05:00
Bruce Marriner
bbce2612b0 simi-properly close websockets and simplify voice reconnect 2016-07-06 20:31:47 -05:00
Bruce Marriner
45ffd8c83a Removed extra logging 2016-07-06 12:53:11 -05:00
Bruce Marriner
7393438ea8 Put wait var back in. 2016-07-05 21:42:10 -05:00
Bruce Marriner
956961ac3e Simplify reconnect code. 2016-07-05 21:38:37 -05:00
Bruce Marriner
604872ed4b Fix error msg 2016-07-05 20:52:54 -05:00
Bruce Marriner
5f983250fe Check that the gateway websocket is ready 2016-06-24 19:42:43 -05:00
Bruce Marriner
e252652fe8 Unlock what you Lock, fool. 2016-06-24 13:42:35 -05:00
Bruce Marriner
3329f87b14 Added lots of temp logs into voice close func 2016-06-24 13:11:25 -05:00
Bruce Marriner
e451cb36c3 Clear SessionID when reconnecting voice
Also added some more logging..
2016-06-17 10:24:15 -05:00
Bruce Marriner
e76dafab78 Do spam unready session error on voice reconnec 2016-06-16 14:53:05 -05:00
Bruce Marriner
c8d01b7f60 Reconnect now does a full disconnect and reconnect
This should hopefully provide a more stable voice connection at the cost
of making reconnects slightly more expensive for both the client and
Discord. This could be changed later once the Discord voice
documentation more clearly defines reconnect rules. Also, a bit of cleanup :)
2016-06-14 10:57:43 -05:00
Bruce Marriner
71c172a948 Clean up. 2016-06-04 20:18:56 -05:00
Bruce Marriner
7039cc47dc Reconnect to voice gateway instead of.. 2016-05-28 14:58:44 -05:00
Bruce Marriner
32aa5718d1 Fix loop in voice reconnect 2016-05-28 10:50:18 -05:00
Bruce Marriner
754d64d339 Initial code to support voice reconnecting
Also includes some logging improvements and a small fix to track
speaking state and to send speaking packet if needed before sending
opus packets.
2016-05-26 19:35:17 -05:00
Harmon758
2175a62cad Update deaf and mute as well 2016-05-25 10:41:18 -05:00
Harmon758
78113398e5 Update ChannelID in ChangeChannel 2016-05-25 10:04:38 -05:00
Bruce Marriner
aede29500f Added entire voice struct for debugging 2016-05-03 09:35:59 -05:00
Bruce Marriner
cb9e30670f no concurrent writes to voice ws, log cleanup 2016-05-01 19:54:28 -05:00
Bruce Marriner
dd69a7e27f Added logging statements 2016-04-28 09:27:57 -05:00
Bruce Marriner
fc7ce3db94 Initial add of new logging system
This adds a LogLevel setting for both Websocket and VoiceConnections
that can be configured to set the specific log level desired. This
also adds a new logging function that adds additional helpful
information when printing out log messages.
2016-04-26 21:17:51 -05:00
Bruce Marriner
4cac19c3f9 Do not start udp listener if deaf.
If you call VoiceChannelJoin and set deaf to true
then the library will not start a udp listener
2016-04-25 22:00:30 -05:00
Bruce Marriner
6c0b89965c slightly better handling of voice disconnects
We now check if  the voice connection disconencted
due to a call to Voice.Close() and if so it does not
emit an error message.
2016-04-25 21:33:22 -05:00
Bruce Marriner
1a672823a2 Lint and Cleanup 2016-04-11 18:54:19 -05:00
jonas747
d1f25d8561 Changed fmt.Print to log.Print 2016-03-21 17:13:39 +01:00
Chris Rhodes
584b06aae5 Support VoiceSpeakingUpdates on VoiceConnection. 2016-03-18 10:50:25 -07:00
Bruce Marriner
7bbcfe7e0e Add a timeout loop to voice open to wait for SessionID
This doesn't always in the same order I had been told.  It is possible
that it will come slightly after open function is called so we need
to give it a few ms to come in before we open the voice websocket
connection.  How this is done may change later to a channel :)
2016-03-18 07:58:01 -05:00
Bruce Marriner
9648705e77 Moving things around.. 2016-03-17 16:15:59 -05:00
Bruce Marriner
b1ac010731 Unexported WaitUntilConnected
This isn't needed now that the ChannelVoiceJoin waits
for the connection before returning, or returns an error.
2016-03-17 15:57:40 -05:00
Bruce Marriner
513facf391 More cleanup, moving things around.. 2016-03-17 15:54:07 -05:00
Bruce Marriner
cab4964d3a Unexported OP2, no longer needed by dgvoice. 2016-03-17 14:43:19 -05:00
Bruce Marriner
3ffbbdcc56 Unexport UDPConn as it is no longer needed externally. 2016-03-17 14:39:55 -05:00
Bruce Marriner
55274d30bd Removed Receive flag for now, for simplicity.
This can be re-eval'd later once the basic API is stable
2016-03-17 14:32:10 -05:00
Bruce Marriner
0c3d957330 Little cleanup, moved funcs around. 2016-03-17 14:30:58 -05:00
Bruce Marriner
397d04b1ff Fix a couple bugs I just created. 2016-03-17 14:02:19 -05:00
Bruce Marriner
706fd1c03f Separated Close into two functions, added deaf/mute to ChangeChannel
This is requried because if a guild changes it's voice region
while we're connected we need to take down the udp/ws connections
and re-connect without disconnecting from the voice channel.
2016-03-17 13:34:15 -05:00
Bruce Marriner
50cc4df965 Some, slightly messy, fixes to get voice -working-. 2016-03-11 23:19:35 -06:00
andrei
cf222be2f8 Cleanup voice connection on close 2016-03-08 10:47:41 -08:00
andrei
5dc0b9f2a1 Add connect timeout, fix ChannelVoiceJoin "leaking" connections 2016-03-08 02:36:00 -08:00
andrei
b48e8c992e Track voice state changes, expose stuff, add channel changing 2016-03-07 15:41:02 -08:00
andrei
1fc0e2053b Add support for multiple voice connections
With the upcoming API changes, Discord will be allowing bot users to be
onnected to more than one voice channel at a time. This commit is a
first stab at implementing that functionality in discordgo.

Voice works pretty good right now, ideally the next step is to cleanup
some of the channel-spam and weird blocking-spots.
2016-03-05 01:05:18 -08:00
Bruce Marriner
85e06e3e83 Encrypt / Decrypt Voice packets, closes #133 2016-02-24 23:27:56 -06:00
Bruce Marriner
a9306fda00 Removed unreachable return 2016-02-20 17:42:10 -06:00
Bruce Marriner
f832d3da4a Fix so opusSender exits better on close, closes #123 2016-02-19 16:09:16 -06:00
Bruce Marriner
548d61c406 Add ability to cleaned close voice websocket and udp connections 2016-02-18 21:41:37 -06:00
Bruce Marriner
02a6e04b47 Spelling 2016-02-04 11:36:57 -06:00