Home Previous Up Next Index

ServerAuthenticator

Overview

interface ServerAuthenticator

Callback interface for server authentication. You need to supply one of these for Server::setAuthenticator. If an added callback ever throws an exception or goes away, it will be automatically removed. Please note that unlike ServerCallback and ServerContextCallback, these methods are called synchronously. If the response lags, the entire murmur server will lag. Also note that, as the method calls are synchronous, calling a function from Server or Meta will deadlock the server.

Derived Classes and Interfaces

ServerUpdatingAuthenticator

Operation Index

authenticate
Called to authenticate a player.
nameToId
Map a name to a player id.
idToName
Map a player to a Player id.
idToTexture
Map a player to a custom Texture.

Operations

int authenticate(string name, string pw, out string newname, out GroupNameList groups)

Called to authenticate a player. If you do not know the playername in question, always return -2 from this method to fall through to normal database authentication. Note that if authentication succeeds, murmur will create a record of the player in it's database, reserving the playername and id so it cannot be used for normal database authentication.

Parameters

name
Playername to authenticate.
pw
Password to authenticate with.
newname
Set this to change the playername from the supplied one.
groups
List of groups on the root channel that the player will be added to for the duration of the connection.

Return Value

PlayerID of authenticated player, -1 for authentication failures and -2 for unknown player (fallthrough).

int nameToId(string name)

Map a name to a player id.

Parameters

name
Playername to map.

Return Value

Player id or -2 for unknown name.

string idToName(int id)

Map a player to a Player id.

Parameters

id
Player id to map.

Return Value

Name of player or empty string for unknown id.

Texture idToTexture(int id)

Map a player to a custom Texture.

Parameters

id
Player id to map.

Return Value

User texture or an empty texture for unknwon players or players without textures.


Home Previous Up Next Index