Class User

All Implemented Interfaces:
Serializable, AttributeWrangler, DisplayInterface, ItemWrangler, Ownage
Direct Known Subclasses:
Administrator

@Entity public class User extends Person
A user in the game. Might be an administrator.
Author:
maartenl
See Also:
  • Constructor Details

    • User

      public User()
  • Method Details

    • getIgnoringSet

      public Set<User> getIgnoringSet()
      The list of people that you are ignoring.
      Returns:
    • getIgnoredSet

      public Set<User> getIgnoredSet()
      The list of people that are ignoring you.
      Returns:
    • getAddress

      public String getAddress()
    • setAddress

      public void setAddress(String address)
      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

      public String 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

      public boolean verifyPassword(String newpassword)
      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

      public void setNewpassword(String newpassword) throws MudException
      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

      public String getRealname()
    • setRealname

      public void setRealname(String realname)
    • getEmail

      public String getEmail()
    • setEmail

      public void setEmail(String email)
    • getPunishment

      public Integer getPunishment()
    • setPunishment

      public void setPunishment(Integer punishment)
    • getLastlogin

      public LocalDateTime 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

      public void setLastlogin(LocalDateTime lastlogin)
    • getCgiServerSoftware

      public String getCgiServerSoftware()
    • setCgiServerSoftware

      public void setCgiServerSoftware(String cgiServerSoftware)
    • getCgiServerName

      public String getCgiServerName()
    • setCgiServerName

      public void setCgiServerName(String cgiServerName)
    • getCgiGatewayInterface

      public String getCgiGatewayInterface()
    • setCgiGatewayInterface

      public void setCgiGatewayInterface(String cgiGatewayInterface)
    • getCgiServerProtocol

      public String getCgiServerProtocol()
    • setCgiServerProtocol

      public void setCgiServerProtocol(String cgiServerProtocol)
    • getCgiServerPort

      public String getCgiServerPort()
    • setCgiServerPort

      public void setCgiServerPort(String cgiServerPort)
    • getCgiRequestMethod

      public String getCgiRequestMethod()
    • setCgiRequestMethod

      public void setCgiRequestMethod(String cgiRequestMethod)
    • getCgiPathInfo

      public String getCgiPathInfo()
    • setCgiPathInfo

      public void setCgiPathInfo(String cgiPathInfo)
    • getCgiPathTranslated

      public String getCgiPathTranslated()
    • setCgiPathTranslated

      public void setCgiPathTranslated(String cgiPathTranslated)
    • getCgiScriptName

      public String getCgiScriptName()
    • setCgiScriptName

      public void setCgiScriptName(String cgiScriptName)
    • getCgiRemoteHost

      public String getCgiRemoteHost()
    • setCgiRemoteHost

      public void setCgiRemoteHost(String cgiRemoteHost)
    • getCgiRemoteAddr

      public String getCgiRemoteAddr()
    • setCgiRemoteAddr

      public void setCgiRemoteAddr(String cgiRemoteAddr)
    • getCgiAuthType

      public String getCgiAuthType()
    • setCgiAuthType

      public void setCgiAuthType(String cgiAuthType)
    • getCgiRemoteUser

      public String getCgiRemoteUser()
    • setCgiRemoteUser

      public void setCgiRemoteUser(String cgiRemoteUser)
    • getCgiRemoteIdent

      public String getCgiRemoteIdent()
    • setCgiRemoteIdent

      public void setCgiRemoteIdent(String cgiRemoteIdent)
    • getCgiContentType

      public String getCgiContentType()
    • setCgiContentType

      public void setCgiContentType(String cgiContentType)
    • getCgiAccept

      public String getCgiAccept()
    • setCgiAccept

      public void setCgiAccept(String cgiAccept)
    • getCgiUserAgent

      public String getCgiUserAgent()
    • setCgiUserAgent

      public void setCgiUserAgent(String cgiUserAgent)
    • activate

      public void activate() throws MudException
      activate a character
      Throws:
      MudException
      See Also:
    • deactivate

      public void deactivate()
      deactivate a character (usually because someone typed quit.)
      See Also:
    • isNewUser

      public boolean isNewUser()
    • writeMacros

      public DisplayInterface writeMacros()
    • joinChatline

      public boolean joinChatline(Chatline chatline)
    • leaveChatLine

      public boolean leaveChatLine(String chatlinename)
    • hasChatLine

      public boolean hasChatLine(String name)
    • getChatLine

      public Optional<Chatline> getChatLine(String name)
    • removeMacro

      public boolean removeMacro(String string)
      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

      public void addMacro(Macro macro)
      Adds a macro to the list of macros. Will do nothing if the macro already exists.
      Parameters:
      macro - the macro to add.
    • getMacro

      public Macro getMacro(String string)
      Returns the macro based on the name of the macro.
      Parameters:
      string - the name of the macro
      Returns:
      the macro itself.
    • addAnnoyingUser

      public void addAnnoyingUser(User aUser)
      Adds a user to be ignored to the big ignore list.
      Parameters:
      aUser -
    • removeAnnoyingUser

      public boolean removeAnnoyingUser(User aUser)
      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

      public boolean isIgnoring(Person aPerson)
      Whether or not you are ignoring a certain person. The default is that nobody is ignoring you.
      Overrides:
      isIgnoring in class Person
      Parameters:
      aPerson - the person to check in your ignore list.
      Returns:
      true if the person should be ignored, false otherwise.
    • getGuild

      public Guild getGuild()
    • setGuild

      public void setGuild(Guild guild)
      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

      public Guildrank getGuildrank()
    • setGuildrank

      public void setGuildrank(Guildrank guildrank)
    • getStatistics

      public String getStatistics() throws MudException
      Description copied from class: Person
      Display statistics .
      Overrides:
      getStatistics in class Person
      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 class Person
      Returns:
    • getGod

      public God getGod()
      Overrides:
      getGod in class Person
    • 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

      public String getRace()
      Description copied from class: Person
      returns the race of the character.
      Overrides:
      getRace in class Person
      Returns:
      String containing the race
    • getOoc

      public boolean getOoc()
    • setOoc

      public void setOoc(boolean b)