Class Bot

Direct Known Subclasses:
ArthurBot, BotLibre

public abstract class Bot extends User
A Bot is a Client that has no session. It does have own scene, and observes all events in the scene. It also responds to something that user(s) write.
Author:
joe
  • Constructor Details

    • Bot

      public Bot()
  • Method Details

    • getParameter

      public String getParameter(String key)
      Returns a parameter from parameter map
    • selfTest

      public abstract void selfTest() throws Exception
      Self test runs on server startup. Exceptions are logged but otherwise ignored.
      Throws:
      Exception
    • getResponse

      public abstract String getResponse(Client c, String query)
    • respondTo

      public void respondTo(Client c, String what)
      Get response to something that a client "said", and write it
    • write

      public void write(String what)
      Utility method - "say" something.
    • processEvent

      public void processEvent(VREvent event)
      Process an event. If that's something that a user wrote, calls respondTo method. Other events are ignored.
      Overrides:
      processEvent in class Client
      Parameters:
      event - Whatever has changed
    • objectsAdded

      public void objectsAdded(List<VRObject> objects)
      New objects in the scene, typically a client that has arrived. This implementation does nothing, utility method for subclasses.
    • objectsRemoved

      public void objectsRemoved(List<Map<String,Long>> objects)
      Objects removed from the scene, typically a client that has left. This implementation does nothing, utility method for subclasses.
      Parameters:
      objects -
    • sendMessage

      public void sendMessage(Object o)
      Scene management method, called when the scene changes.
      Overrides:
      sendMessage in class Client
    • toString

      public String toString()
      Overrides:
      toString in class User
    • getGender

      public String getGender()
    • getLang

      public String getLang()
    • getUrl

      public String getUrl()
    • getParameterMap

      public Map<String,String> getParameterMap()
    • setGender

      public void setGender(String gender)
    • setLang

      public void setLang(String lang)
    • setUrl

      public void setUrl(String url)
    • setParameterMap

      public void setParameterMap(Map<String,String> parameterMap)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class User
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class User
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class User