Is there a way to send a custom perception?

Developers
2011-04-14
2013-06-06
  • 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.

     
  • 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?

     
  • Katie Russell
    Katie Russell
    2011-04-18

    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.

    Feedback?

     


Anonymous


Cancel   Add attachments