|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CharCreationLibrary
This library manages everything related to logging a player or account in, creating a character, the account menu, certain login procedures, the rules around player names, start rooms, death rooms, and morgue rooms.
Nested Class Summary | |
---|---|
static class |
CharCreationLibrary.LoginResult
A response object from one of the login system methods, basically telling the caller something about the results of what was attempted. |
static interface |
CharCreationLibrary.LoginSession
This is the main login state machine transaction object. |
static class |
CharCreationLibrary.NewCharNameCheckResult
A response object from one of the name checking methods, telling the caller some specifics about the attempt to create a new character by testing a new name. |
Method Summary | |
---|---|
boolean |
canChangeToThisClass(MOB mob,
CharClass thisClass,
int theme)
Returns whether the given mob can change to the given class (that is, to become level 0 in that class) in the given theme. |
java.util.List<CharClass> |
classQualifies(MOB mob,
int theme)
Returns the list of all character classes that the given mob can change into, given their currrent state, and the given theme. |
CharCreationLibrary.LoginResult |
completePlayerLogin(Session session,
boolean wizi)
Takes the given session and mobs login by putting the mob into the given start room in the world, checking their email, and seeing if they are allowed in. |
CharCreationLibrary.LoginResult |
createCharacter(java.lang.String login,
Session session)
Attempts to send the given session through the character creation process, at the end of which a character with the given login as name will be in the database, ready to load. |
CharCreationLibrary.LoginSession |
createLoginSession(Session session)
Creates a new Login Session for the given Session, which will start the login state machine process that will end eventually with either a disconnect or a character logged in. |
CharCreationLibrary.LoginResult |
finishLogin(Session session,
MOB mob,
Room startRoom,
boolean resetStats)
Completes the given session and mobs login by putting the mob into the given start room in the world, checking their email, and seeing if they are allowed in. |
java.lang.String |
generateRandomName(int minSyllable,
int maxSyllable)
Returns a random fantasy name with the range of syllables given. |
Room |
getDefaultBodyRoom(MOB mob)
Given the characteristics of the given mob, this method returns the appropriate morgue room for the given mob. |
Room |
getDefaultDeathRoom(MOB mob)
Given the characteristics of the given mob, this method returns the appropriate death room for the given mob. |
Room |
getDefaultStartRoom(MOB mob)
Given the characteristics of the given mob, this method returns the appropriate start/recall room for the given mob. |
java.util.List<java.lang.String> |
getExpiredAcctOrCharsList()
Returns the list of the names of all the expired Accounts or Characters, depending on whether the account system is used or not. |
int |
getTotalBonusStatPoints(PlayerStats playerStats,
PlayerAccount account)
Based on the rules of the system, this method returns the number of bonus stat points available to players to allocate, if the system lets them do such a thing. |
int |
getTrainingCost(MOB mob,
int abilityCode,
boolean quiet)
Returns the cost, in trains, for the given mob to gain a point in the given ability code stat number. |
void |
initBodyRooms(CMProps page)
Initialize the rules for determining the new character morgue room given the characteristics of the player. |
void |
initDeathRooms(CMProps page)
Initialize the rules for determining the new character death room given the characteristics of the player. |
void |
initStartRooms(CMProps page)
Initialize the rules for determining the new character start/recall room given the characteristics of the player. |
boolean |
isAvailableCharClass(CharClass C)
Returns whether the given character class may be selected by a user. |
boolean |
isAvailableRace(Race R)
Returns whether the given race may be selected by a user. |
boolean |
isBadName(java.lang.String login)
Returns only whether the given name has a bad word in it. |
boolean |
isOkName(java.lang.String login,
boolean spacesOk)
Returns whether the given name is a valid, legitimate, unused, unbanned, non-bad name to use in coffeemud, for accounts or players. |
CharCreationLibrary.NewCharNameCheckResult |
newAccountNameCheck(java.lang.String login,
java.lang.String ipAddress)
Checks whether an account with the given login name from the given ipAddress may be created at this time. |
CharCreationLibrary.NewCharNameCheckResult |
newCharNameCheck(java.lang.String login,
java.lang.String ipAddress,
boolean skipAccountNameCheck)
Checks whether a character with the given login name from the given ipAddress may be created at this time. |
void |
notifyFriends(MOB mob,
java.lang.String message)
If any of the given mobs friends are online, they are sent the given message. |
boolean |
performSpamConnectionCheck(java.lang.String address)
Does a connection spam check against the given address, returning true if all is well, and false if it needs blocking. |
void |
promptBaseCharStats(int theme,
MOB mob,
int timeoutSecs,
Session session,
int bonusPoints)
A blocking call that populates the given mob with their base CharStats according to character creation rules. |
CharClass |
promptCharClass(int theme,
MOB mob,
Session session)
A blocking call that populates the given mob with a character class according to character creation rules. |
char |
promptGender(int theme,
MOB mob,
Session session)
A blocking call that populates the given mob with a particular gender according to character creation rules. |
Race |
promptRace(int theme,
MOB mob,
Session session)
A blocking call that populates the given mob with a particular race according to character creation rules. |
java.util.List<Race> |
raceQualifies(int theme)
Returns the list of all races that the given mob can choose into, given their currrent state, and the given theme. |
void |
reloadTerminal(MOB mob)
Resets the MXP, MSP and other session flags based on the mobs attributes. |
void |
reRollStats(CharStats baseCharStats,
int pointsLeft)
Re-populates the base stats of the given CharStats object by resetting the values to minimum, and then adding as many of the given points to random stats until they are all gone. |
void |
showTheNews(MOB mob)
Resets the terminal to the given mobs specs, shows any available polls, the daily message, and runs the MOTD. |
Methods inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CMLibrary |
---|
activate, getServiceClient, L, propertiesLoaded, shutdown |
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject |
---|
copyOf, ID, initializeClass, name, newInstance |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Method Detail |
---|
void reRollStats(CharStats baseCharStats, int pointsLeft)
baseCharStats
- the charstats object to populatepointsLeft
- the number of points above minimum to allocateCharStats
void promptBaseCharStats(int theme, MOB mob, int timeoutSecs, Session session, int bonusPoints) throws java.io.IOException
theme
- the theme code to use for stat allocationmob
- the mob who is getting the new char statstimeoutSecs
- number of seconds before prompt times outsession
- the session which might help allocate the pointsbonusPoints
- any bonus points to allocate to stats
java.io.IOException
- any input errors that occurCharStats
,
Area.THEME_FANTASY
,
reRollStats(CharStats, int)
,
promptCharClass(int, MOB, Session)
,
promptRace(int, MOB, Session)
,
promptGender(int, MOB, Session)
CharClass promptCharClass(int theme, MOB mob, Session session) throws java.io.IOException
theme
- the theme code to use for class selectionmob
- the mob who is getting the new char classsession
- the session which might help allocate the points
java.io.IOException
- any input errors that occurCharStats
,
reRollStats(CharStats, int)
,
promptBaseCharStats(int, MOB, int, Session, int)
,
promptRace(int, MOB, Session)
,
promptGender(int, MOB, Session)
,
Area.THEME_FANTASY
Race promptRace(int theme, MOB mob, Session session) throws java.io.IOException
theme
- the theme code to use for race selectionmob
- the mob who is getting the new racesession
- the session which might help get the race
java.io.IOException
- any input errors that occurCharStats
,
reRollStats(CharStats, int)
,
promptBaseCharStats(int, MOB, int, Session, int)
,
promptCharClass(int, MOB, Session)
,
promptGender(int, MOB, Session)
,
Area.THEME_FANTASY
char promptGender(int theme, MOB mob, Session session) throws java.io.IOException
theme
- the theme code to use for gender selectionmob
- the mob who is getting the new gendersession
- the session which might help get the gender
java.io.IOException
- any input errors that occurCharStats
,
reRollStats(CharStats, int)
,
promptBaseCharStats(int, MOB, int, Session, int)
,
promptCharClass(int, MOB, Session)
,
promptRace(int, MOB, Session)
,
Area.THEME_FANTASY
int getTrainingCost(MOB mob, int abilityCode, boolean quiet)
mob
- the mob who is trying to trainabilityCode
- the ability code the mob wants to trainquiet
- true to not give verbal errors
CharStats
boolean canChangeToThisClass(MOB mob, CharClass thisClass, int theme)
mob
- null or the mob who wants to learn a new classthisClass
- the class that the mob wants to learntheme
- the theme defining which classes are available
Area.THEME_FANTASY
,
classQualifies(MOB, int)
java.util.List<CharClass> classQualifies(MOB mob, int theme)
mob
- the mob who wants to change classestheme
- the theme to filter the classes by
canChangeToThisClass(MOB, CharClass, int)
java.util.List<java.lang.String> getExpiredAcctOrCharsList()
boolean isAvailableRace(Race R)
R
- the Race to check
boolean isAvailableCharClass(CharClass C)
C
- the CharClass to check
java.util.List<Race> raceQualifies(int theme)
theme
- the theme to filter the races by
canChangeToThisClass(MOB, CharClass, int)
boolean isOkName(java.lang.String login, boolean spacesOk)
login
- the name to testspacesOk
- true if spaces in the name are ok, false otherwise
isBadName(String)
,
isOkName(String, boolean)
,
newCharNameCheck(String, String, boolean)
,
newAccountNameCheck(String, String)
boolean isBadName(java.lang.String login)
login
- the name to test
isOkName(String, boolean)
,
newCharNameCheck(String, String, boolean)
,
newAccountNameCheck(String, String)
CharCreationLibrary.NewCharNameCheckResult newCharNameCheck(java.lang.String login, java.lang.String ipAddress, boolean skipAccountNameCheck)
login
- the name to checkipAddress
- the ip address of the name checkerskipAccountNameCheck
- true to ignore account name matches
isBadName(String)
,
isOkName(String, boolean)
,
newAccountNameCheck(String, String)
,
CharCreationLibrary.NewCharNameCheckResult
CharCreationLibrary.NewCharNameCheckResult newAccountNameCheck(java.lang.String login, java.lang.String ipAddress)
login
- the name to checkipAddress
- the ip address of the name checker
isBadName(String)
,
isOkName(String, boolean)
,
newCharNameCheck(String, String, boolean)
void reloadTerminal(MOB mob)
mob
- the mob whose session needs to match hisshowTheNews(MOB)
void showTheNews(MOB mob)
mob
- the mob to show these things toreloadTerminal(MOB)
void notifyFriends(MOB mob, java.lang.String message)
mob
- the mob whose friends need notifyingmessage
- the message to send to the mobs friends.CharCreationLibrary.LoginResult createCharacter(java.lang.String login, Session session) throws java.io.IOException
login
- the name of the new charactersession
- the session of the character creating person
java.io.IOException
- an i/o error with the telnet sessionCharCreationLibrary.LoginResult
void initStartRooms(CMProps page)
page
- the properties containing info about the start roomsinitDeathRooms(CMProps)
,
initBodyRooms(CMProps)
,
getDefaultStartRoom(MOB)
void initDeathRooms(CMProps page)
page
- the properties containing info about the death roomsinitStartRooms(CMProps)
,
initBodyRooms(CMProps)
,
getDefaultDeathRoom(MOB)
void initBodyRooms(CMProps page)
page
- the properties containing info about the morgue roomsinitStartRooms(CMProps)
,
initDeathRooms(CMProps)
,
getDefaultBodyRoom(MOB)
Room getDefaultStartRoom(MOB mob)
mob
- the mob who needs to know their start room
initStartRooms(CMProps)
,
getDefaultDeathRoom(MOB)
,
getDefaultBodyRoom(MOB)
Room getDefaultDeathRoom(MOB mob)
mob
- the mob who needs to know their death room
initDeathRooms(CMProps)
,
getDefaultStartRoom(MOB)
,
getDefaultBodyRoom(MOB)
Room getDefaultBodyRoom(MOB mob)
mob
- the mob who needs to know their morgue room
initBodyRooms(CMProps)
,
getDefaultStartRoom(MOB)
,
getDefaultDeathRoom(MOB)
int getTotalBonusStatPoints(PlayerStats playerStats, PlayerAccount account)
playerStats
- The player stats object for the playeraccount
- the player account object for the player, if applicable
java.lang.String generateRandomName(int minSyllable, int maxSyllable)
minSyllable
- the minimum number of syllables, at least 1maxSyllable
- the maximum number of syllables, at least minimum
CharCreationLibrary.LoginResult finishLogin(Session session, MOB mob, Room startRoom, boolean resetStats) throws java.io.IOException
session
- the session trying to loginmob
- the mob trying to log instartRoom
- the room they will appear inresetStats
- true to reset their state (hit points, etc) or false to keep as-was
java.io.IOException
- any I/O errors during the processCharCreationLibrary.LoginResult
boolean performSpamConnectionCheck(java.lang.String address)
address
- the address to check
CharCreationLibrary.LoginResult completePlayerLogin(Session session, boolean wizi) throws java.io.IOException
session
- the session trying to login, with the mob to loginwizi
- true if the player should login wizinvisible
java.io.IOException
- any I/O errors during the processCharCreationLibrary.LoginSession createLoginSession(Session session)
session
- the telnet session trying to login
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |