Package marauroa.client.net
Interface IPerceptionListener
- All Known Implementing Classes:
PerceptionListenerImpl
public interface IPerceptionListener
The IPerceptionListener interface provides methods that are called while
applying the perception
-
Method Summary
Modifier and TypeMethodDescriptionboolean
onAdded is called when an object is added to the world for first time or after a sync perception.boolean
onClear()
onClear is called when the whole world is going to be cleared.boolean
onDeleted is called when an object is removed of the world Return true to stop further processing.void
onException(Exception exception, MessageS2CPerception perception)
onException is called when an exception happensboolean
onModifiedAdded(RPObject object, RPObject changes)
onModifiedAdded is called when an object is modified by adding or changing one of its attributes.boolean
onModifiedDeleted(RPObject object, RPObject changes)
onModifiedDeleted is called each time the object has one of its attributes removed.boolean
onMyRPObject(RPObject added, RPObject deleted)
onMyRPObject is called when our rpobject avatar is processed.void
onPerceptionBegin(byte type, int timestamp)
onPerceptionBegin is called when the perception is going to be appliedvoid
onPerceptionEnd(byte type, int timestamp)
onPerceptionBegin is called when the perception has been appliedvoid
onSynced()
onSynced is called when the client recover syncvoid
onUnsynced is called when the client lose sync
-
Method Details
-
onAdded
onAdded is called when an object is added to the world for first time or after a sync perception. Return true to stop further processing.- Parameters:
object
- the added object.- Returns:
- true to stop further processing
-
onModifiedAdded
onModifiedAdded is called when an object is modified by adding or changing one of its attributes. Return true to stop further processing. Note that the method is called *before* modifying the object.- Parameters:
object
- the original objectchanges
- the added and modified changes.- Returns:
- true to stop further processing
-
onModifiedDeleted
onModifiedDeleted is called each time the object has one of its attributes removed. Return true to stop further processing. Note that the method is called *before* modifying the object.- Parameters:
object
- the original objectchanges
- the deleted attributes.- Returns:
- true to stop further processing
-
onDeleted
onDeleted is called when an object is removed of the world Return true to stop further processing.- Parameters:
object
- the original object- Returns:
- true to stop further processing
-
onMyRPObject
onMyRPObject is called when our rpobject avatar is processed. Return true to stop further processing.- Parameters:
added
- the added and modified attributes and slotsdeleted
- the deleted attributes- Returns:
- true to stop further processing
-
onClear
boolean onClear()onClear is called when the whole world is going to be cleared. It happens on sync perceptions Return true to stop further processing.- Returns:
- true to stop further processing
-
onSynced
void onSynced()onSynced is called when the client recover sync -
onUnsynced
void onUnsynced()onUnsynced is called when the client lose sync -
onPerceptionBegin
void onPerceptionBegin(byte type, int timestamp)onPerceptionBegin is called when the perception is going to be applied- Parameters:
type
- type of the perception: SYNC or DELTAtimestamp
- the timestamp of the perception
-
onPerceptionEnd
void onPerceptionEnd(byte type, int timestamp)onPerceptionBegin is called when the perception has been applied- Parameters:
type
- type of the perception: SYNC or DELTAtimestamp
- the timestamp of the perception
-
onException
onException is called when an exception happens- Parameters:
exception
- the exception that happened.perception
- the message that causes the problem
-