Persistent Chat Messages

47 views
Skip to first unread message

Christian Mays

unread,
Mar 11, 2020, 10:47:08 PM3/11/20
to Open Wonderland Forum
I need a way to persist events that occur in a given World. Is there an existing module that will record event in the world such as Player joins world, player interacts with Cell, player sends Text Chat and so on?

If not, I was trying to implement a TextChatMessageListener and register it in my custom module. What would be the optimal/recommended place to register my custom TextChatMessageListener?

Also, going this route, is there a Listener for when a person joins the world and other important interactions?

Message has been deleted

Abhishek Upadhyay

unread,
Mar 12, 2020, 1:50:30 AM3/12/20
to Open Wonderland Forum
Hi Christian,

Everything you see in the world is a Cell in Openwonderland. So you can listen all the activities in the world using CellStatusChangeListener interfaceYou can find that class in "wonderland\core\src\classes\org\jdesktop\wonderland\client\cell" location. You can implement this interface and you can catch all activities in cellStatusChanged() method.

More avatar related events can be captured in AvatarChangedListener. It is an inner class of org.jdesktop.wonderland.modules.avatarbase.client.jme.cellrenderer.AvatarImiJME class.

Better to register all these listeners CellStatusChangeListener, AvatarChangedListener, TextChatMessageListener, etc in your custom modules and log activities on some datasource.

Hope this helps !!

Christian Mays

unread,
Mar 12, 2020, 10:42:50 AM3/12/20
to Open Wonderland Forum
Thanks, it does help. 
I am having an issue registering listeners. I tried registering the TextChatMessageListener in my *ServerPlugin class that has the annotation @Plugin using the following lines:

CommsManager commsMan = WonderlandContext.getCommsManager();

        TextChatConnectionHandler tcch = (TextChatConnectionHandler)commsMan.getClientHandler(TextChatConnectionType.CLIENT_TYPE);

        tcch.addTextChatMessageListener(this);



This is a way I threw together by just looking at functions available in classes. Is there a simple more recommended way to register Listeners (that actually works lol).

Christian Mays

unread,
Mar 12, 2020, 5:12:38 PM3/12/20
to Open Wonderland Forum
I event up getting the TextChatMessageListener to work. The issue had to do with my custom module loading before the TextChat module.
I used a cheap workaround to get is to work ( I named my module to begin with "z" instead of "e" ="zeventsender" )

Is there a way to specify load order to the @Plugins?

Abhishek Upadhyay

unread,
Mar 13, 2020, 2:47:50 AM3/13/20
to Open Wonderland Forum
Hi Christian,

Check in ServerSessionManager.initPlugins() method, there all plugins are loaded. There you can modify code to wait until text chat plugin loads and then load your plugin. Don't think there is any other way to define order.

Christian Mays

unread,
Mar 13, 2020, 10:06:12 AM3/13/20
to Open Wonderland Forum
Thanks
Reply all
Reply to author
Forward
0 new messages