[Package Index | Mudlib Index | Effect Index]

File /obj/handlers/inherit/error_handler.c

This is a handler to keep track of errors, make adding them and querying them easier.

Written by Pinkfish

Started Mon Jun 17 17:28:04 PDT 2002

Includes

This class includes the following files /include/player_handler.h, /include/db.h, /include/cron_handler.h, /include/error_handler.h, /include/playerinfo.h and /include/board.h

Method index

Public Functions

These are functions that everyone can access.

build_sql_update
string build_sql_update(int id,
                        string field,
                        mixed value)

This method builds an sql update from the given inputs.

Parameters:
id - the id of the bug to update
field - the field to update
value - the new value of the field


check_for_stats_update
void check_for_stats_update()

This method checks to see if any of the stats need to be updated or not.
clean_error_handler
void clean_error_handler()
create_error_comment
class error_comment create_error_comment(mapping map)

This method creates the error comment from the input mapping.

Parameters:
map - the mapping to create the comment from

Returns:
the error comment class


create_error_complete
class error_complete create_error_complete(class error_details details)

This method creates the complete error class from the error details passed in.

Parameters:
details - the details to make the complete error from


create_error_details
class error_details create_error_details(mapping map)

This method creates the error details from the return data.
create_error_forward
class error_forward create_error_forward(mapping map)

This method creates the error forward from the input mapping.

Parameters:
map - the mapping to create the forward from

Returns:
the error forward class


create_error_replies
class error_replies create_error_replies(mapping map)

This method creates the error reply class from the sql query.

Parameters:
map - the mapping to convert to the class

Returns:
the nice new error reply class


create_error_summary
class error_summary create_error_summary(mapping map)

This method creates the error summary from the input mapping.

Parameters:
map - the mapping to create the summary from

Returns:
the error summary class


do_add_error_reply
int do_add_error_reply(int bug_id,
                       string from,
                       string to,
                       string subject,
                       string message)

This method adds an error reply into the system. It is used by the bug replies system to add the replies.
do_assign_bug_to
int do_assign_bug_to(int id,
                     string assigned_to,
                     function finished)

This method changes who the bug is assigned to.

Parameters:
id - the id of the bug to change
assigned_to - the person it is assigned to

Returns:
1 on success, 0 on failure


do_change_category
int do_change_category(int id,
                       string category,
                       function finished)

This method changes the category of the bug. The category is in the set 'room', 'object', 'help', 'ritual', 'spell', 'command', 'general'.

Parameters:
id - the id of the bug to update
category - the new category of the bug

Returns:
1 on success, 0 on failure


do_change_status
int do_change_status(int id,
                     string status,
                     int nomail,
                     string subject,
                     string user,
                     string message,
                     function finished)

This method changes the status of the bug, it also automaticaly sends a message to the person who reported the bug and who the bug is assigned to if someone else changes it.

Parameters:
id - the id of the bug to change
status - the new status of the bug
nomail - dont send any mail
user - the user who is making the change
subject - the subject of the mail
message - the main body of the mail

Returns:
0 on failure and 1 on success


do_change_type
int do_change_type(int id,
                   string type,
                   function finished)

This method changes the type of the bug. The type is in the set 'bug', 'typo', 'idea'.

Parameters:
id - the id of the bug to update
type - the new type of the bug

Returns:
1 on success, 0 on failure


do_comment
int do_comment(int id,
               string user,
               string comment,
               function finished)

This method adds a comment into the database.

Parameters:
id - the bug to comment on
user - the user making the comment
comment - the comment to make
finished - the finished function


do_error_replies
int do_error_replies(string recipient,
                     int only_new,
                     function finished)

This method looks for all the error replies for the specific recipient.

Parameters:
recipient - the recipient
only_new - only new messages
finished - the function to call on finishing


do_forward
int do_forward(int id,
               string user,
               string dir,
               function finished)

This method changes the status of the bug, it also automaticaly sends a message to the person who reported the bug and who the bug is assigned to if someone else changes it.

Parameters:
id - the id of the bug to change
user - the user
dir - the directory

Returns:
0 on failure and 1 on success


do_query_bug_details
int do_query_bug_details(int bug_id,
                         function finished)

This method sets up a call to return the details of the error.

Parameters:
bug_id - the id of the bug to get the details from
finished - the function to call when things are finished

Returns:
1 on success, 0 on failure


do_query_bug_summary
int do_query_bug_summary(class error_query query,
                         function finished)

This method sets up a query for the specific data, this returns the bug summary for all the found bugs.

Parameters:
query - the class to use for the query
finished - the function to call when things are finished

Returns:
1 on success, 0 on failure


do_query_multiple_bug_details
int do_query_multiple_bug_details(class error_query query,
                                  function finished)

This method sets up a call to return the details of the error.

Parameters:
bug_id - the id of the bug to get the details from
finished - the function to call when things are finished

Returns:
1 on success, 0 on failure


do_query_open_bugs_by_reporter
int do_query_open_bugs_by_reporter(string reporter,
                                   function finished)

This returns the bug summary for all the open bugs associated with the specified reporter.

