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 TypeMethodDescriptionvoidactivate()activate a charactervoidaddAnnoyingUser(User aUser) Adds a user to be ignored to the big ignore list.voidAdds a macro to the list of macros.booleanIndicates whether or not this person can receive items or money from other players.voiddeactivate a character (usually because someone typed quit.)getChatLine(String name) getEmail()intgetGod()getGuild()The list of people that are ignoring you.The list of people that you are ignoring.intReturns 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.booleangetOoc()getRace()returns the race of the character.Display statistics .longReturns the number of minutes that a user is not allowed to login to the game.booleanhasChatLine(String name) booleanisIgnoring(Person aPerson) Whether or not you are ignoring a certain person.booleanbooleanjoinChatline(Chatline chatline) booleanleaveChatLine(String chatlinename) voidvoidbooleanremoveAnnoyingUser(User aUser) Removes a user from the big ignore list.booleanremoveMacro(String string) Removes a macro from the existing macros.voidsetAddress(String address) Sets the ip address or hostname of the person playing the game.voidsetCgiAccept(String cgiAccept) voidsetCgiAuthType(String cgiAuthType) voidsetCgiContentType(String cgiContentType) voidsetCgiGatewayInterface(String cgiGatewayInterface) voidsetCgiPathInfo(String cgiPathInfo) voidsetCgiPathTranslated(String cgiPathTranslated) voidsetCgiRemoteAddr(String cgiRemoteAddr) voidsetCgiRemoteHost(String cgiRemoteHost) voidsetCgiRemoteIdent(String cgiRemoteIdent) voidsetCgiRemoteUser(String cgiRemoteUser) voidsetCgiRequestMethod(String cgiRequestMethod) voidsetCgiScriptName(String cgiScriptName) voidsetCgiServerName(String cgiServerName) voidsetCgiServerPort(String cgiServerPort) voidsetCgiServerProtocol(String cgiServerProtocol) voidsetCgiServerSoftware(String cgiServerSoftware) voidsetCgiUserAgent(String cgiUserAgent) voidvoidsetFrogging(int i) voidSets the guild a person (user) belongs to.voidsetGuildrank(Guildrank guildrank) voidsetJackassing(int i) voidsetLastlogin(LocalDateTime lastlogin) voidsetNewpassword(String newpassword) Sets the password of the person.voidsetOoc(boolean b) voidsetPunishment(Integer punishment) voidsetRealname(String realname) voidsetTimeout(int minutes) Sets the timeout, i.e.booleanverifyPassword(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:
isIgnoringin 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:PersonDisplay statistics .- Overrides:
getStatisticsin classPerson- Returns:
- String containing all the statistics in html format.
- Throws:
MudException
-
canReceive
public boolean canReceive()Description copied from class:PersonIndicates whether or not this person can receive items or money from other players.- Specified by:
canReceivein 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)
-