Planeshift
|
Server manager for character creation. More...
#include <creationmanager.h>
Classes | |
struct | CreationChoice |
class | LifeEventChoiceServer |
struct | RaceCP |
Public Member Functions | |
CharCreationManager (GEMSupervisor *gemsupervisor, CacheManager *cachemanager, EntityManager *entitymanager) | |
bool | Initialize () |
Caches the data from the database needed for character creation. | |
bool | Validate (psCharUploadMessage &mesg, csString &errorMsg) |
virtual | ~CharCreationManager () |
Static Public Member Functions | |
static bool | FilterName (const char *name) |
static bool | IsLastNameAvailable (const char *lastname, AccountID requestingAcct=0) |
Check whether a given last name is available. | |
static bool | IsUnique (const char *playerName, bool dbUniqueness=false) |
Check to see a name is unique in the characters table. | |
Protected Member Functions | |
void | AssignScript (psCharacter *chardata) |
Assign a script to a character. | |
int | CalculateCPChoices (csArray< uint32_t > &choices, int fatherMod, int motherMod) |
int | CalculateCPLife (csArray< uint32_t > &events) |
int | ConvertAreaToInt (const char *area) |
Takes a string name of a choice and converts it to it's enum value. | |
void | HandleCharCreateCP (MsgEntry *me, Client *client) |
Handles the creation of a character from the char creation screen. | |
void | HandleCharDelete (MsgEntry *me, Client *client) |
Handles the deletion of a character from the char pick screen. | |
void | HandleChildhood (MsgEntry *me, Client *client) |
void | HandleLifeEvents (MsgEntry *me, Client *client) |
void | HandleName (MsgEntry *me, Client *client) |
Handles a check on a name. | |
void | HandleParents (MsgEntry *me, Client *client) |
Handle and incomming message from a client about parents. | |
void | HandleTraits (MsgEntry *me, Client *client) |
void | HandleUploadMessage (MsgEntry *me, Client *client) |
int | IsReserved (const char *playerName, AccountID acctID) |
Check to see if a name is on the reserve list for database migration. | |
bool | LoadCPValues () |
Cache in the data about the race CP starting values. | |
bool | LoadCreationChoices () |
Caches in creation choices from the database. | |
bool | LoadLifeEvents () |
bool | PlayerHasFinishedTutorial (AccountID acctID, uint32 tutorialsecid) |
Protected Attributes | |
int | raceCPValuesLength |
Server manager for character creation.
This guy loads all the data that may be needed to be sent to the client for the character creation. It loads data from these tables: race_info character_creation
Definition at line 47 of file creationmanager.h.
CharCreationManager::CharCreationManager | ( | GEMSupervisor * | gemsupervisor, |
CacheManager * | cachemanager, | ||
EntityManager * | entitymanager | ||
) |
virtual CharCreationManager::~CharCreationManager | ( | ) | [virtual] |
void CharCreationManager::AssignScript | ( | psCharacter * | chardata | ) | [protected] |
Assign a script to a character.
Takes whatever script is stored in the migration table and adds it to the character to be run on character login.
chardata | The character data class to append the script to. |
int CharCreationManager::CalculateCPChoices | ( | csArray< uint32_t > & | choices, |
int | fatherMod, | ||
int | motherMod | ||
) | [protected] |
int CharCreationManager::ConvertAreaToInt | ( | const char * | area | ) | [protected] |
Takes a string name of a choice and converts it to it's enum value.
This is useful to have string names in the database ( ie human readable ) but then use them as ints in the application ( ie easier to use ).
area | The name of the area to convert. |
static bool CharCreationManager::FilterName | ( | const char * | name | ) | [static] |
Handles the creation of a character from the char creation screen.
Handles the deletion of a character from the char pick screen.
Handles a check on a name.
This will check the name against the migration and the current characters table. It will send back a message to the client to notify them of the name status. If rejected it will include a message why.
Handle and incomming message from a client about parents.
This handles a request from the client to send it all the data about choice areas in the parents screen.
bool CharCreationManager::Initialize | ( | ) |
Caches the data from the database needed for character creation.
static bool CharCreationManager::IsLastNameAvailable | ( | const char * | lastname, |
AccountID | requestingAcct = 0 |
||
) | [static] |
Check whether a given last name is available.
Last names are available if (a) unused, or (b) used by another character on the same account.
lastname | The lastname to check for availability. |
requestingAcct | The account requesting the last name (optional). |
int CharCreationManager::IsReserved | ( | const char * | playerName, |
AccountID | acctID | ||
) | [protected] |
Check to see if a name is on the reserve list for database migration.
playerName | The name to check to see if is on a the reserve list. |
acctID | The acct that is trying to create this character. |
static bool CharCreationManager::IsUnique | ( | const char * | playerName, |
bool | dbUniqueness = false |
||
) | [static] |
Check to see a name is unique in the characters table.
playerName | The name to check to see if it is unique. |
dbUniqueness | If false checks if it's still missing from the db, if true checks if there is only one entry in the db |
bool CharCreationManager::LoadCPValues | ( | ) | [protected] |
Cache in the data about the race CP starting values.
bool CharCreationManager::LoadCreationChoices | ( | ) | [protected] |
Caches in creation choices from the database.
bool CharCreationManager::LoadLifeEvents | ( | ) | [protected] |
bool CharCreationManager::PlayerHasFinishedTutorial | ( | AccountID | acctID, |
uint32 | tutorialsecid | ||
) | [protected] |
bool CharCreationManager::Validate | ( | psCharUploadMessage & | mesg, |
csString & | errorMsg | ||
) |
int CharCreationManager::raceCPValuesLength [protected] |
Definition at line 87 of file creationmanager.h.