diff --git a/src/dorkbox/network/serialization/ClassRegistration.kt b/src/dorkbox/network/serialization/ClassRegistration.kt index 889caa0e..77d65dec 100644 --- a/src/dorkbox/network/serialization/ClassRegistration.kt +++ b/src/dorkbox/network/serialization/ClassRegistration.kt @@ -33,8 +33,12 @@ internal abstract class ClassRegistration(val clazz: Class<*>, val serializer: S */ open fun register(kryo: KryoExtra, rmi: RmiHolder) { // ClassRegistrationForRmi overrides this method + if (id == IGNORE_REGISTRATION) { + // we have previously specified that this registration should be ignored! + return + } - if (id != 0) { + if (id > 0) { // our ID will always be > 0 // this means that this registration was PREVIOUSLY registered on a different kryo. Shortcut the logic. diff --git a/src/dorkbox/network/serialization/ClassRegistrationForRmi.kt b/src/dorkbox/network/serialization/ClassRegistrationForRmi.kt index c68b4984..70d9b1eb 100644 --- a/src/dorkbox/network/serialization/ClassRegistrationForRmi.kt +++ b/src/dorkbox/network/serialization/ClassRegistrationForRmi.kt @@ -105,7 +105,12 @@ internal class ClassRegistrationForRmi(ifaceClass: Class<*>, */ override fun register(kryo: KryoExtra, rmi: RmiHolder) { // we override this, because we ALWAYS will call our RMI registration! - if (id != 0) { + if (id == IGNORE_REGISTRATION) { + // we have previously specified that this registration should be ignored! + return + } + + if (id > 0) { // our ID will always be > 0 // this means that this registration was PREVIOUSLY registered on a different kryo. Shortcut the logic.