Class User
- All Implemented Interfaces:
Serializable
,AttributeWrangler
,DisplayInterface
,ItemWrangler
,Ownage
- Direct Known Subclasses:
Administrator
A user in the game. Might be an administrator.
- Author:
- maartenl
- See Also:
-
Field Summary
Fields inherited from class Person
EMPTY_LOG, MAX_VITALS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
activate a charactervoid
addAnnoyingUser
(User aUser) Adds a user to be ignored to the big ignore list.void
Adds a macro to the list of macros.boolean
Indicates whether or not this person can receive items or money from other players.void
deactivate a character (usually because someone typed quit.)getChatLine
(String name) getEmail()
int
getGod()
getGuild()
The list of people that are ignoring you.The list of people that you are ignoring.int
Returns the last time the user was logged in.Returns the macro based on the name of the macro.Returns the SHA-512 hash of the password in the form of a 128 length String containing the HEX encoding of this hash.boolean
getOoc()
getRace()
returns the race of the character.Display statistics .long
Returns the number of minutes that a user is not allowed to login to the game.boolean
hasChatLine
(String name) boolean
isIgnoring
(Person aPerson) Whether or not you are ignoring a certain person.boolean
boolean
joinChatline
(Chatline chatline) boolean
leaveChatLine
(String chatlinename) void
void
boolean
removeAnnoyingUser
(User aUser) Removes a user from the big ignore list.boolean
removeMacro
(String string) Removes a macro from the existing macros.void
setAddress
(String address) Sets the ip address or hostname of the person playing the game.void
setCgiAccept
(String cgiAccept) void
setCgiAuthType
(String cgiAuthType) void
setCgiContentType
(String cgiContentType) void
setCgiGatewayInterface
(String cgiGatewayInterface) void
setCgiPathInfo
(String cgiPathInfo) void
setCgiPathTranslated
(String cgiPathTranslated) void
setCgiRemoteAddr
(String cgiRemoteAddr) void
setCgiRemoteHost
(String cgiRemoteHost) void
setCgiRemoteIdent
(String cgiRemoteIdent) void
setCgiRemoteUser
(String cgiRemoteUser) void
setCgiRequestMethod
(String cgiRequestMethod) void
setCgiScriptName
(String cgiScriptName) void
setCgiServerName
(String cgiServerName) void
setCgiServerPort
(String cgiServerPort) void
setCgiServerProtocol
(String cgiServerProtocol) void
setCgiServerSoftware
(String cgiServerSoftware) void
setCgiUserAgent
(String cgiUserAgent) void
void
setFrogging
(int i) void
Sets the guild a person (user) belongs to.void
setGuildrank
(Guildrank guildrank) void
setJackassing
(int i) void
setLastlogin
(LocalDateTime lastlogin) void
setNewpassword
(String newpassword) Sets the password of the person.void
setOoc
(boolean b) void
setPunishment
(Integer punishment) void
setRealname
(String realname) void
setTimeout
(int minutes) Sets the timeout, i.e.boolean
verifyPassword
(String newpassword) Verifies if the password is the correct one.Methods inherited from class Person
addItem, decreaseHealth, destroyItem, drop, equals, findItems, get, getAfk, getAge, getAlignment, getArm, getAttribute, getBandage, getBeard, getBirth, getBody, getComplexion, getConstitution, getCopper, getCreation, getDescription, getDexterity, getDrinkstats, getEatstats, getExperience, getEyes, getFace, getFamilyname, getFightable, getFightingwho, getFysically, getHair, getHealth, getHeight, getImage, getIntelligence, getItems, getJumpmana, getJumpmove, getJumpvital, getLeg, getLevel, getLongDescription, getMainTitle, getManastats, getMaxmana, getMaxmove, getMaxvital, getMentally, getMoney, getMovementstats, getName, getNotes, getOwner, getPractises, getRoom, getSex, getSleep, getState, getStrength, getTitle, getTraining, getTransform, getVisible, getVitals, getWebsocketSupport, getWidth, getWimpy, getWisdom, give, hashCode, increaseHealth, isActive, isAfk, isDead, isShopkeeper, isUser, isWearing, isWielding, receive, removeAttribute, setActive, setAfk, setAge, setAlignment, setArm, setAttribute, setBandage, setBeard, setBirth, setComplexion, setConstitution, setCopper, setCreation, setDexterity, setDrinkstats, setEatstats, setEyes, setFace, setFamilyname, setFightable, setFightingwho, setFysically, setHair, setHeight, setIntelligence, setJumpmana, setJumpmove, setJumpvital, setLeg, setManastats, setMaxmana, setMaxmove, setMaxvital, setMentally, setMovementstats, setName, setNotes, setOwner, setPractises, setRace, setRoom, setSex, setSleep, setState, setStrength, setTitle, setTraining, setTransform, setVisible, setWebsocketSupport, setWidth, setWimpy, setWisdom, toString, transferMoney, unused, verifyAttribute, wear, wears, wield, wields
-
Constructor Details
-
User
public User()
-
-
Method Details
-
getIgnoringSet
-
getIgnoredSet
-
getAddress
-
setAddress
Sets the ip address or hostname of the person playing the game. Usually done when logging in.- Parameters:
address
- the ip address or hostname.
-
getNewpassword
Returns the SHA-512 hash of the password in the form of a 128 length String containing the HEX encoding of this hash.
There used to be "password" method too, but it was deprecated and has since been removed.
- Returns:
- 128 character hex-encoded SHA-512 hash of the password.
-
verifyPassword
Verifies if the password is the correct one.- Parameters:
newpassword
- the password to verify- Returns:
- true if it's the same, false if it is empty or does not match.
-
setNewpassword
Sets the password of the person. Can contain any character, but has to have at least size of 5. It is not a good idea to enter a 128 length password here, as this method will assume it is already encrypted.- Parameters:
newpassword
- the new password.- Throws:
MudException
- if the password is not allowed.
-
getRealname
-
setRealname
-
getEmail
-
setEmail
-
getPunishment
-
setPunishment
-
getLastlogin
Returns the last time the user was logged in. Can return null, which means the user has never once logged on and is new. (or not a user)- Returns:
- the date of last logged on.
-
setLastlogin
-
getCgiServerSoftware
-
setCgiServerSoftware
-
getCgiServerName
-
setCgiServerName
-
getCgiGatewayInterface
-
setCgiGatewayInterface
-
getCgiServerProtocol
-
setCgiServerProtocol
-
getCgiServerPort
-
setCgiServerPort
-
getCgiRequestMethod
-
setCgiRequestMethod
-
getCgiPathInfo
-
setCgiPathInfo
-
getCgiPathTranslated
-
setCgiPathTranslated
-
getCgiScriptName
-
setCgiScriptName
-
getCgiRemoteHost
-
setCgiRemoteHost
-
getCgiRemoteAddr
-
setCgiRemoteAddr
-
getCgiAuthType
-
setCgiAuthType
-
getCgiRemoteUser
-
setCgiRemoteUser
-
getCgiRemoteIdent
-
setCgiRemoteIdent
-
getCgiContentType
-
setCgiContentType
-
getCgiAccept
-
setCgiAccept
-
getCgiUserAgent
-
setCgiUserAgent
-
activate
-
deactivate
public void deactivate()deactivate a character (usually because someone typed quit.)- See Also:
-
isNewUser
public boolean isNewUser() -
writeMacros
-
joinChatline
-
leaveChatLine
-
hasChatLine
-
getChatLine
-
removeMacro
Removes a macro from the existing macros. Returns false if the removal failed (for instance if the macro did not exist.)- Parameters:
string
- the name of the macro to remove- Returns:
- true if success, otherwise false.
-
addMacro
Adds a macro to the list of macros. Will do nothing if the macro already exists.- Parameters:
macro
- the macro to add.
-
getMacro
-
addAnnoyingUser
Adds a user to be ignored to the big ignore list.- Parameters:
aUser
-
-
removeAnnoyingUser
Removes a user from the big ignore list. Assumedly, because he is no longer annoying.- Parameters:
aUser
-- Returns:
- true if the user was found, and successfully removed from the set.
-
isIgnoring
Whether or not you are ignoring a certain person. The default is that nobody is ignoring you.- Overrides:
isIgnoring
in classPerson
- Parameters:
aPerson
- the person to check in your ignore list.- Returns:
- true if the person should be ignored, false otherwise.
-
getGuild
-
setGuild
Sets the guild a person (user) belongs to. Also can be used to remove someone from the guild by providing a "null". When the latter case, also the guildrank is automatically cleared.- Parameters:
guild
- the new guild, or null if the person is removed from the guild.
-
getGuildrank
-
setGuildrank
-
getStatistics
Description copied from class:Person
Display statistics .- Overrides:
getStatistics
in classPerson
- Returns:
- String containing all the statistics in html format.
- Throws:
MudException
-
canReceive
public boolean canReceive()Description copied from class:Person
Indicates whether or not this person can receive items or money from other players.- Specified by:
canReceive
in classPerson
- Returns:
-
getGod
-
setTimeout
public void setTimeout(int minutes) Sets the timeout, i.e. the amount of minutes that a user is not allowed to login to the game.- Parameters:
minutes
- the number of minutes
-
getTimeout
public long getTimeout()Returns the number of minutes that a user is not allowed to login to the game.- Returns:
-
getFrogging
public int getFrogging() -
getJackassing
public int getJackassing() -
setFrogging
public void setFrogging(int i) -
lessFrogging
public void lessFrogging() -
setJackassing
public void setJackassing(int i) -
lessJackassing
public void lessJackassing() -
getRace
-
getOoc
public boolean getOoc() -
setOoc
public void setOoc(boolean b)
-