diff --git a/README.md b/README.md index 1068a6b..0aafe12 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Implementation of Colyseus client using Kotlin ```groovy dependencies { - implementation 'io.github.doorbash:colyseus-kotlin:0.14.0-alpha.8' + implementation 'io.github.doorbash:colyseus-kotlin:0.14.0-alpha.9' } ``` diff --git a/build.gradle b/build.gradle index dcbc4fc..f58995d 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ apply plugin: 'com.novoda.bintray-release' apply plugin: 'kotlin' group 'io.github.doorbash' -version '0.14.0-alpha.8' +version '0.14.0-alpha.9' repositories { mavenCentral() @@ -38,7 +38,7 @@ dependencies { publish { def groupProjectID = 'io.github.doorbash' def artifactProjectID = 'colyseus-kotlin' - def publishVersionID = '0.14.0-alpha.8' + def publishVersionID = '0.14.0-alpha.9' userOrg = 'doorbash' repoName = 'io.github.doorbash' groupId = groupProjectID diff --git a/src/main/java/io/colyseus/serializer/SchemaSerializer.kt b/src/main/java/io/colyseus/serializer/SchemaSerializer.kt index 1dae129..ddd4095 100644 --- a/src/main/java/io/colyseus/serializer/SchemaSerializer.kt +++ b/src/main/java/io/colyseus/serializer/SchemaSerializer.kt @@ -7,24 +7,23 @@ import io.colyseus.serializer.schema.ReferenceTracker import io.colyseus.serializer.schema.Schema import io.colyseus.serializer.schema.types.SchemaReflection import io.colyseus.serializer.schema.types.SchemaReflectionType -import io.colyseus.util.Lock import io.colyseus.util.allFields class SchemaSerializer(val schema: Class) { var state: T = schema.getConstructor().newInstance() as T var refs = ReferenceTracker() - val lock = Lock() +// val lock = Lock() fun setState(data: ByteArray, offset: Int = 0) { - lock.withLock { - state.decode(data, Iterator(offset), refs) - } +// lock.withLock { + state.decode(data, Iterator(offset), refs) +// } } fun patch(data: ByteArray, offset: Int = 0) { - lock.withLock { - state.decode(data, Iterator(offset), refs) - } +// lock.withLock { + state.decode(data, Iterator(offset), refs) +// } } fun teardown() { @@ -34,15 +33,15 @@ class SchemaSerializer(val schema: Class) { } fun handshake(bytes: ByteArray?, offset: Int = 0) { - lock.withLock { - val reflection = SchemaReflection() - reflection.decode(bytes!!, Iterator(offset)) - Context.instance.clear() - initTypes(reflection, schema = schema as Class) - for (rt in reflection.types) { - Context.instance.setTypeId(rt?.type!!, rt.id) - } +// lock.withLock { + val reflection = SchemaReflection() + reflection.decode(bytes!!, Iterator(offset)) + Context.instance.clear() + initTypes(reflection, schema = schema as Class) + for (rt in reflection.types) { + Context.instance.setTypeId(rt?.type!!, rt.id) } +// } } private fun initTypes(reflection: SchemaReflection, index: Int = reflection.rootType, schema: Class) {