mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-02-13 03:33:37 +00:00
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:
parent
270485fa4d
commit
e51e970e51
12 changed files with 127 additions and 139 deletions
13
common/src/main/java/scodec/interop/akka/PrivacyHelper.java
Normal file
13
common/src/main/java/scodec/interop/akka/PrivacyHelper.java
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
16
common/src/main/scala/scodec/interop/akka/package.scala
Normal file
16
common/src/main/scala/scodec/interop/akka/package.scala
Normal 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)
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue