Purser Mod Design Specification

Purser Mod is the Drupal module that will track and allow easy entry of a EPGP DKP system. This design specification document covers the entry points of the backing middle tier to handle the logic necessary to perform this tracking. All functions may not be implemented due to time constraints.
This is, of course, a work in progress as I work through the middle tier.
Raid Functions
add_raid($raidname, $date, $time, $decay=0)
Returns: raidid, or -1 if failed.
Params:
- $raidname: Name of the raid
- $date: Date of the raid
- $time: time of the raid
- $decay: Decay percent of the raid. 0 means no decay of EP/GP occurs
Adds the Raid to the database. This raid is not processed.
delete_raid($raidid)
Returns: 0 if successful. An error code otherwise.
Params:
- $raidid: Raid ID
Deletes the raid. Only non-processed raids may be deleted. A code of -1 will be returned if the raid was already processed. An error code of 1 will be returned if the $raidid was not found.
edit_raid($raidid, $raidname=NULL, $date=NULL, $time=NULL, $decay=NULL)
Edits the raid. Updates any values available. If the raid has already been processed, it will return an error.
unlock_raid($raidid)
Returns: -1 if failed. $raidid otherwise.
Params:
- $raidid: Raid ID
Unlocks a processed raid, therefore allowing editing, and/or deletion. This may cause a cascading change, so it is imperative that all raids from this point on be rebuilt.
process_raid($raidid)
Returns: -1 if failed. $raidid otherwise.
Params:
- $raidid: Raid ID
Processes the raid and all events associated with the raid, updating the EP/GP totals to the accounts.
Event Functions
add_event($raidid, $eventname, $date, $time, $ep, $participants=array(), $standby=array())
Returns: $eventid or -1 if failed.
Params:
- $raidid: ID of the raid to add the event to.
- $eventname: Name of the event
- $date: Date of the event
- $time: Time of the event
- $ep: EP gain
- $participants: Array of participant ID's. May be empty.
- $standby: Array of standby user ID's. May be empty.
Add the event to the database.
edit_event($raidid, $eventid, $eventname=NULL, $date=NULL, $time=NULL, $ep=NULL, $participants=NULL, $standby=NULL)
Returns $eventid or -1 if failed.
Params:
- $raidid: ID of the raid to add the event to.
- $eventid: ID of the event to change.
- $eventname: Name of the event. If NULL no change.
- $date: Date of the event. If NULL no change.
- $time: Time of the event. If NULL no change.
- $ep: EP gain. If NULL no change. If it does change, this will also update the related EP table.
- $participants: Array of participant ID's. May be empty. Will delete any previous participant and EP records.
- $standby: Array of standby user ID's. May be empty. Will delete any previous participant and EP records.
delete_event($raidid, $eventid)
Returns $eventid or -1 if failed.
Params
- $raidid: ID of the raid to delete from.
- $eventid: ID of the event to delete
Deletes the event and any related records from the database.
add_participant($raidid, $eventid, $pid, $standby, $ep=NULL)
Returns: 0 if successful, an error code if failed.
Params:
- $raidid: ID of the raid to add the participant to.
- $eventid: ID of the event to add the participant to.
- $pid: If numeric, the pid of the participant to add. If text, then a lookup must occur.
- $standby: if true, the participant is set as standy and gains EP at the standby rate.
- $ep: If set, overrides the default EP gain set in the event. Otherwise will use the default EP gain for the event.
Adds the participant to the event.
delete_participant($raidid, $eventid, $pid)
Returns: 0 if successful, an error code if failed. (1: GP record exists, cannot delete. 2: participant does not exist.)
Params:
- $raidid: ID of the raid to delete the participant from.
- $eventid: ID of the event to delete the participant from.
- $pid: If numeric, the pid of the participant to delete. If text, then a lookup must occur.
Deletes the participant from the event. If the participant has a GP record, the function will not delete the participant.
Gear and Item Functions
add_
User Functions
Welcome New Users
Hi, you're seeing this because you are a non-logged in user. If you are a member of our guild, please create an account. We ask that you keep your login name to the same character name as your main, as it makes knowing who you are easier.
I'll check periodically to see if you've created an account. Please check back within 24 hours (or Monday afternoon if you've signed up during the weekend)

Recent comments
6 hours 10 min ago
1 day 7 hours ago
1 day 8 hours ago
1 day 10 hours ago
2 days 22 hours ago
2 days 4 hours ago
6 days 6 hours ago
6 days 9 hours ago
6 days 10 hours ago
6 days 12 hours ago