Parameters:
reporter - the reporter to find the bugs for
finished - the function to call when things are finished

Returns:
1 on success, 0 on failure


do_query_open_bugs_for_fname
int do_query_open_bugs_for_fname(string fname,
                                 function finished)

This returns the bug summary for all the open bugs associated with the specified file.

Parameters:
fname - the file name
finished - the function to call when things are finished

Returns:
1 on success, 0 on failure


do_query_open_bugs_in_dir
int do_query_open_bugs_in_dir(string dir,
                              function finished,
                              int recursive)

This method finds the bug summary for all the open bugs in the specified directory.

Parameters:
dir - the directory to find the open bugs in
finished - the function to call when things are finished
recursive - look for the bugs recursively

Returns:
1 on success, 0 on failure


do_status_error_reply
int do_status_error_reply(int id,
                          string status,
                          function finished)

This method sets the error reply status to something useful.

Parameters:
id - the id of the error reply
status - the new status
finished - the finished fuinction

Returns:
1 if the setup is successful, 0 if not


do_this_update
void do_this_update(int weekend,
                    int weekstart)
do_update_directory_assignment
int do_update_directory_assignment(string old_person,
                                   string new_person,
                                   string directory,
                                   function callback)

This method is called when a directory assignment is changed and the main person responsible is changed. All the reports in the specific directory assigned to the old person or assigned to NULL will be updated to be assigned to the new person.

Parameters:
old_person - old person
new_person - new person responsible
directory - the directory
callback - where to call back with results

Returns:
1 if the call was successful, 0 if not


finish_comments
void finish_comments(int type,
                     mixed data,
                     function finished,
                     class error_complete * errors,
                     string ids,
                     string query)

This method updates the comments based on the query results.

Parameters:
type - type type
fdata - the return data from the query
function - finsiished the finished function
errors - the errors results we are updating
query - the ids list we are using


finish_details
void finish_details(int type,
                    mixed data,
                    function finished,
                    string query,
                    int no_extra)

This method finishes a details based query.

Parameters:
type - the type returned (error etc)
data - the data returned
finished - the function to call on finish
no_extra - no extra details


finish_details_error_replies
void finish_details_error_replies(int type,
                                  mixed data,
                                  function finished,
                                  class error_complete * errors,
                                  string ids,
                                  string query)

This method updates the comments based on the query results.

Parameters:
type - type type
fdata - the return data from the query
function - finsiished the finished function
errors - the errors results we are updating
query - the ids list we are using


finish_error_replies
void finish_error_replies(int type,
                          mixed data,
                          function finished,
                          string query)

This method finishes doing a reply lookup.
finish_forward_query
void finish_forward_query(int type,
                          mixed data,
                          function finished,
                          string user,
                          string newdir)

This method finishes a details based query.

Parameters:
type - the type returned (error etc)
data - the data returned
finished - the function to call on finish


finish_forwards
void finish_forwards(int type,
                     mixed data,
                     function finished,
                     class error_complete * errors,
                     string query)

This method updates the comments based on the query results.

Parameters:
type - type type
fdata - the return data from the query
function - finsiished the finished function
errors - the errors results we are updating
query - the ids list we are using


finish_status_query
void finish_status_query(int type,
                         mixed data,
                         function finished,
                         string status,
                         int nomail,
                         string user,
                         string subject,
                         string message)

This sends the bug reply if needed when the bug status is changed. This needs to be caught out as a special case to deal with sending the replies when nessessary.
finish_summary
void finish_summary(int type,
                    mixed data,
                    function finished,
                    string query)

This method finishes a summary based query.

Parameters:
type - the type returned (error etc)
data - the data returned
finished - the function to call on finish


finish_update
void finish_update(int type,
                   mixed data,
                   function finished,
                   string query)

This method finishes an update based query.

Parameters:
type - the type returned (error etc)
data - the data returned
finished - the function to call on finish


post_weekly_report
void post_weekly_report(int weekend)

This method posts the weekly report to the correct boards so we can see what exciting things the bugs have been doing over the last week.

Parameters:
weekend - the weekend to post for


send_bug_reply_notify
void send_bug_reply_notify(string from,
                           string to)

This method sets up the bug reply insect to notify the players about the reply.

Parameters:
from - the person sent from
to - the person sent to


update_bugs_ideas_typos
void update_bugs_ideas_typos()
update_monthly_periods_from
void update_monthly_periods_from(int start)

Protected Functions

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

build_sql_query
string build_sql_query(string select_rows,
                       class error_query query)

This method builds an sql query from the input query.

Parameters:
query - the input query

Returns:
an sql string query


setup_error_handler
void setup_error_handler(string user,
                         string db,
                         string password)

This method sets up the access permissions to use for accessing the database.

Parameters:
user - the user to use
db - the database to use
password - the password to use


update_four_weekly_stats
void update_four_weekly_stats(int monthend)

Update stats on an approximately monthly basis.
update_weekly_stats
void update_weekly_stats(int weekend)

Update weekly stats. This updates all the tables needed to generate the weekly statistics for the bug reports.

Parameters:
weekend - the end of the week