MumbleKit
 All Classes Functions
List of all members
MKServerModel Class Reference

#import <MumbleKit/MKServerModel.h>

Inheritance diagram for MKServerModel:
<MKMessageHandler>

Instance Methods

Initialization


(id) - initWithConnection:
 
Handling delegates


(void) - addDelegate:
 
(void) - removeDelegate:
 
Server Information


(NSString *) - hostname
 Returns the hostname of the server that the MKServerModel is currently connected to.
 
(NSInteger) - port
 Returns the port of the server that the MKServerModel is currently connected to.
 
Users operations


(MKUser *) - connectedUser
 Returns the connected user. The connected user is the user that.
 
(MKUser *) - userWithSession:
 
(MKUser *) - userWithHash:
 
Channel operations


(MKChannel *) - rootChannel
 
(MKChannel *) - channelWithId:
 
(void) - joinChannel:
 
(void) - createChannelWithName:parent:temporary:
 
(void) - requestAccessControlForChannel:
 
(void) - setAccessControl:forChannel:
 
Text message operations


(void) - sendTextMessage:toTreeChannels:andChannels:andUsers:
 
(void) - sendTextMessage:toTree:
 
(void) - sendTextMessage:toChannel:
 
(void) - sendTextMessage:toUser:
 
Server operations


(void) - setAccessTokens:
 
(NSArray *) - serverCertificates
 Get the server's certificate chain.
 
(BOOL) - serverCertificatesTrusted
 Get whether or not the certificate chain is verified by the system's root CAs.
 
Mute/deafen operations


(void) - setSelfMuted:andSelfDeafened:
 
Self Registration


(void) - registerConnectedUser
 Registers the currently connected user with the server.
 
- Instance Methods inherited from <MKMessageHandler>
(void) - connection:handleBanListMessage:
 
(void) - connection:handleServerSyncMessage:
 
(void) - connection:handlePermissionDeniedMessage:
 
(void) - connection:handleUserStateMessage:
 
(void) - connection:handleUserRemoveMessage:
 
(void) - connection:handleChannelStateMessage:
 
(void) - connection:handleChannelRemoveMessage:
 
(void) - connection:handleTextMessageMessage:
 
(void) - connection:handleACLMessage:
 
(void) - connection:handleQueryUsersMessage:
 
(void) - connection:handleContextActionMessage:
 
(void) - connection:handleContextActionModifyMessage:
 
(void) - connection:handleUserListMessage:
 
(void) - connection:handleVoiceTargetMessage:
 
(void) - connection:handlePermissionQueryMessage:
 

Detailed Description

MKServerModel wraps an MKConnection and acts as its message handler. It provides an easy to use interface for interacting with a Mumble server.

Method Documentation

- (void) addDelegate: (id)  delegate

Add a delegate. The delegate may only implement parts of the MKServerModelDelegate protocol.

Parameters
delegateThe delegate to add.
- (MKChannel *) channelWithId: (NSUInteger)  channelId

Look up a channel by its channel ID.

Parameters
channelIdThe channel ID to look up.
- (void) createChannelWithName: (NSString *)  channelName
parent: (MKChannel *)  parent
temporary: (BOOL)  temp 

Create a new channel in the server the underlying MKConnection is currently connected to.

Parameters
channelNameThe name of the channel to create.
parentThe MKChannel that must contain the newly created one.
tempSpecify if the channel is temporary or not.
- (id) initWithConnection: (MKConnection *)  connection

Initialize a MKServerModel with the given connection.

Parameters
connectionThe connection that the MKServerModel should handle.
- (void) joinChannel: (MKChannel *)  channel

Ask the underlying connection to join the given channel.

Parameters
channelThe channel to join.
- (void) removeDelegate: (id)  delegate

Remove a delegate from the MKServerModel.

Parameters
delegateThe delegate to remove.
- (void) requestAccessControlForChannel: (MKChannel *)  channel

Ask the underlying connection to receive the access control for the given channel.

Parameters
channelThe channel for which you are requesting the access control.
- (MKChannel *) rootChannel

Get the root channel of the server the underlying MKConnection is currently connected to.

Returns
Returns a MKChannel object pointing to the root channel.
- (void) sendTextMessage: (MKTextMessage *)  txtMsg
toChannel: (MKChannel *)  chan 

Send a message to all users in the the channel chan.

Parameters
txtMsgThe text message to send.
chanThe destination channel.
- (void) sendTextMessage: (MKTextMessage *)  txtMsg
toTree: (MKChannel *)  chan 

Send a message to all users in the channel chan and all of its descendants (subchannels, children of subchannels, and so on).

Parameters
txtMsgThe text message to send.
chanThe destination channel.
- (void) sendTextMessage: (MKTextMessage *)  txtMsg
toTreeChannels: (NSArray *)  trees
andChannels: (NSArray *)  channels
andUsers: (NSArray *)  users 

Send a text message to the given destinations.

One, or multiple of tree, channels and users must be passed to the method.

Sending a message to a chnanel is the same as sending to all users in that channel; receivers cannot distinguish between receiving a 'channel' message, and a message specifically targetted at them.

Parameters
txtMsgThe text message to send.
treesAn NSArray of MKChannel objects (or nil). The message will be sent to all channels in this array, and recursively to their descendants (subchannels, children of subchannels, and so on).
channelsAn NSArray of MKChannel objects (or nil). The message will be sent to all channels in this array.
usersAn NSArray of MKUser objects (or nil).
- (void) sendTextMessage: (MKTextMessage *)  txtMsg
toUser: (MKUser *)  user 

Send a message to the user user.

Parameters
txtMsgThe text message to send.
userThe user to send the message to.
- (void) setAccessControl: (MKAccessControl *)  accessControl
forChannel: (MKChannel *)  channel 

Set access control for a channel.

Parameters
aclThe access control you want to set.
channelThe channel for which you are setting the access control.
- (void) setAccessTokens: (NSArray *)  tokens

Set the list of access tokens for the currently connected user.

Parameters
tokensAn NSArray of strings containing the tokens to use as access tokens for the connected user.
- (MKUser *) userWithHash: (NSString *)  hash

Look up a user by hash. Most commonly, the hash of a user is the SHA1 digest of their X.509 certificate.

Parameters
hashThe hash to look up. (Typically a hex-encoded SHA1 digest).
Returns
Returns the user with the given hash. Returns nil if the user does not exist on the server.
- (MKUser *) userWithSession: (NSUInteger)  session

Look up a user by session ID.

Parameters
sessionThe session ID to look up.
Returns
Returns the user with the given session ID. Returns nil if the user does not exist on the server.

The documentation for this class was generated from the following file: