Getting a list of zones is fairly easy but if I want to know details of everything in a zone is kind of harder. I thought of serialization but RPObjects are not serializable, they use a custom way of serialization.
Is there a way to send a custom perception to a client instead? To avoid reinventing the wheel.
You seem to have CSS turned off.
Please don't fill out this field.
For a snapshot, you could try something like the Inspect scripts we use in Stendhal. With FieldInspect (http://arianne.cvs.sourceforge.net/viewvc/arianne/stendhal/src/games/stendhal/server/script/FieldInspect.java) for example, the java fields of any entity are written to string and sent as a private message to the player. In fact, it would be better to use an RPEvent for this, but this is an older script. The FieldLister code is at http://arianne.cvs.sourceforge.net/viewvc/arianne/stendhal/src/games/stendhal/server/core/reflectiondebugger/FieldLister.java.
Likewise to inspect all attributes, slots and slot contents of a player, we can use DeepInspect (http://arianne.cvs.sourceforge.net/viewvc/arianne/stendhal/src/games/stendhal/server/script/DeepInspect.java). Again, an RPEvent would be more suitable than a dump of text here. And it would be good to be able to filter, if we really want to see all the details of each item in each slot of the Player, or not, so if you plan a similar approach, you may like to build in such filters from the start.
Live monitoring would be a different case. Why aren't the normal perceptions suitable here? If you want details for more than one zone (e.g neighbouring zones) you could clone the perceptions for the other zones.
Can you give more detail on your requirements?
Thanks for the code. It really helps! I will turn those into RPEvents they'll become handy.
Here's my current status:
1) Was able to make my application connect to the server using an extension and a client.
2) Using RPEvent a list of zones or list of objects within a zone can be retrieved.
That's a good start just to get my application started, but as time progresses and I need more and more data I believe perception is the correct way.
I'm modifying my plugin system (initially based on Stendahl's) so it can do the following:
1) Customize the client object (the RPClass representing the client i.e. player)
2) Modify the perception of an object
3) Do something when an obbect is added/removed from a zone
I'm interested in the perception cloning from other zones. Care to explain a little bit?
Perception cloning was an idea from a discussion with hendrik. I don't know enough about it, to flesh out the idea, sorry.
I was able to do everything I needed (in theory). I upgraded the extension system allowing plugins to hook into different parts of the server life cycle:
1) Object added to Zone
2) Object removed from zone
3) Perception generation
4) Modify client object declaration (RPClass)
5) Update database (add tables and DAOs)
6) After world is initialized
All are working fine and I'm in the process of refactoring. Is this something the team would like into the Marauroa core?
I'm working on #3 right now. I hoped that I would be able to add information of other zones in the same perception but seems hard to do. I guess I could accumulate changes until I got one for each zone and use the zone id attribute in each RPObject to tell them apart. But this can turn into a huge perception.
The other option is to send copies of perceptions from other zones than the one the monitor is in but that would require access to sendPlayerPerception within RPServerManager. At least protected so I can declare a class in the plugin under the same package.
Sign up for the SourceForge newsletter: