problems with Event on marauroa

  • Anonymous - 2010-07-11


    first of all thanks for the marauroa, it has been a great help with my project..

    I'm using marauroa 3.8 and JDK 1.6.0_20..

    So far I've managed to use marauroa for most of my needs. But got stuck with the RPEvents.
    I want to send some private Events upon some actions received from the client.

    I've the RPClass as follows.

    RPClass cards = new RPClass("test");
    cards.add(Definition.DefinitionClass.ATTRIBUTE, "1", Definition.Type.STRING, Definition.PRIVATE);
    cards.add(Definition.DefinitionClass.ATTRIBUTE, "2", Definition.Type.STRING, Definition.STANDARD);

    and on execute method of MyRPRuleProcessor is as follows:

    public void execute(RPObject caster, RPAction action) {
    RPEvent event = new RPEvent("test");

    event.put("1", "privateAttr");
    event.put("2", "standarAttr");

    when I add the Event to RPObject as above, on execute method, no event is sent to the client. I also tried to send events to client on onInit method of MyRPRuleProcessor as below.

    public void onInit(RPObject object) {
    RPEvent event = new RPEvent("test");

    event.put("1", "privateAttr");
    event.put("2", "standarAttr");

    in that case I receive the standard attribute ("2") on the client side but not the private attribute ("1").. I checked the wiki, API and all documents I could find, but I've not been able to see any samples about private RPEvents..

    thanks in advance for any suggestions..

  • Hendrik Brummermann

    Hi teamy,

    public RPEvents are part of onAdded() if they are created during a zone change/login (full perception). If they are created when the player is already in the zone, they are part of second parameter in onModifiedAdded().

    I can reproduce the issue with the private attributes of RPEvents:
    If the RPEvent is defined as public in RPClass.addRPEvent() on the object it belongs to, only public attributes of the RPEvent are sent to everyone.
    If the RPEvent is defined as private in RPClass.addRPEvent() on the object it belong to, both public and private attributes are sent to the client associated with the object, the event is not sent to anyone else.

    I am sorry, I don't have a good idea how to fix this in Marauroa, yet:

    The public RPEvent is part of the shared public perception. The private RPEvent is part of the private addition of the perception. But if the RPEvent was public, it was already processed and will not be added to the private perception. Just adding it there will cause the RPEvent to be duplicated and i guess that will break clients.

    As a workaround you can create a pair of a public and a private event with the correct information, and ignore the public one if it belong to the own client.



Cancel  Add attachments

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks