Skip to content

Commit

Permalink
ugprade scala to 3.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pschichtel committed Oct 10, 2024
1 parent f528192 commit a8a6f2f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 4 additions & 3 deletions app/controllers/Ld56C2Controller.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import java.io.ByteArrayOutputStream
import java.net.InetAddress
import java.time.{Duration, Instant}
import java.util.UUID
import java.util.concurrent.atomic.AtomicReference
import java.util.concurrent.{ConcurrentHashMap, ConcurrentMap}
import javax.imageio.ImageIO
import scala.collection.mutable.ArrayBuffer
Expand Down Expand Up @@ -84,7 +85,7 @@ class Ld56C2Controller(cc: ControllerComponents)(implicit system: ActorSystem, m
private val hosterConnections = ConcurrentHashMap[UUID, ActorRef]()
private val joinerConnections = ConcurrentHashMap[UUID, ActorRef]()
private val hosts = ConcurrentHashMap[UUID, GameHost]()
private var lastJoinTime: Instant = _
private var lastJoinTime = AtomicReference[Instant]()

private def gatherStats(): StatsResponse = {
val now = Instant.now()
Expand All @@ -93,7 +94,7 @@ class Ld56C2Controller(cc: ControllerComponents)(implicit system: ActorSystem, m
val latestHost =
if (hosts.isEmpty) None
else Some(gameHosts.map(_.inceptionTime).max)
StatsResponse(gameHosts.length, latestHost, gameHosts.map(_.playerCount).sum, Option(lastJoinTime))
StatsResponse(gameHosts.length, latestHost, gameHosts.map(_.playerCount).sum, Option(lastJoinTime.get()))
}

def stats() = Action.async { request =>
Expand Down Expand Up @@ -134,7 +135,7 @@ class Ld56C2Controller(cc: ControllerComponents)(implicit system: ActorSystem, m

def signalJoin(id: String) = WebSocket.accept[String, String] { request =>
val clientId = UUID.fromString(id)
lastJoinTime = Instant.now()
lastJoinTime.set(Instant.now())
ActorFlow.actorRef { out => Props(JoinHandler(out, hosterConnections, joinerConnections, clientId, request.connection.remoteAddress, hosts)) }
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/service/LdjamService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class LdjamService(conf: Configuration, cache: AsyncCacheApi, implicit val ec: E
}
}

def urlList(values: Seq[_]): String = values.map(String.valueOf).mkString("+")
def urlList(values: Seq[?]): String = values.map(String.valueOf).mkString("+")

def getNodeFeed(node: Int, methods: Seq[String], mainType: String, subType: Option[String], subSubType: Option[String], offset: Int, limit: Int): Future[NodeFeedResponse] = {
if (limit > 50) {
Expand Down
4 changes: 1 addition & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version := "1.0"
lazy val root = (project in file("."))
.enablePlugins(PlayScala)

scalaVersion := "3.3.3"
scalaVersion := "3.5.1"

routesGenerator := InjectedRoutesGenerator

Expand All @@ -22,8 +22,6 @@ libraryDependencies ++= Seq(
"org.webjars" % "font-awesome" % "5.15.4",
)

scalacOptions ++= Seq("-unchecked", "-deprecation")

Compile / doc / sources := Seq.empty

// Compile / unmanagedResources / excludeFilter := new SimpleFileFilter(_.getName == "local.conf")
Expand Down

0 comments on commit a8a6f2f

Please sign in to comment.