forked from External/grumble
Move channel implementation to its own file. Make VoiceBroadcast work.
This commit is contained in:
parent
37262d6889
commit
8a836ac3af
4 changed files with 83 additions and 22 deletions
11
client.go
11
client.go
|
|
@ -40,6 +40,7 @@ type Client struct {
|
|||
Session uint32
|
||||
Username string
|
||||
Tokens []string
|
||||
Channel *Channel
|
||||
}
|
||||
|
||||
// Something invalid happened on the wire.
|
||||
|
|
@ -48,11 +49,13 @@ func (client *Client) Panic(reason string) {
|
|||
}
|
||||
|
||||
func (client *Client) Disconnect() {
|
||||
client.disconnected = true
|
||||
close(client.udprecv)
|
||||
close(client.msgchan)
|
||||
if !client.disconnected {
|
||||
client.disconnected = true
|
||||
close(client.udprecv)
|
||||
close(client.msgchan)
|
||||
|
||||
client.server.RemoveClient(client)
|
||||
client.server.RemoveClient(client)
|
||||
}
|
||||
}
|
||||
|
||||
// Read a protobuf message from a client
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue