Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 7 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ on:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Prove migrations + tests across the current (12.8) and newer PostgreSQL majors.
postgres: ['12.8', '16', '17']
services:
postgres:
image: postgres:12.8
image: postgres:${{ matrix.postgres }}
env:
POSTGRES_DB: psforever
POSTGRES_USER: psforever
Expand All @@ -37,7 +42,7 @@ jobs:
- name: Setup Scala
uses: coursier/setup-action@v1
with:
jvm: adopt:11
jvm: temurin:21
apps: sbt

- name: Run migrations
Expand Down
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
FROM sbtscala/scala-sbt:eclipse-temurin-focal-11.0.17_8_1.8.2_2.13.10 as builder
# JDK 21 builder. The project's Scala/sbt versions come from build.sbt/build.properties;
# this tag only needs to provide JDK 21 + an sbt launcher (which fetches sbt 1.10.7 /
# Scala 2.13.16 per the project). No published sbtscala tag bundles 1.10.7_2.13.16, so we
# use the newest available JDK-21 launcher tag. See https://hub.docker.com/r/sbtscala/scala-sbt/tags
FROM sbtscala/scala-sbt:eclipse-temurin-jammy-21.0.2_13_1.10.4_2.13.15 as builder

COPY . /PSF-LoginServer

WORKDIR /PSF-LoginServer

RUN sbt server/pack

FROM openjdk:18-slim
FROM eclipse-temurin:21-jre

COPY --from=builder /PSF-LoginServer/server/target/pack/ /usr/local

Expand Down
78 changes: 43 additions & 35 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
lazy val psforeverSettings = Seq(
organization := "net.psforever",
version := "1.0.2-SNAPSHOT",
scalaVersion := "2.13.10",
scalaVersion := "2.13.16",
Global / cancelable := false,
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision,
// Disabled: sbt-scalafix 0.10.4 pins semanticdb 4.6.0, which has no build for Scala 2.13.16.
// Re-enable alongside an sbt-scalafix bump that supplies a 2.13.16-compatible semanticdb.
// This only affects the scalafix linter, not compilation or tests.
semanticdbEnabled := false,
//semanticdbVersion := scalafixSemanticdb.revision,
scalacOptions := Seq(
"-unchecked",
"-feature",
Expand Down Expand Up @@ -40,46 +43,51 @@ lazy val psforeverSettings = Seq(
classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.Flat,
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
libraryDependencies ++= Seq(
// Akka 2.8+ is BSL licensed, do not upgrade
"com.typesafe.akka" %% "akka-actor" % "2.6.20",
"com.typesafe.akka" %% "akka-slf4j" % "2.6.20",
"com.typesafe.akka" %% "akka-protobuf-v3" % "2.6.20",
"com.typesafe.akka" %% "akka-stream" % "2.6.20",
"com.typesafe.akka" %% "akka-testkit" % "2.6.20" % "test",
"com.typesafe.akka" %% "akka-actor-typed" % "2.6.20",
"com.typesafe.akka" %% "akka-actor-testkit-typed" % "2.6.20" % "test",
"com.typesafe.akka" %% "akka-slf4j" % "2.6.20",
"com.typesafe.akka" %% "akka-cluster-typed" % "2.6.20",
"com.typesafe.akka" %% "akka-coordination" % "2.6.20",
"com.typesafe.akka" %% "akka-cluster-tools" % "2.6.20",
"com.typesafe.akka" %% "akka-http" % "10.2.10",
// Apache Pekko: the Apache-2.0 licensed fork of Akka 2.6.x (drop-in namespace change).
// NOTE: pekko-protobuf-v3 / pekko-stream / pekko-cluster-typed / pekko-cluster-tools /
// pekko-coordination / pekko-http currently have 0 direct imports in the source tree and
// are kept only for behavioral parity with the Akka set; they are removal candidates once
// the test suite is green.
"org.apache.pekko" %% "pekko-actor" % "1.1.3",
"org.apache.pekko" %% "pekko-slf4j" % "1.1.3",
"org.apache.pekko" %% "pekko-protobuf-v3" % "1.1.3",
"org.apache.pekko" %% "pekko-stream" % "1.1.3",
"org.apache.pekko" %% "pekko-testkit" % "1.1.3" % "test",
"org.apache.pekko" %% "pekko-actor-typed" % "1.1.3",
"org.apache.pekko" %% "pekko-actor-testkit-typed" % "1.1.3" % "test",
"org.apache.pekko" %% "pekko-cluster-typed" % "1.1.3",
"org.apache.pekko" %% "pekko-coordination" % "1.1.3",
"org.apache.pekko" %% "pekko-cluster-tools" % "1.1.3",
"org.apache.pekko" %% "pekko-http" % "1.1.0",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.5",
"org.specs2" %% "specs2-core" % "4.20.0" % "test",
"org.scalatest" %% "scalatest" % "3.2.15" % "test",
"org.specs2" %% "specs2-core" % "4.20.9" % "test",
"org.scalatest" %% "scalatest" % "3.2.19" % "test",
"org.scodec" %% "scodec-core" % "1.11.10",
"ch.qos.logback" % "logback-classic" % "1.2.12",
"ch.qos.logback" % "logback-classic" % "1.5.18",
"org.log4s" %% "log4s" % "1.10.0",
"org.fusesource.jansi" % "jansi" % "2.4.0",
"com.github.nscala-time" %% "nscala-time" % "2.32.0",
"org.fusesource.jansi" % "jansi" % "2.4.1",
"com.github.nscala-time" %% "nscala-time" % "2.34.0",
"com.github.t3hnar" %% "scala-bcrypt" % "4.3.0",
"org.scala-graph" %% "graph-core" % "1.13.5",
"io.kamon" %% "kamon-bundle" % "2.6.1",
"io.kamon" %% "kamon-apm-reporter" % "2.6.0",
"org.json4s" %% "json4s-native" % "4.0.6",
"io.kamon" %% "kamon-bundle" % "2.7.7",
"io.kamon" %% "kamon-apm-reporter" % "2.7.7",
"org.json4s" %% "json4s-native" % "4.0.7",
"io.getquill" %% "quill-jasync-postgres" % "3.18.0",
"org.flywaydb" % "flyway-core" % "9.16.0",
"org.postgresql" % "postgresql" % "42.5.4",
"com.typesafe" % "config" % "1.4.2",
"com.github.pureconfig" %% "pureconfig" % "0.17.4",
"com.beachape" %% "enumeratum" % "1.7.2",
"commons-io" % "commons-io" % "2.13.0",
"org.flywaydb" % "flyway-core" % "10.20.1",
// Flyway 10 is modular: the PostgreSQL dialect moved into its own artifact.
"org.flywaydb" % "flyway-database-postgresql" % "10.20.1",
"org.postgresql" % "postgresql" % "42.7.4",
"com.typesafe" % "config" % "1.4.3",
"com.github.pureconfig" %% "pureconfig" % "0.17.7",
"com.beachape" %% "enumeratum" % "1.7.3",
"commons-io" % "commons-io" % "2.16.1",
"com.github.scopt" %% "scopt" % "4.1.0",
"io.sentry" % "sentry-logback" % "6.19.0",
"io.circe" %% "circe-core" % "0.14.5",
"io.circe" %% "circe-generic" % "0.14.5",
"io.circe" %% "circe-parser" % "0.14.5",
"io.sentry" % "sentry-logback" % "6.34.0",
"io.circe" %% "circe-core" % "0.14.9",
"io.circe" %% "circe-generic" % "0.14.9",
"io.circe" %% "circe-parser" % "0.14.9",
"org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.4",
"org.bouncycastle" % "bcprov-jdk15on" % "1.70"
"org.bouncycastle" % "bcprov-jdk18on" % "1.78.1"
),
dependencyOverrides ++= Seq(
"com.github.jasync-sql" % "jasync-postgresql" % "1.2.3",
Expand Down
7 changes: 5 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
services:
loginserver:
image: sbtscala/scala-sbt:eclipse-temurin-jammy-8u352-b08_1.8.3_2.13.10
# Image only needs to provide JDK 21 + an sbt launcher; the project's sbt (1.10.7)
# and Scala (2.13.16) versions come from build.properties/build.sbt and are fetched
# by the launcher. (No published sbtscala tag bundles 1.10.7_2.13.16.)
image: sbtscala/scala-sbt:eclipse-temurin-jammy-21.0.2_13_1.10.4_2.13.15
volumes:
- .:/PSF-Loginserver:z
working_dir: /PSF-Loginserver
Expand All @@ -18,7 +21,7 @@ services:
ports:
- 51010:8080
db:
image: postgres:14
image: postgres:${POSTGRES_VERSION:-18}
ports:
- 5432:5432
environment:
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.8.2
sbt.version = 1.10.7
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ logLevel := Level.Warn

addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.17")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.7")
addSbtPlugin("io.kamon" % "sbt-kanela-runner" % "2.0.14")
addSbtPlugin("io.kamon" % "sbt-kanela-runner" % "2.1.1")
//addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.3")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.4")
10 changes: 5 additions & 5 deletions server/src/main/scala/net/psforever/server/Server.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import java.util.UUID.randomUUID
import java.util.concurrent.atomic.AtomicLong
import scala.concurrent.Future
import scala.concurrent.Await
import akka.actor.ActorSystem
import akka.actor.typed.ActorRef
import akka.actor.typed.scaladsl.Behaviors
import akka.{actor => classic}
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.actor.typed.ActorRef
import org.apache.pekko.actor.typed.scaladsl.Behaviors
import org.apache.pekko.{actor => classic}
import ch.qos.logback.classic.LoggerContext
import ch.qos.logback.classic.joran.JoranConfigurator
import io.sentry.{Sentry, SentryOptions}
Expand All @@ -34,7 +34,7 @@ import org.fusesource.jansi.Ansi.Color._
import org.fusesource.jansi.Ansi._
import org.slf4j
import scopt.OParser
import akka.actor.typed.scaladsl.adapter._
import org.apache.pekko.actor.typed.scaladsl.adapter._
import kamon.Kamon
import net.psforever.packet.PlanetSidePacket
import net.psforever.services.hart.HartService
Expand Down
4 changes: 2 additions & 2 deletions server/src/test/scala/PacketCodingActorTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package net.psforever.pslogin
/*

import actor.base.ActorTest
import akka.actor.{ActorRef, Props}
import akka.testkit.TestProbe
import org.apache.pekko.actor.{ActorRef, Props}
import org.apache.pekko.testkit.TestProbe
import net.psforever.actors.net.MiddlewareActor
import net.psforever.objects.avatar.Certification
import net.psforever.packet.control.{ControlSync, SlottedMetaPacket}
Expand Down
12 changes: 6 additions & 6 deletions server/src/test/scala/actor/base/ActorTest.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) 2017 PSForever
package actor.base

import akka.actor.ActorSystem
import akka.testkit.{ImplicitSender, TestKit}
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.testkit.{ImplicitSender, TestKit}
import com.typesafe.config.ConfigFactory
import org.scalatest.BeforeAndAfterAll
import org.scalatest.matchers.should.Matchers
Expand All @@ -24,9 +24,9 @@ abstract class ActorTest(sys: ActorSystem = ActorSystem("system", ConfigFactory.
object ActorTest {
import scala.jdk.CollectionConverters._
private val LoggingConfig = Map(
"akka.loggers" -> List("akka.testkit.TestEventListener").asJava,
"akka.loglevel" -> "OFF",
"akka.stdout-loglevel" -> "OFF",
"akka.log-dead-letters" -> "OFF"
"pekko.loggers" -> List("org.apache.pekko.testkit.TestEventListener").asJava,
"pekko.loglevel" -> "OFF",
"pekko.stdout-loglevel" -> "OFF",
"pekko.log-dead-letters" -> "OFF"
).asJava
}
6 changes: 3 additions & 3 deletions server/src/test/scala/actor/base/FreedContextActorTest.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) 2020 PSForever
package actor.base

import akka.actor.{Actor, ActorContext, ActorRef, Props}
import akka.pattern.ask
import akka.util.Timeout
import org.apache.pekko.actor.{Actor, ActorContext, ActorRef, Props}
import org.apache.pekko.pattern.ask
import org.apache.pekko.util.Timeout

import scala.concurrent.Await
import scala.concurrent.duration._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) 2020 PSForever
package actor.objects

import akka.actor.Props
import akka.testkit.TestProbe
import base.FreedContextActorTest
import org.apache.pekko.actor.Props
import org.apache.pekko.testkit.TestProbe
import actor.base.FreedContextActorTest
import net.psforever.actors.zone.BuildingActor
import net.psforever.objects.avatar.Avatar
import net.psforever.objects.ballistics.Projectile
Expand All @@ -30,7 +30,7 @@ import scala.collection.concurrent.TrieMap
import scala.concurrent.duration._

class AutoRepairFacilityIntegrationTest extends FreedContextActorTest {
import akka.actor.typed.scaladsl.adapter._
import org.apache.pekko.actor.typed.scaladsl.adapter._
system.spawn(InterstellarClusterService(Nil), InterstellarClusterService.InterstellarClusterServiceKey.id)
ServiceManager.boot(system) ! ServiceManager.Register(GalaxyService(), "galaxy")
expectNoMessage(1000 milliseconds)
Expand Down Expand Up @@ -103,7 +103,7 @@ class AutoRepairFacilityIntegrationTest extends FreedContextActorTest {
}

class AutoRepairFacilityIntegrationGiveNtuTest extends FreedContextActorTest {
import akka.actor.typed.scaladsl.adapter._
import org.apache.pekko.actor.typed.scaladsl.adapter._
system.spawn(InterstellarClusterService(Nil), InterstellarClusterService.InterstellarClusterServiceKey.id)
ServiceManager.boot(system) ! ServiceManager.Register(GalaxyService(), "galaxy")
expectNoMessage(1000 milliseconds)
Expand Down Expand Up @@ -158,7 +158,7 @@ class AutoRepairFacilityIntegrationGiveNtuTest extends FreedContextActorTest {
}

class AutoRepairFacilityIntegrationAntGiveNtuTest extends FreedContextActorTest {
import akka.actor.typed.scaladsl.adapter._
import org.apache.pekko.actor.typed.scaladsl.adapter._
system.spawn(InterstellarClusterService(Nil), InterstellarClusterService.InterstellarClusterServiceKey.id)
ServiceManager.boot(system) ! ServiceManager.Register(GalaxyService(), "galaxy")
expectNoMessage(1000 milliseconds)
Expand Down Expand Up @@ -249,7 +249,7 @@ class AutoRepairFacilityIntegrationAntGiveNtuTest extends FreedContextActorTest
}

class AutoRepairFacilityIntegrationTerminalDestroyedTerminalAntTest extends FreedContextActorTest {
import akka.actor.typed.scaladsl.adapter._
import org.apache.pekko.actor.typed.scaladsl.adapter._
system.spawn(InterstellarClusterService(Nil), InterstellarClusterService.InterstellarClusterServiceKey.id)
ServiceManager.boot(system) ! ServiceManager.Register(GalaxyService(), "galaxy")
expectNoMessage(1000 milliseconds)
Expand Down Expand Up @@ -351,7 +351,7 @@ class AutoRepairFacilityIntegrationTerminalDestroyedTerminalAntTest extends Free
}

class AutoRepairFacilityIntegrationTerminalIncompleteRepairTest extends FreedContextActorTest {
import akka.actor.typed.scaladsl.adapter._
import org.apache.pekko.actor.typed.scaladsl.adapter._
system.spawn(InterstellarClusterService(Nil), InterstellarClusterService.InterstellarClusterServiceKey.id)
ServiceManager.boot(system) ! ServiceManager.Register(GalaxyService(), "galaxy")
expectNoMessage(1000 milliseconds)
Expand Down Expand Up @@ -467,7 +467,7 @@ class AutoRepairFacilityIntegrationTerminalIncompleteRepairTest extends FreedCon
}

class AutoRepairTowerIntegrationTest extends FreedContextActorTest {
import akka.actor.typed.scaladsl.adapter._
import org.apache.pekko.actor.typed.scaladsl.adapter._
system.spawn(InterstellarClusterService(Nil), InterstellarClusterService.InterstellarClusterServiceKey.id)
ServiceManager.boot(system) ! ServiceManager.Register(GalaxyService(), "galaxy")
expectNoMessage(1000 milliseconds)
Expand Down
6 changes: 3 additions & 3 deletions server/src/test/scala/actor/objects/AutoRepairTest.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) 2020 PSForever
package actor.objects

import akka.actor.Props
import akka.testkit.TestProbe
import base.FreedContextActorTest
import org.apache.pekko.actor.Props
import org.apache.pekko.testkit.TestProbe
import actor.base.FreedContextActorTest
import net.psforever.actors.commands.NtuCommand
import net.psforever.actors.zone.BuildingActor
import net.psforever.objects.avatar.Avatar
Expand Down
6 changes: 3 additions & 3 deletions server/src/test/scala/actor/objects/VehicleSpawnPadTest.scala
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// Copyright (c) 2017 PSForever
package actor.objects

import akka.actor.{ActorRef, ActorSystem, Props}
import akka.testkit.TestProbe
import org.apache.pekko.actor.{ActorRef, ActorSystem, Props}
import org.apache.pekko.testkit.TestProbe
import actor.base.ActorTest
import net.psforever.objects.serverobject.pad.{VehicleSpawnControl, VehicleSpawnPad}
import net.psforever.objects.serverobject.structures.StructureType
import net.psforever.objects.{GlobalDefinitions, Player, Vehicle}
import net.psforever.objects.zones.Zone
import net.psforever.types.{PlanetSideGUID, _}
import net.psforever.services.vehicle.VehicleAction
import akka.actor.typed.scaladsl.adapter._
import org.apache.pekko.actor.typed.scaladsl.adapter._
import net.psforever.actors.zone.ZoneActor
import net.psforever.objects.avatar.Avatar
import net.psforever.objects.serverobject.terminals.Terminal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package scodec.interop.akka;
package scodec.interop.pekko;

import java.nio.ByteBuffer;

import akka.util.ByteString.ByteString1C;
import org.apache.pekko.util.ByteString.ByteString1C;

interface PrivacyHelper {

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -634,5 +634,5 @@ sentry {
dsn = ""
}

include "akka.conf"
include "pekko.conf"
include "dispatchers.conf"
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
akka {
loggers = ["akka.event.slf4j.Slf4jLogger"]
pekko {
loggers = ["org.apache.pekko.event.slf4j.Slf4jLogger"]
loglevel = INFO
logging-filter = akka.event.slf4j.Slf4jLoggingFilter
logging-filter = org.apache.pekko.event.slf4j.Slf4jLoggingFilter
log-dead-letters-during-shutdown = off
}

akka.actor.deployment {
pekko.actor.deployment {
"/login-udp-endpoint" {
dispatcher = network-listener
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.psforever.actors.commands

import akka.actor.typed.ActorRef
import org.apache.pekko.actor.typed.ActorRef
import net.psforever.objects.NtuContainer

object NtuCommand {
Expand Down
Loading
Loading