Class EventRecorder


@Node public class EventRecorder extends User
Records all events in the world, saves them to the database, plays them back. This is a special case of Client that has no session, but copies scene and properties from the client it impersonates. By overriding Client's sendMessage(), it maintains internal list of received events. Once recording is done, i.e. stop() is called, event list is persisted to the database.
Author:
joe
See Also:
  • Constructor Details

    • EventRecorder

      public EventRecorder()
    • EventRecorder

      public EventRecorder(WorldManager worldManager, Client client, String name)
  • Method Details

    • init

      public void init(WorldManager worldManager, Client client)
    • start

      public void start()
    • stop

      public void stop()
    • processEvent

      public void processEvent(VREvent event)
      Description copied from class: Client
      Process an event received from other active objects, typically other users. This implementation serializes the event and sends it over websocket.
      Overrides:
      processEvent in class Client
      Parameters:
      event - Whatever has changed
    • sendMessage

      public void sendMessage(Object obj)
      Overrides:
      sendMessage in class Client
    • play

      public void play()
      Play recorded client events as own events, optionally restart the loop when finished.
    • play

      public void play(Client viewer)
      Play back to a client sends all recorded events back to a client, optionally restarts the loop when finished.
      Parameters:
      viewer - Client who's viewing the recording
    • addListener

      public void addListener(VRObject obj)
      Overrides:
      addListener in class VRObject
    • getEvents

      public Collection<PersistentEvent> getEvents()