forked from External/grumble
Handle SuperUser login.
This commit is contained in:
parent
47bb4d0025
commit
9036cd64af
3 changed files with 69 additions and 4 deletions
17
client.go
17
client.go
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2010 The Grumble Authors
|
||||
// Copyright (c) 2010-2011 The Grumble Authors
|
||||
// The use of this source code is goverened by a BSD-style
|
||||
// license that can be found in the LICENSE-file.
|
||||
|
||||
|
|
@ -95,6 +95,21 @@ func (client *Client) ForceDisconnect() {
|
|||
client.disconnect(true)
|
||||
}
|
||||
|
||||
// Reject an authentication attempt
|
||||
func (client *Client) RejectAuth(kind, reason string) {
|
||||
var reasonString *string = nil
|
||||
if len(reason) > 0 {
|
||||
reasonString = proto.String(reason)
|
||||
}
|
||||
|
||||
client.sendProtoMessage(MessageReject, &mumbleproto.Reject{
|
||||
Type: mumbleproto.NewReject_RejectType(mumbleproto.Reject_RejectType_value[kind]),
|
||||
Reason: reasonString,
|
||||
})
|
||||
|
||||
client.ForceDisconnect()
|
||||
}
|
||||
|
||||
// Read a protobuf message from a client
|
||||
func (client *Client) readProtoMessage() (msg *Message, err os.Error) {
|
||||
var length uint32
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue