Class Bot

  • Direct Known Subclasses:
    ArthurBot, BotLibre

    public abstract class Bot
    extends Client
    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 Detail

      • Bot

        public Bot()
    • Method Detail

      • 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
      • 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
      • getUrl

        public String getUrl()
      • setUrl

        public void setUrl​(String url)
      • setParameterMap

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

        public int hashCode()
        Overrides:
        hashCode in class Client