From 80233b31a16636cf6db1f95d472f4d87ed3331ba Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Tue, 23 Nov 2010 21:13:41 +0000 Subject: [PATCH] Include the attribute clear in the compound event. We're getting some weird errors with duplicate receiver entries on reconnect in Spiral Knights, and I'm hoping this will fix them. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6301 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../presents/client/InvocationDirector.java | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/threerings/presents/client/InvocationDirector.java b/src/main/java/com/threerings/presents/client/InvocationDirector.java index d8b4b16be..c976a9844 100644 --- a/src/main/java/com/threerings/presents/client/InvocationDirector.java +++ b/src/main/java/com/threerings/presents/client/InvocationDirector.java @@ -79,9 +79,6 @@ public class InvocationDirector // add ourselves as an event listener clobj.addListener(InvocationDirector.this); - // clear out our previous registrations - clobj.setReceivers(new DSet()); - // keep a handle on this bad boy _clobj = clobj; @@ -160,6 +157,25 @@ public class InvocationDirector } } + /** + * Called when we log on; generates mappings for all receivers registered prior to logon. + */ + protected void assignReceiverIds () + { + // pack all the events into a single transaction + _clobj.startTransaction(); + try { + // clear out our previous registrations + _clobj.setReceivers(new DSet()); + + for (InvocationDecoder decoder : _reclist) { + assignReceiverId(decoder); + } + } finally { + _clobj.commitTransaction(); + } + } + /** * Assigns a receiver id to this decoder and publishes it in the {@link ClientObject#receivers} * field. @@ -174,22 +190,6 @@ public class InvocationDirector // Log.info("Registered receiver " + StringUtil.shortClassName(decoder) + " " + reg + "."); } - /** - * Called when we log on; generates mappings for all receivers registered prior to logon. - */ - protected void assignReceiverIds () - { - // pack all the set add events into a single transaction - _clobj.startTransaction(); - try { - for (InvocationDecoder decoder : _reclist) { - assignReceiverId(decoder); - } - } finally { - _clobj.commitTransaction(); - } - } - /** * Requests that the specified invocation request be packaged up and sent to the supplied * invocation oid.