Make compression optional, clean up some comments and unused fields.
This commit is contained in:
parent
5a3740df0c
commit
fd32614a63
2 changed files with 10 additions and 14 deletions
18
structs.go
18
structs.go
|
@ -72,28 +72,24 @@ type Session struct {
|
||||||
VoiceReady bool // Set to true when Voice Websocket is ready
|
VoiceReady bool // Set to true when Voice Websocket is ready
|
||||||
UDPReady bool // Set to true when UDP Connection is ready
|
UDPReady bool // Set to true when UDP Connection is ready
|
||||||
|
|
||||||
// Other..
|
// The websocket connection.
|
||||||
wsConn *websocket.Conn
|
wsConn *websocket.Conn
|
||||||
//TODO, add bools for like.
|
|
||||||
// are we connnected to websocket?
|
|
||||||
// have we authenticated to login?
|
|
||||||
// lets put all the general session
|
|
||||||
// tracking and infos here.. clearly
|
|
||||||
|
|
||||||
// Everything below here is used for Voice testing.
|
// Stores all details related to voice connections
|
||||||
// This stuff is almost guarenteed to change a lot
|
Voice *Voice
|
||||||
// and is even a bit hackish right now.
|
|
||||||
Voice *Voice // Stores all details related to voice connections
|
|
||||||
|
|
||||||
// Managed state object, updated with events.
|
// Managed state object, updated with events.
|
||||||
State *State
|
State *State
|
||||||
StateEnabled bool
|
StateEnabled bool
|
||||||
StateMaxMessageCount int
|
|
||||||
|
|
||||||
// When nil, the session is not listening.
|
// When nil, the session is not listening.
|
||||||
listening chan interface{}
|
listening chan interface{}
|
||||||
|
|
||||||
|
// Should the session reconnect the websocket on errors.
|
||||||
ShouldReconnectOnError bool
|
ShouldReconnectOnError bool
|
||||||
|
|
||||||
|
// Should the session request compressed websocket data.
|
||||||
|
Compress bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// A VoiceRegion stores data for a specific voice region server.
|
// A VoiceRegion stores data for a specific voice region server.
|
||||||
|
|
2
wsapi.go
2
wsapi.go
|
@ -74,7 +74,7 @@ func (s *Session) Open() (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
err = s.wsConn.WriteJSON(handshakeOp{2, handshakeData{3, s.Token, handshakeProperties{runtime.GOOS, "Discordgo v" + VERSION, "", "", ""}, true}})
|
err = s.wsConn.WriteJSON(handshakeOp{2, handshakeData{3, s.Token, handshakeProperties{runtime.GOOS, "Discordgo v" + VERSION, "", "", ""}, s.Compress}})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue