Update to Scala 2.13 & Akka 2.6.5 (#461)

* update scala to 2.13 & update dependencies

* fix test

* import scodec-akka

* scala 2.13 fixes

* Work around futures not completing when awaited within object constructor

Co-authored-by: Mazo <mazo2@hotmail.com>
This commit is contained in:
Jakob Gillich 2020-05-26 22:16:22 +02:00 committed by GitHub
parent 270485fa4d
commit e51e970e51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 127 additions and 139 deletions

View file

@ -0,0 +1,13 @@
package scodec.interop.akka;
import java.nio.ByteBuffer;
import akka.util.ByteString.ByteString1C;
interface PrivacyHelper {
static ByteString1C createByteString1C(byte[] array) {
return new ByteString1C(array);
}
}

View file

@ -0,0 +1,16 @@
package scodec.interop
import scodec.bits.ByteVector
import _root_.akka.util.ByteString
package object akka {
implicit class EnrichedByteString(val value: ByteString) extends AnyVal {
def toByteVector: ByteVector = ByteVector.viewAt((idx: Long) => value(idx.toInt), value.size.toLong)
}
implicit class EnrichedByteVector(val value: ByteVector) extends AnyVal {
def toByteString: ByteString = PrivacyHelper.createByteString1C(value.toArray)
}
}

View file

@ -10,6 +10,7 @@ import net.psforever.objects.zones.Zone
import net.psforever.packet.game._
import net.psforever.types._
import services.{GenericEventBus, Service}
import services.teamwork.SquadAction
import scala.collection.concurrent.TrieMap
import scala.collection.mutable

View file

@ -5,6 +5,7 @@ import net.psforever.objects.teamwork.Squad
import net.psforever.packet.game._
import net.psforever.types.{PlanetSideGUID, SquadResponseType, SquadWaypoints}
import services.GenericEventBusMsg
import services.teamwork.SquadAction
final case class SquadServiceResponse(toChannel : String, exclude : Iterable[Long], response : SquadResponse.Response) extends GenericEventBusMsg

View file

@ -41,7 +41,7 @@ class ZoneTest extends Specification {
"associates objects to bases (doesn't check numbers)" in {
val map = new ZoneMap("map13")
map.ObjectToBuilding mustEqual Nil
map.ObjectToBuilding mustEqual Map.empty
map.ObjectToBuilding(1, 2)
map.ObjectToBuilding mustEqual Map(1 -> 2)
map.ObjectToBuilding(3, 4)