[Package Index | Mudlib Index | Effect Index]

File /obj/handlers/inherit/club_basic.c

This is the handler for all things clubby, a club being a group of players. Each club must have a unique name. It also handles elections for various club positions.

Written by Pinkfish

Started Sun Sep 27 03:35:42 EDT 1998

Includes

This class includes the following files /include/player_handler.h, /include/am_time.h, /include/broadcaster.h and /include/clubs.h

Class Index

Method index

Public Functions

These are functions that everyone can access.

add_member
int add_member(string name,
               string member)

This method adds a member to the club.

Parameters:
name - the name of the club to add the recruiter to
member - the member of the club to add

Returns:
1 on success, 0 on failure

See also:
add_recruiter(), query_recruiters(), query_members() and remove_member()


add_money
int add_money(string name,
              int amount,
              int type,
              string person,
              string account)

This method will pay a certain amount of money to club. This will be how long the club is payed until. The club will cost a certain amount for each member as well as a base cost.

Parameters:
name - the name of the club
amount - the amount to change the balance by
type - the tyope of the transaction
person - the person removeing the money
account - the account the money is coming from

Returns:
the amount of money not able to be placed in the account

See also:
remove_money(), query_balance() and query_transactions()


add_observer
int add_observer(string obs)

Adds an objec to the list to be informed of changes about the clubs.

Parameters:
obs - the name of the object to inform of changes

Returns:
1 on success, 0 on failure


add_recruiter
int add_recruiter(string name,
                  string recruiter)

This method adds a recruiter to the club. A recruiter can only be added if they are already a member.

Parameters:
name - the club name to add the recruiter to
recruiter - the recruiter of the club to add

Returns:
1 on success, 0 on failure

See also:
remove_recruiter(), query_recruiters() and add_member()


change_club_cap_name
int change_club_cap_name(string club_name)

this method changes the capitalization of a clubs name.

Parameters:
the - new capitalization for the name

Returns:
1 on success, 0 on failure


change_club_type
int change_club_type(string name,
                     int type)

This method changes the type of the club.

Parameters:
name - the name of the club to change
type - the new type of the club

Returns:
1 on success, 0 on failure

See also:
create_club(), disband_club() and query_club_type()


check_extra_information
void check_extra_information(string club_name,
                             string member,
                             int login)
create_account
int create_account(string name,
                   string account)

This method creates an account in the club.

Parameters:
name - the name of the club
account - the name of the account


create_club
int create_club(string name,
                string founder,
                int type,
                string region)

This method creates a club. The founder and the recruiter set is initialy set to the founder.

Parameters:
name - the name of the club
founder - the founder of the club
region - the region of the club

Returns:
1 was able to create the club, 0 if unable to create the club

See also:
disband_club() and change_club_type()


disband_club
int disband_club(string name)

This method disbands the club. The club will be totaly zapped and everything about it efficently munched.

Parameters:
name - the name of the club to disband

Returns:
1 on success, 0 on failure

See also:
create_club() and check_extra_infromation()


is_account_of
int is_account_of(string club_name,
                  string account)

This method checks to see if the account exists for the club.

Parameters:
club_name - the name of the name
account - the name of the account to checlk

Returns:
1 if it exists, 0 if it does not


is_club
int is_club(string name)

This method checks to see if the specified club exists.

Parameters:
name - the name of the club to check for existance

Returns:
1 if it is a club, 0 if not

See also:
query_club_name()


is_creator_club
int is_creator_club(string club_name)

This method determines if the club is a creator club or not. A club is considered a creator club if the founder was a creator when they founded it.

Parameters:

Returns:
1 if is a creator club, 0 if not


is_elected_club
int is_elected_club(string name)

This method checks to see if the specified club exists and is an elected club.

Parameters:
name - the name of the club to check to see for an elected type

Returns:
1 if the club is an elected type


is_family
int is_family(string name)

This method checks to see if the club type is actually a family.

Parameters:
name - the name of the family to check

Returns:
1 if the club is a family


is_founder_of
int is_founder_of(string name,
                  string founder)

This method will determine if the specified person is the founder of the club.

Parameters:
name - the name of the club to check the founder of
founder - the person to check for being the founder

Returns:
1 if they are in the position, 0 if not

See also:
create_club()


is_member_of
int is_member_of(string name,
                 string member)

This method will determine if the specified person is a member of the club.

Parameters:
name - the name of the club to find the member of
member - the member to check for the existance of

Returns:
1 if they are a member, 0 if they are not


is_observer
int is_observer(string obs)

This method checks to see if the specified thingy is an observer.

Parameters:
obs - the observer to check

Returns:
1 on success, 0 on failure


is_personal_club
int is_personal_club(string name)

This method checks to see if the specified club exists and is an personal club.

Parameters:
name - the name of the club to check to see for an personal type

Returns:
1 if the club is an personal type


is_recruiter_of
int is_recruiter_of(string name,
                    string recruiter)

This method will determine if the specified person is a recruiter of the club.

Parameters:
name - the name of the club to find the recruiter of
recruiter - the person is check for the recruiter

Returns:
1 if they are a recruiter, 0 if they are not

See also:
add_recruiter() and remove_recruiter()


normalise_name
string normalise_name(string name)

This method normalises the name for lookups so that we don't get names too confused. Thanks to Terano for this idea.

Parameters:
name - the name to normalise

Returns:
the normalised name


query_account_names
string * query_account_names(string name)

This method returns the names of all the accounts in the club.

Parameters:
club_name - the name of the club

Returns:
the names of all the accounts


query_balance
int query_balance(string name,
                  string account)

This method returns the balance of the club.

Parameters:
name - the name of the club
account - the name of the account

Returns:
the current balance of the club

See also:
pay_money() and remove_money()


query_club_cost_per_period
int query_club_cost_per_period(string club_name)

This method determines how much the club will cost to run each pay period.

Parameters:
club_name - the name of the club to get the fees for

Returns:
the amount the club will cost in the next pay period

See also:
query_time_fees_due()


query_club_description
string query_club_description(string club_name,
                              int public_info)

This method returns the description of the club.

Parameters:
club_name - the name of the club to get the description of
public_info - 1 if we want the public info of secret clubs

Returns:
the club description, 0 if the club is not found

See also:
query_club_name(), create_club() and set_club_description()


query_club_name
string query_club_name(string club_name)

This method returns the capitalised and un messed name of the club.

Parameters:
club_name - the name of the club

Returns:
the un messed name of the club

See also:
is_club()


query_club_office
string query_club_office(string club_name)

This method returns the name of the office from which mails should be sent about club fees and the like based on its region of origin.

Parameters:
club - the name of the club


query_club_office_signatory
string query_club_office_signatory(string club_name)

This method returns the name of the signatory on the bottom of mails from the club office.

Parameters:
club - the name of the club


query_club_region
string query_club_region(string name)

This method returns the region of the club.

Parameters:
name - the name of the club to check

Returns:
the club name


query_club_secret
int query_club_secret(string name)

This method checks to see if the club is secret or not.

Parameters:
name - the name of the club to check for secrecy

Returns:
1 if the club is secret, 0 if not

See also:
set_club_secret()


query_club_type
int query_club_type(string name)

This method returns the club type of the club.

Parameters:
name - the name of the club to get the type of

Returns:
the type of the club

See also:
change_club_type() and create_club()


query_clubs
string * query_clubs()

This method returns the names of all the clubs currently in the list of clubs.

Returns:
the list of current clubs

See also:
create_club() and disband_club()


query_founder
string query_founder(string name)

This method returns the founder of the club.

Parameters:
name - the club name to get the founder of

Returns:
the founder of the club

See also:
create_club()


query_insignia_path
string query_insignia_path(string name)

This method returns the insignia object associated with the club.

Parameters:
name - the name of the club for the insignia object

Returns:
the path of the club insignia object

See also:
create_club()


query_members
string * query_members(string name)

This method returns the members of the club.

Parameters:
name - the members of the club

Returns:
the members of the club

See also:
add_member() and remove_member()


query_observers
string * query_observers()

This method returns the current list of observers.

Returns:
the current list of observers


query_recruiters
string * query_recruiters(string name)

This method returns the recruiters of the club.

Parameters:
name - the club name to get the recruiters of

Returns:
the recruiters of the club

See also:
add_recruiter() and remove_recruiter()


query_time_fees_due
int query_time_fees_due(string club_name,
                        int period)

This method returns the time at which the club dues are again due.

Parameters:
club_name - the name of the club to get the date for
period - the number of periods ahead to look, 0 means the current one

See also:
check_clubs() and query_club_cost_per_period()


remove_account
int remove_account(string name,
                   string account)

This method removes an account in the club. It moves all the money from the special account into the default one.

Parameters:
name - the name of the club
account - the name of the account


remove_member
int remove_member(string name,
                  string member)

This method removes a member from the club.

Parameters:
name - the name of the club to remove a member from
member - the members name to remove

Returns:
1 on success, 0 on failure

See also:
query_members(), add_member() and remove_member()


remove_money
int remove_money(string name,
                 int amount,
                 int type,
                 string person,
                 string account)

This method removes money from the account.

Parameters:
name - the name of the club
amount - the amount to change the balance by
type - the tyope of the transaction
person - the person removeing the money
account - the account the money is coming from

Returns:
1 if the removal is a success

See also:
pay_money(), query_balance() and query_transactions()


remove_observer
int remove_observer(string obs)

This method removes an observer.

Parameters:
obs - the obeserver to remove

Returns:
1 on success, 0 on failure


remove_recruiter
int remove_recruiter(string name,
                     string recruiter)

This method removes a recruiter from the club.

Parameters:
name - the name of the club to remove the member from
recruiter - the recruiter to remove

Returns:
1 on success, 0 on failure

See also:
add_recruiter(), query_recruiters() and add_member()


reset_club_secret
int reset_club_secret(string name)

This method makes a clubs membership open.

Parameters:
name - the name of the club to make open

Returns:
1 on success, 0 on failure

See also:
query_club_secret() and set_club_secret()


set_club_description
int set_club_description(string club_name,
                         string description,
                         int public_info)

This method sets the description of the club.

Parameters:
club_name - the name of the club to set the description of
description - the new description of the club
public_info - 1 if the public info of secret clubs should be set

Returns:
1 on success, 0 on failure

See also:
query_club_description() and create_club()


set_club_secret
int set_club_secret(string name)

This method makes a clubs membership secret.

Parameters:
name - the name of the club to make secret

Returns:
1 on success, 0 on failure

See also:
query_club_secret() and reset_club_secret()


set_creator_club
int set_creator_club(string club,
                     int flag)

This function should only be called for changing the creator_club status of a club due to people going creator or being dismissed.

Parameters:
club - Name of the club
flag - 1 for creator clubs, 0 for normal clubs

Returns:
1 if it was updated, 0 if the club does not exist


set_founder
int set_founder(string club,
                string new_founder)

Creator called function only. Changes the founder of a club/family, although there is no real reason to do so (possible exception is if a non-elected club doesn't get deleted when the founder is deleted and someone takes over the old name... but you should probably just delete the club). If you are worried about the status of a player club after the founder goes cre, it's all taken care of.

Parameters:
club - Name of the club/family
new_founder - New founder of the club/family. Please make it be a member of the club/family.

Returns:
1 if it was updated, 0 if the club does not exist.

See also:
is_creator_club.c and set_creator_club.c


touch_club
void touch_club(string name)

This method touches the club and resets the timeout date. This should be done now and then by the club to make sure it does not timeout.

Parameters:
name - the name of the club to reset the timeout for

See also:
check_clubs()


try_load_club
int try_load_club(string name)

Purely for debugging: Try to force-load a club that isn't loading.

Returns:
2 if the club was already in the controller, 1 it was force loaded, 0 if it couldn't be loaded


Protected Functions

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

create_extra_data
void create_extra_data(string name)
load_main
void load_main()

This method loads the data from the disk.
query_club_info
class club_info query_club_info(string name)

This method either loads the data into the cache or it reads it from the cache.
save_cache
void save_cache()

This method checks the cache and then saves anything changed to the disk...
save_club
void save_club(string name)

This method saves the data to the disk.
save_main
void save_main()

This method loads the data from the disk.
send_broadcast_message
void send_broadcast_message(string club,
                            string message)

This method sends a broadcast to the clubs talker channel.

Parameters:
club - the name of the club to send the message to
mess - the message to send


send_observer_event
void send_observer_event(string event_name,
                         string * args ...)

This method calls a function on all the observers to tell them when an event has taken place.

Parameters:
event_name - the name of the event
args - the arguments to the event


set_club_changed
void set_club_changed(string name)

This method marks the club as being changed.

Classes

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