[Package Index | Mudlib Index | Effect Index]

File /obj/handlers/title_handler.c

This handler will keep track of special player titles. It will allow them to be added or removed based on specific events. Use the include to get the path to this file.

Written by Pinkfish

Started Wed Sep 27 14:00:31 PDT 2000

Includes

This class includes the following files /include/player_handler.h, /include/login.h and /include/login_handler.h

Class Index

Method index

Public Functions

These are functions that everyone can access.

add_controlled_title
void add_controlled_title(string title,
                          string ob,
                          string func)

Add a method to be called to check if the person is allowed to have the specified title. This should be added to control things like special titles.

Parameters:
title - the title to control
ob - the object to call the method on
function - the function to call

Example:
add_controlled_title("magistrate", NOMIC_HANDLER, "is_magistrate_somewhere");

add_title_to_player
void add_title_to_player(string person,
                         string title)

This method adds a person to the pending list for gaining a specific title. If the person is currently on then they will get the title immediately. If they are not on then it will be added to them when they next log on.

Parameters:
person - the person to give the title too
title - the title to give them


check_player
void check_player(object player)

This method checks a player when they logon for titles.

Parameters:
player - the player to check


is_allowed_multiple_title
int is_allowed_multiple_title(string title)

This method checks to see if the title is an allowed multiple title.

Parameters:
title - the title to check

Returns:
1 if it is allowed, 0 if not


query_allowed_multiple_titles
string * query_allowed_multiple_titles()

This method returns the list of allowed multiple titles.

Returns:
the list of allowed multiple titles


query_pending_titles
string * query_pending_titles(string person)

This method returns the list of titles pending for the specific person.

Parameters:
person - the person to get the titles for

Returns:
the array of pending titles


remove_forced_title_from_player
void remove_forced_title_from_player(string person,
                                     string title)

This method removes a forced title from a player, if they are on currently it immediately updates them, otherwise it waits for them to login. It checks to make sure the title being removed is the current one.

Parameters:
person - the person to apply the title too
title - the title to remove from them


set_forced_title_on_player
void set_forced_title_on_player(string person,
                                string title,
                                int timeout)

This method adds a forced title onto a player, if they are on currently it immediately updates them, otherwise it waits for them to login.

Parameters:
person - the person to apply the title too
title - the title to force on them
timeout - the timeout to apply to the title


Protected Functions

These are functions that only objects inheriting the class can access.

query_controlled_title
class blob query_controlled_title(string title)

This method returns the blob for the controlled title.

Parameters:
title - the title which is controlled

Returns:
the blob for the controlled title


Classes

These are nice data types for dealing with... Data!