Package org.vrspace.server.obj
Class EventRecorder
java.lang.Object
org.vrspace.server.obj.Entity
org.vrspace.server.obj.VRObject
org.vrspace.server.obj.Client
org.vrspace.server.obj.User
org.vrspace.server.obj.EventRecorder
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(VRObject obj) protected booleanbooleanlonggetStart()inthashCode()voidinit(WorldManager worldManager, Client client) booleanisLoop()booleanbooleanbooleanbooleanvoidplay()Play recorded client events as own events, optionally restart the loop when finished.voidPlay back to a client sends all recorded events back to a client, optionally restarts the loop when finished.voidprocessEvent(VREvent event) Process an event received from other active objects, typically other users.voidsendMessage(Object obj) voidvoidsetEvents(Collection<PersistentEvent> events) voidvoidsetLoop(boolean loop) voidsetPlaying(boolean playing) voidsetRecordClient(boolean recordClient) voidsetRecording(boolean recording) voidsetRecordScene(boolean recordScene) voidsetRestart(ScheduledExecutorService restart) voidsetStart(long start) voidstart()voidstop()toString()Methods inherited from class org.vrspace.server.obj.User
createScene, getLeftArmPos, getLeftArmRot, getOauth2provider, getRightArmPos, getRightArmRot, isHumanoid, isVideo, setHumanoid, setLeftArmPos, setLeftArmRot, setOauth2provider, setRightArmPos, setRightArmRot, setVideoMethods inherited from class org.vrspace.server.obj.Client
clearToken, getIdentity, getMapper, getName, getPicture, getPrivateMapper, getScene, getSceneProperties, getSession, getToken, getTokens, getUserHeight, getWriteBack, isGuest, setGuest, setIdentity, setMapper, setName, setPicture, setPrivateMapper, setScene, setSceneProperties, setSession, setToken, setTokens, setUserHeight, setWriteBackMethods inherited from class org.vrspace.server.obj.VRObject
active, addChildren, getActive, getAnimation, getChildren, getListeners, getMesh, getPermanent, getPosition, getProperties, getRotation, getScale, getScript, getTemporary, getWorld, getWorldId, isActive, isDeleted, isPermanent, isTemporary, notifyListeners, passive, removeListener, setActive, setAnimation, setChildren, setDeleted, setListeners, setMesh, setPermanent, setPosition, setProperties, setRotation, setScale, setScript, setTemporary, setWorld, setWorldIdMethods inherited from class org.vrspace.server.obj.Entity
dispose, getId, getObjectId, setId
-
Constructor Details
-
EventRecorder
public EventRecorder() -
EventRecorder
-
-
Method Details
-
init
-
start
public void start() -
stop
public void stop() -
processEvent
Description copied from class:ClientProcess an event received from other active objects, typically other users. This implementation serializes the event and sends it over websocket.- Overrides:
processEventin classClient- Parameters:
event- Whatever has changed
-
sendMessage
- Overrides:
sendMessagein classClient
-
play
public void play()Play recorded client events as own events, optionally restart the loop when finished. -
play
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
- Overrides:
addListenerin classVRObject
-
getEvents
-
isRecordClient
public boolean isRecordClient() -
isRecordScene
public boolean isRecordScene() -
isLoop
public boolean isLoop() -
getLength
-
getClient
-
isRecording
public boolean isRecording() -
getStart
public long getStart() -
isPlaying
public boolean isPlaying() -
getRestart
-
setRecordClient
public void setRecordClient(boolean recordClient) -
setRecordScene
public void setRecordScene(boolean recordScene) -
setLoop
public void setLoop(boolean loop) -
setLength
-
setEvents
-
setClient
-
setRecording
public void setRecording(boolean recording) -
setStart
public void setStart(long start) -
setPlaying
public void setPlaying(boolean playing) -
setRestart
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-