1
0
Fork 0
forked from External/grumble

Move channel implementation to its own file. Make VoiceBroadcast work.

This commit is contained in:
Mikkel Krautz 2010-11-20 21:55:53 +01:00
parent 37262d6889
commit 8a836ac3af
4 changed files with 83 additions and 22 deletions

View file

@ -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