Home Previous Up Next Index

Murmur::ServerCallback

Overview

interface ServerCallback

Callback interface for servers. You can supply an implementation of this to receive notification messages from the server. If an added callback ever throws an exception or goes away, it will be automatically removed. Please note that all callbacks are done asynchronously; murmur does not wait for the callback to complete before continuing processing. Note that callbacks are removed when a server is stopped, so you should have a callback for MetaCallback::started which calls Server::addCallback.

See Also

MetaCallback
Server::addCallback

Operation Index

userConnected
Called when a user connects to the server.
userDisconnected
Called when a user disconnects from the server.
userStateChanged
Called when a user state changes.
userTextMessage
Called when user writes a text message @param state the User sending the message @param message the TextMessage the user has sent
channelCreated
Called when a new channel is created.
channelRemoved
Called when a channel is removed.
channelStateChanged
Called when a new channel state changes.

Operations

void userConnected(User state)

Called when a user connects to the server.

Parameters

state
State of connected user.

void userDisconnected(User state)

Called when a user disconnects from the server. The user has already been removed, so you can no longer use methods like Server::getState to retrieve the user's state.

Parameters

state
State of disconnected user.

void userStateChanged(User state)

Called when a user state changes. This is called if the user moves, is renamed, is muted, deafened etc.

Parameters

state
New state of user.

void userTextMessage(User state, TextMessage message)

Called when user writes a text message

Parameters

state
the User sending the message
message
the TextMessage the user has sent

void channelCreated(Channel state)

Called when a new channel is created.

Parameters

state
State of new channel.

void channelRemoved(Channel state)

Called when a channel is removed. The channel has already been removed, you can no longer use methods like Server::getChannelState

Parameters

state
State of removed channel.

void channelStateChanged(Channel state)

Called when a new channel state changes. This is called if the channel is moved, renamed or if new links are added.

Parameters

state
New state of channel.

Home Previous Up Next Index