mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-15 16:34:39 +00:00
update sbt & dependencies
removed kamon because it is not being used
This commit is contained in:
parent
53e3f9a08d
commit
ea91251002
5 changed files with 377 additions and 318 deletions
53
build.sbt
53
build.sbt
|
|
@ -3,7 +3,7 @@ import xerial.sbt.pack.PackPlugin._
|
||||||
lazy val psforeverSettings = Seq(
|
lazy val psforeverSettings = Seq(
|
||||||
organization := "net.psforever",
|
organization := "net.psforever",
|
||||||
version := "1.0.2-SNAPSHOT",
|
version := "1.0.2-SNAPSHOT",
|
||||||
scalaVersion := "2.13.3",
|
scalaVersion := "2.13.10",
|
||||||
Global / cancelable := false,
|
Global / cancelable := false,
|
||||||
semanticdbEnabled := true,
|
semanticdbEnabled := true,
|
||||||
semanticdbVersion := scalafixSemanticdb.revision,
|
semanticdbVersion := scalafixSemanticdb.revision,
|
||||||
|
|
@ -40,53 +40,50 @@ lazy val psforeverSettings = Seq(
|
||||||
classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.Flat,
|
classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.Flat,
|
||||||
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
|
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
|
||||||
libraryDependencies ++= Seq(
|
libraryDependencies ++= Seq(
|
||||||
"com.typesafe.akka" %% "akka-actor" % "2.6.17",
|
"com.typesafe.akka" %% "akka-actor" % "2.6.20",
|
||||||
"com.typesafe.akka" %% "akka-slf4j" % "2.6.17",
|
"com.typesafe.akka" %% "akka-slf4j" % "2.6.20",
|
||||||
"com.typesafe.akka" %% "akka-protobuf-v3" % "2.6.17",
|
"com.typesafe.akka" %% "akka-protobuf-v3" % "2.6.20",
|
||||||
"com.typesafe.akka" %% "akka-stream" % "2.6.17",
|
"com.typesafe.akka" %% "akka-stream" % "2.6.20",
|
||||||
"com.typesafe.akka" %% "akka-testkit" % "2.6.17" % "test",
|
"com.typesafe.akka" %% "akka-testkit" % "2.6.20" % "test",
|
||||||
"com.typesafe.akka" %% "akka-actor-typed" % "2.6.17",
|
"com.typesafe.akka" %% "akka-actor-typed" % "2.6.20",
|
||||||
"com.typesafe.akka" %% "akka-actor-testkit-typed" % "2.6.17" % "test",
|
"com.typesafe.akka" %% "akka-actor-testkit-typed" % "2.6.20" % "test",
|
||||||
"com.typesafe.akka" %% "akka-slf4j" % "2.6.17",
|
"com.typesafe.akka" %% "akka-slf4j" % "2.6.20",
|
||||||
"com.typesafe.akka" %% "akka-cluster-typed" % "2.6.17",
|
"com.typesafe.akka" %% "akka-cluster-typed" % "2.6.20",
|
||||||
"com.typesafe.akka" %% "akka-coordination" % "2.6.17",
|
"com.typesafe.akka" %% "akka-coordination" % "2.6.20",
|
||||||
"com.typesafe.akka" %% "akka-cluster-tools" % "2.6.17",
|
"com.typesafe.akka" %% "akka-cluster-tools" % "2.6.20",
|
||||||
"com.typesafe.akka" %% "akka-http" % "10.2.6",
|
"com.typesafe.akka" %% "akka-http" % "10.2.6",
|
||||||
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.4",
|
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.4",
|
||||||
"org.specs2" %% "specs2-core" % "4.13.0" % "test",
|
"org.specs2" %% "specs2-core" % "4.20.0" % "test",
|
||||||
"org.scalatest" %% "scalatest" % "3.2.10" % "test",
|
"org.scalatest" %% "scalatest" % "3.2.15" % "test",
|
||||||
"org.scodec" %% "scodec-core" % "1.11.9",
|
"org.scodec" %% "scodec-core" % "1.11.9",
|
||||||
"ch.qos.logback" % "logback-classic" % "1.2.6",
|
"ch.qos.logback" % "logback-classic" % "1.2.6",
|
||||||
"org.log4s" %% "log4s" % "1.10.0",
|
"org.log4s" %% "log4s" % "1.10.0",
|
||||||
"org.fusesource.jansi" % "jansi" % "2.4.0",
|
"org.fusesource.jansi" % "jansi" % "2.4.0",
|
||||||
"org.scoverage" %% "scalac-scoverage-plugin" % "1.4.2",
|
|
||||||
"com.github.nscala-time" %% "nscala-time" % "2.30.0",
|
"com.github.nscala-time" %% "nscala-time" % "2.30.0",
|
||||||
"com.github.t3hnar" %% "scala-bcrypt" % "4.3.0",
|
"com.github.t3hnar" %% "scala-bcrypt" % "4.3.0",
|
||||||
"org.scala-graph" %% "graph-core" % "1.13.3",
|
"org.scala-graph" %% "graph-core" % "1.13.3",
|
||||||
"io.kamon" %% "kamon-bundle" % "2.3.1",
|
|
||||||
"io.kamon" %% "kamon-apm-reporter" % "2.3.1",
|
|
||||||
"org.json4s" %% "json4s-native" % "4.0.3",
|
"org.json4s" %% "json4s-native" % "4.0.3",
|
||||||
"io.getquill" %% "quill-jasync-postgres" % "3.12.0",
|
"io.getquill" %% "quill-jasync-postgres" % "3.18.0",
|
||||||
"org.flywaydb" % "flyway-core" % "8.0.3",
|
"org.flywaydb" % "flyway-core" % "9.0.0",
|
||||||
"org.postgresql" % "postgresql" % "42.3.1",
|
"org.postgresql" % "postgresql" % "42.3.1",
|
||||||
"com.typesafe" % "config" % "1.4.1",
|
"com.typesafe" % "config" % "1.4.1",
|
||||||
"com.github.pureconfig" %% "pureconfig" % "0.17.0",
|
"com.github.pureconfig" %% "pureconfig" % "0.17.0",
|
||||||
"com.beachape" %% "enumeratum" % "1.7.0",
|
"com.beachape" %% "enumeratum" % "1.7.0",
|
||||||
"joda-time" % "joda-time" % "2.10.13",
|
|
||||||
"commons-io" % "commons-io" % "2.11.0",
|
"commons-io" % "commons-io" % "2.11.0",
|
||||||
"com.github.scopt" %% "scopt" % "4.0.1",
|
"com.github.scopt" %% "scopt" % "4.1.0",
|
||||||
"io.sentry" % "sentry-logback" % "5.3.0",
|
"io.sentry" % "sentry-logback" % "6.16.0",
|
||||||
"io.circe" %% "circe-core" % "0.14.1",
|
"io.circe" %% "circe-core" % "0.14.5",
|
||||||
"io.circe" %% "circe-generic" % "0.14.1",
|
"io.circe" %% "circe-generic" % "0.14.5",
|
||||||
"io.circe" %% "circe-parser" % "0.14.1",
|
"io.circe" %% "circe-parser" % "0.14.5",
|
||||||
"org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.4",
|
"org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.4",
|
||||||
"org.bouncycastle" % "bcprov-jdk15on" % "1.69"
|
"org.bouncycastle" % "bcprov-jdk15on" % "1.69"
|
||||||
),
|
),
|
||||||
dependencyOverrides ++= Seq(
|
dependencyOverrides ++= Seq(
|
||||||
"com.github.jasync-sql" % "jasync-postgresql" % "1.1.7"
|
"com.github.jasync-sql" % "jasync-postgresql" % "1.1.7",
|
||||||
),
|
"org.scala-lang.modules" %% "scala-java8-compat" % "1.0.2"
|
||||||
|
)
|
||||||
// TODO(chord): remove exclusion when SessionActor is refactored: https://github.com/psforever/PSF-LoginServer/issues/279
|
// TODO(chord): remove exclusion when SessionActor is refactored: https://github.com/psforever/PSF-LoginServer/issues/279
|
||||||
coverageExcludedPackages := "net\\.psforever\\.actors\\.session\\.SessionActor.*"
|
// coverageExcludedPackages := "net\\.psforever\\.actors\\.session\\.SessionActor.*"
|
||||||
)
|
)
|
||||||
|
|
||||||
lazy val psforever = (project in file("."))
|
lazy val psforever = (project in file("."))
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version = 1.4.5
|
sbt.version = 1.8.2
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
logLevel := Level.Warn
|
logLevel := Level.Warn
|
||||||
|
|
||||||
addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.14")
|
addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.17")
|
||||||
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.1")
|
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.7")
|
||||||
addSbtPlugin("io.kamon" % "sbt-kanela-runner" % "2.0.12")
|
|
||||||
addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.3")
|
addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.3")
|
||||||
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.3")
|
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")
|
||||||
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.31")
|
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.4")
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import java.nio.file.Paths
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
import java.util.UUID.randomUUID
|
import java.util.UUID.randomUUID
|
||||||
import java.util.concurrent.atomic.AtomicLong
|
import java.util.concurrent.atomic.AtomicLong
|
||||||
|
import scala.concurrent.Future
|
||||||
|
import scala.concurrent.Await
|
||||||
|
|
||||||
import akka.actor.ActorSystem
|
import akka.actor.ActorSystem
|
||||||
import akka.actor.typed.ActorRef
|
import akka.actor.typed.ActorRef
|
||||||
|
|
@ -13,7 +15,6 @@ import akka.{actor => classic}
|
||||||
import ch.qos.logback.classic.LoggerContext
|
import ch.qos.logback.classic.LoggerContext
|
||||||
import ch.qos.logback.classic.joran.JoranConfigurator
|
import ch.qos.logback.classic.joran.JoranConfigurator
|
||||||
import io.sentry.{Sentry, SentryOptions}
|
import io.sentry.{Sentry, SentryOptions}
|
||||||
import kamon.Kamon
|
|
||||||
import net.psforever.actors.net.{LoginActor, MiddlewareActor, SocketActor}
|
import net.psforever.actors.net.{LoginActor, MiddlewareActor, SocketActor}
|
||||||
import net.psforever.actors.session.SessionActor
|
import net.psforever.actors.session.SessionActor
|
||||||
import net.psforever.login.psadmin.PsAdminActor
|
import net.psforever.login.psadmin.PsAdminActor
|
||||||
|
|
@ -37,6 +38,7 @@ import scopt.OParser
|
||||||
import akka.actor.typed.scaladsl.adapter._
|
import akka.actor.typed.scaladsl.adapter._
|
||||||
import net.psforever.packet.PlanetSidePacket
|
import net.psforever.packet.PlanetSidePacket
|
||||||
import net.psforever.services.hart.HartService
|
import net.psforever.services.hart.HartService
|
||||||
|
import scala.concurrent.duration.Duration
|
||||||
|
|
||||||
object Server {
|
object Server {
|
||||||
private val logger = org.log4s.getLogger
|
private val logger = org.log4s.getLogger
|
||||||
|
|
@ -80,11 +82,6 @@ object Server {
|
||||||
case None => InetAddress.getByName(Config.app.bind) // address from config
|
case None => InetAddress.getByName(Config.app.bind) // address from config
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.app.kamon.enable) {
|
|
||||||
logger.info("Starting Kamon")
|
|
||||||
Kamon.init()
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Config.app.sentry.enable) {
|
if (Config.app.sentry.enable) {
|
||||||
logger.info(s"Enabling Sentry")
|
logger.info(s"Enabling Sentry")
|
||||||
val options = new SentryOptions()
|
val options = new SentryOptions()
|
||||||
|
|
@ -111,7 +108,8 @@ object Server {
|
||||||
val session = (ref: ActorRef[MiddlewareActor.Command], info: InetSocketAddress, connectionId: String) => {
|
val session = (ref: ActorRef[MiddlewareActor.Command], info: InetSocketAddress, connectionId: String) => {
|
||||||
Behaviors.setup[PlanetSidePacket](context => {
|
Behaviors.setup[PlanetSidePacket](context => {
|
||||||
val uuid = randomUUID().toString
|
val uuid = randomUUID().toString
|
||||||
val actor = context.actorOf(classic.Props(new SessionActor(ref, connectionId, Session.getNewId())), s"session-$uuid")
|
val actor =
|
||||||
|
context.actorOf(classic.Props(new SessionActor(ref, connectionId, Session.getNewId())), s"session-$uuid")
|
||||||
Behaviors.receiveMessage(message => {
|
Behaviors.receiveMessage(message => {
|
||||||
actor ! message
|
actor ! message
|
||||||
Behaviors.same
|
Behaviors.same
|
||||||
|
|
@ -156,6 +154,8 @@ object Server {
|
||||||
// TODO: clean up active sessions and close resources safely
|
// TODO: clean up active sessions and close resources safely
|
||||||
logger.info("Login server now shutting down...")
|
logger.info("Login server now shutting down...")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Await.ready(Future.never, Duration.Inf)
|
||||||
}
|
}
|
||||||
|
|
||||||
def flyway(args: CliConfig): Flyway = {
|
def flyway(args: CliConfig): Flyway = {
|
||||||
|
|
@ -228,6 +228,7 @@ object Server {
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed trait AuthoritativeCounter {
|
sealed trait AuthoritativeCounter {
|
||||||
|
|
||||||
/** the id accumulator */
|
/** the id accumulator */
|
||||||
private val masterIdKeyRing: AtomicLong = new AtomicLong(0L)
|
private val masterIdKeyRing: AtomicLong = new AtomicLong(0L)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -461,7 +461,6 @@ object AvatarActor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def displayLookingForSquad(session: Session, state: Int): Unit = {
|
def displayLookingForSquad(session: Session, state: Int): Unit = {
|
||||||
val player = session.player
|
val player = session.player
|
||||||
session.zone.AvatarEvents ! AvatarServiceMessage(
|
session.zone.AvatarEvents ! AvatarServiceMessage(
|
||||||
|
|
@ -477,7 +476,10 @@ object AvatarActor {
|
||||||
* @param func functionality that is called upon discovery of the character
|
* @param func functionality that is called upon discovery of the character
|
||||||
* @return if found, the discovered avatar, the avatar's account id, and the avatar's faction affiliation
|
* @return if found, the discovered avatar, the avatar's account id, and the avatar's faction affiliation
|
||||||
*/
|
*/
|
||||||
def getLiveAvatarForFunc(name: String, func: (Long,String,Int)=>Unit): Option[(Avatar, Long, PlanetSideEmpire.Value)] = {
|
def getLiveAvatarForFunc(
|
||||||
|
name: String,
|
||||||
|
func: (Long, String, Int) => Unit
|
||||||
|
): Option[(Avatar, Long, PlanetSideEmpire.Value)] = {
|
||||||
if (name.nonEmpty) {
|
if (name.nonEmpty) {
|
||||||
LivePlayerList.WorldPopulation({ case (_, a) => a.name.equals(name) }).headOption match {
|
LivePlayerList.WorldPopulation({ case (_, a) => a.name.equals(name) }).headOption match {
|
||||||
case Some(otherAvatar) =>
|
case Some(otherAvatar) =>
|
||||||
|
|
@ -500,7 +502,10 @@ object AvatarActor {
|
||||||
* otherwise, always returns `None` as if no avatar was discovered
|
* otherwise, always returns `None` as if no avatar was discovered
|
||||||
* (the query is probably still in progress)
|
* (the query is probably still in progress)
|
||||||
*/
|
*/
|
||||||
def getAvatarForFunc(name: String, func: (Long,String,Int)=>Unit): Option[(Avatar, Long, PlanetSideEmpire.Value)] = {
|
def getAvatarForFunc(
|
||||||
|
name: String,
|
||||||
|
func: (Long, String, Int) => Unit
|
||||||
|
): Option[(Avatar, Long, PlanetSideEmpire.Value)] = {
|
||||||
getLiveAvatarForFunc(name, func).orElse {
|
getLiveAvatarForFunc(name, func).orElse {
|
||||||
if (name.nonEmpty) {
|
if (name.nonEmpty) {
|
||||||
import ctx._
|
import ctx._
|
||||||
|
|
@ -540,7 +545,9 @@ object AvatarActor {
|
||||||
*/
|
*/
|
||||||
def onlineIfNotIgnored(onlinePlayerName: String, observerName: String): Boolean = {
|
def onlineIfNotIgnored(onlinePlayerName: String, observerName: String): Boolean = {
|
||||||
val onlinePlayerNameLower = onlinePlayerName.toLowerCase()
|
val onlinePlayerNameLower = onlinePlayerName.toLowerCase()
|
||||||
LivePlayerList.WorldPopulation({ case (_, a) => a.name.toLowerCase().equals(onlinePlayerNameLower) }).headOption match {
|
LivePlayerList
|
||||||
|
.WorldPopulation({ case (_, a) => a.name.toLowerCase().equals(onlinePlayerNameLower) })
|
||||||
|
.headOption match {
|
||||||
case Some(onlinePlayer) => onlineIfNotIgnored(onlinePlayer, observerName)
|
case Some(onlinePlayer) => onlineIfNotIgnored(onlinePlayer, observerName)
|
||||||
case _ => false
|
case _ => false
|
||||||
}
|
}
|
||||||
|
|
@ -603,7 +610,8 @@ object AvatarActor {
|
||||||
case Success(data) if data.nonEmpty =>
|
case Success(data) if data.nonEmpty =>
|
||||||
out.completeWith(Future(data.head))
|
out.completeWith(Future(data.head))
|
||||||
case _ =>
|
case _ =>
|
||||||
ctx.run(query[persistence.Savedplayer]
|
ctx.run(
|
||||||
|
query[persistence.Savedplayer]
|
||||||
.insert(
|
.insert(
|
||||||
_.avatarId -> lift(avatarId),
|
_.avatarId -> lift(avatarId),
|
||||||
_.px -> lift(0),
|
_.px -> lift(0),
|
||||||
|
|
@ -689,7 +697,8 @@ object AvatarActor {
|
||||||
val queryResult = ctx.run(query[persistence.Savedplayer].filter { _.avatarId == lift(avatarId) })
|
val queryResult = ctx.run(query[persistence.Savedplayer].filter { _.avatarId == lift(avatarId) })
|
||||||
queryResult.onComplete {
|
queryResult.onComplete {
|
||||||
case Success(results) if results.nonEmpty =>
|
case Success(results) if results.nonEmpty =>
|
||||||
ctx.run(query[persistence.Savedplayer]
|
ctx.run(
|
||||||
|
query[persistence.Savedplayer]
|
||||||
.filter { _.avatarId == lift(avatarId) }
|
.filter { _.avatarId == lift(avatarId) }
|
||||||
.update(
|
.update(
|
||||||
_.px -> lift((position.x * 1000).toInt),
|
_.px -> lift((position.x * 1000).toInt),
|
||||||
|
|
@ -727,7 +736,8 @@ object AvatarActor {
|
||||||
val queryResult = ctx.run(query[persistence.Savedplayer].filter { _.avatarId == lift(avatarId) })
|
val queryResult = ctx.run(query[persistence.Savedplayer].filter { _.avatarId == lift(avatarId) })
|
||||||
queryResult.onComplete {
|
queryResult.onComplete {
|
||||||
case Success(results) if results.nonEmpty =>
|
case Success(results) if results.nonEmpty =>
|
||||||
ctx.run(query[persistence.Savedplayer]
|
ctx.run(
|
||||||
|
query[persistence.Savedplayer]
|
||||||
.filter { _.avatarId == lift(avatarId) }
|
.filter { _.avatarId == lift(avatarId) }
|
||||||
.update(
|
.update(
|
||||||
_.px -> lift((position.x * 1000).toInt),
|
_.px -> lift((position.x * 1000).toInt),
|
||||||
|
|
@ -763,7 +773,8 @@ object AvatarActor {
|
||||||
out.completeWith(Future(data.head))
|
out.completeWith(Future(data.head))
|
||||||
case _ =>
|
case _ =>
|
||||||
val now = LocalDateTime.now()
|
val now = LocalDateTime.now()
|
||||||
ctx.run(query[persistence.Savedavatar]
|
ctx.run(
|
||||||
|
query[persistence.Savedavatar]
|
||||||
.insert(
|
.insert(
|
||||||
_.avatarId -> lift(avatarId),
|
_.avatarId -> lift(avatarId),
|
||||||
_.forgetCooldown -> lift(now),
|
_.forgetCooldown -> lift(now),
|
||||||
|
|
@ -792,7 +803,8 @@ object AvatarActor {
|
||||||
val queryResult = ctx.run(query[persistence.Savedavatar].filter { _.avatarId == lift(avatarId) })
|
val queryResult = ctx.run(query[persistence.Savedavatar].filter { _.avatarId == lift(avatarId) })
|
||||||
queryResult.onComplete {
|
queryResult.onComplete {
|
||||||
case Success(results) if results.nonEmpty =>
|
case Success(results) if results.nonEmpty =>
|
||||||
ctx.run(query[persistence.Savedavatar]
|
ctx.run(
|
||||||
|
query[persistence.Savedavatar]
|
||||||
.filter { _.avatarId == lift(avatarId) }
|
.filter { _.avatarId == lift(avatarId) }
|
||||||
.update(
|
.update(
|
||||||
_.purchaseCooldowns -> lift(buildClobfromCooldowns(avatar.cooldowns.purchase)),
|
_.purchaseCooldowns -> lift(buildClobfromCooldowns(avatar.cooldowns.purchase)),
|
||||||
|
|
@ -959,7 +971,8 @@ class AvatarActor(
|
||||||
deleted.headOption match {
|
deleted.headOption match {
|
||||||
case Some(a) if !a.deleted =>
|
case Some(a) if !a.deleted =>
|
||||||
val flagDeletion = for {
|
val flagDeletion = for {
|
||||||
_ <- ctx.run(query[persistence.Avatar]
|
_ <- ctx.run(
|
||||||
|
query[persistence.Avatar]
|
||||||
.filter(_.id == lift(id))
|
.filter(_.id == lift(id))
|
||||||
.update(
|
.update(
|
||||||
_.deleted -> lift(true),
|
_.deleted -> lift(true),
|
||||||
|
|
@ -1008,7 +1021,8 @@ class AvatarActor(
|
||||||
case LoginAvatar(replyTo) =>
|
case LoginAvatar(replyTo) =>
|
||||||
import ctx._
|
import ctx._
|
||||||
val avatarId = avatar.id
|
val avatarId = avatar.id
|
||||||
ctx.run(
|
ctx
|
||||||
|
.run(
|
||||||
query[persistence.Avatar]
|
query[persistence.Avatar]
|
||||||
.filter(_.id == lift(avatarId))
|
.filter(_.id == lift(avatarId))
|
||||||
.map { c => (c.created, c.lastLogin) }
|
.map { c => (c.created, c.lastLogin) }
|
||||||
|
|
@ -1031,12 +1045,12 @@ class AvatarActor(
|
||||||
persistence.Certification(Certification.ATV.value, avatarId),
|
persistence.Certification(Certification.ATV.value, avatarId),
|
||||||
persistence.Certification(Certification.Harasser.value, avatarId)
|
persistence.Certification(Certification.Harasser.value, avatarId)
|
||||||
)
|
)
|
||||||
).foreach(c => query[persistence.Certification].insert(c))
|
).foreach(c => query[persistence.Certification].insertValue(c))
|
||||||
)
|
)
|
||||||
_ <- ctx.run(
|
_ <- ctx.run(
|
||||||
liftQuery(
|
liftQuery(
|
||||||
List(persistence.Shortcut(avatarId, 0, 0, "medkit"))
|
List(persistence.Shortcut(avatarId, 0, 0, "medkit"))
|
||||||
).foreach(c => query[persistence.Shortcut].insert(c))
|
).foreach(c => query[persistence.Shortcut].insertValue(c))
|
||||||
)
|
)
|
||||||
} yield true
|
} yield true
|
||||||
inits.onComplete {
|
inits.onComplete {
|
||||||
|
|
@ -1109,7 +1123,8 @@ class AvatarActor(
|
||||||
val replace = certification.replaces.intersect(avatar.certifications)
|
val replace = certification.replaces.intersect(avatar.certifications)
|
||||||
Future
|
Future
|
||||||
.sequence(replace.map(cert => {
|
.sequence(replace.map(cert => {
|
||||||
ctx.run(
|
ctx
|
||||||
|
.run(
|
||||||
query[persistence.Certification]
|
query[persistence.Certification]
|
||||||
.filter(_.avatarId == lift(avatar.id))
|
.filter(_.avatarId == lift(avatar.id))
|
||||||
.filter(_.id == lift(cert.value))
|
.filter(_.id == lift(cert.value))
|
||||||
|
|
@ -1129,7 +1144,8 @@ class AvatarActor(
|
||||||
PlanetsideAttributeMessage(session.get.player.GUID, 25, cert.value)
|
PlanetsideAttributeMessage(session.get.player.GUID, 25, cert.value)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
ctx.run(
|
ctx
|
||||||
|
.run(
|
||||||
query[persistence.Certification]
|
query[persistence.Certification]
|
||||||
.insert(_.id -> lift(certification.value), _.avatarId -> lift(avatar.id))
|
.insert(_.id -> lift(certification.value), _.avatarId -> lift(avatar.id))
|
||||||
)
|
)
|
||||||
|
|
@ -1180,7 +1196,8 @@ class AvatarActor(
|
||||||
avatar.certifications
|
avatar.certifications
|
||||||
.intersect(requiredByCert)
|
.intersect(requiredByCert)
|
||||||
.map(cert => {
|
.map(cert => {
|
||||||
ctx.run(
|
ctx
|
||||||
|
.run(
|
||||||
query[persistence.Certification]
|
query[persistence.Certification]
|
||||||
.filter(_.avatarId == lift(avatar.id))
|
.filter(_.avatarId == lift(avatar.id))
|
||||||
.filter(_.id == lift(cert.value))
|
.filter(_.id == lift(cert.value))
|
||||||
|
|
@ -1329,7 +1346,8 @@ class AvatarActor(
|
||||||
index match {
|
index match {
|
||||||
case Some(_index) =>
|
case Some(_index) =>
|
||||||
import ctx._
|
import ctx._
|
||||||
ctx.run(
|
ctx
|
||||||
|
.run(
|
||||||
query[persistence.Implant]
|
query[persistence.Implant]
|
||||||
.filter(_.name == lift(definition.Name))
|
.filter(_.name == lift(definition.Name))
|
||||||
.filter(_.avatarId == lift(avatar.id))
|
.filter(_.avatarId == lift(avatar.id))
|
||||||
|
|
@ -1462,7 +1480,9 @@ class AvatarActor(
|
||||||
|
|
||||||
case UpdatePurchaseTime(definition, time) =>
|
case UpdatePurchaseTime(definition, time) =>
|
||||||
var newTimes = avatar.cooldowns.purchase
|
var newTimes = avatar.cooldowns.purchase
|
||||||
AvatarActor.resolveSharedPurchaseTimeNames(AvatarActor.resolvePurchaseTimeName(avatar.faction, definition)).foreach {
|
AvatarActor
|
||||||
|
.resolveSharedPurchaseTimeNames(AvatarActor.resolvePurchaseTimeName(avatar.faction, definition))
|
||||||
|
.foreach {
|
||||||
case (item, name) =>
|
case (item, name) =>
|
||||||
Avatar.purchaseCooldowns.get(item) match {
|
Avatar.purchaseCooldowns.get(item) match {
|
||||||
case Some(cooldown) =>
|
case Some(cooldown) =>
|
||||||
|
|
@ -1682,7 +1702,9 @@ class AvatarActor(
|
||||||
case -1 => previousRibbonBars
|
case -1 => previousRibbonBars
|
||||||
case n => AvatarActor.changeRibbons(previousRibbonBars, MeritCommendation.None, RibbonBarSlot(n))
|
case n => AvatarActor.changeRibbons(previousRibbonBars, MeritCommendation.None, RibbonBarSlot(n))
|
||||||
}
|
}
|
||||||
replaceAvatar(avatar.copy(decoration = decor.copy(ribbonBars = AvatarActor.changeRibbons(useRibbonBars, ribbon, bar))))
|
replaceAvatar(
|
||||||
|
avatar.copy(decoration = decor.copy(ribbonBars = AvatarActor.changeRibbons(useRibbonBars, ribbon, bar)))
|
||||||
|
)
|
||||||
val player = session.get.player
|
val player = session.get.player
|
||||||
val zone = player.Zone
|
val zone = player.Zone
|
||||||
zone.AvatarEvents ! AvatarServiceMessage(
|
zone.AvatarEvents ! AvatarServiceMessage(
|
||||||
|
|
@ -1706,9 +1728,11 @@ class AvatarActor(
|
||||||
case _ => false
|
case _ => false
|
||||||
})
|
})
|
||||||
if (isDifferentShortcut) {
|
if (isDifferentShortcut) {
|
||||||
if (!isMacroShortcut && avatar.shortcuts.flatten.exists {
|
if (
|
||||||
a => AvatarShortcut.equals(shortcut, a)
|
!isMacroShortcut && avatar.shortcuts.flatten.exists { a =>
|
||||||
}) {
|
AvatarShortcut.equals(shortcut, a)
|
||||||
|
}
|
||||||
|
) {
|
||||||
//duplicate implant or medkit found
|
//duplicate implant or medkit found
|
||||||
if (shortcut.isInstanceOf[Shortcut.Implant]) {
|
if (shortcut.isInstanceOf[Shortcut.Implant]) {
|
||||||
//duplicate implant
|
//duplicate implant
|
||||||
|
|
@ -1716,11 +1740,17 @@ class AvatarActor(
|
||||||
case Some(existingShortcut: AvatarShortcut) =>
|
case Some(existingShortcut: AvatarShortcut) =>
|
||||||
//redraw redundant shortcut slot with existing shortcut
|
//redraw redundant shortcut slot with existing shortcut
|
||||||
sessionActor ! SessionActor.SendResponse(
|
sessionActor ! SessionActor.SendResponse(
|
||||||
CreateShortcutMessage(session.get.player.GUID, slot + 1, Some(AvatarShortcut.convert(existingShortcut)))
|
CreateShortcutMessage(
|
||||||
|
session.get.player.GUID,
|
||||||
|
slot + 1,
|
||||||
|
Some(AvatarShortcut.convert(existingShortcut))
|
||||||
|
)
|
||||||
)
|
)
|
||||||
case _ =>
|
case _ =>
|
||||||
//blank shortcut slot
|
//blank shortcut slot
|
||||||
sessionActor ! SessionActor.SendResponse(CreateShortcutMessage(session.get.player.GUID, slot + 1, None))
|
sessionActor ! SessionActor.SendResponse(
|
||||||
|
CreateShortcutMessage(session.get.player.GUID, slot + 1, None)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1771,7 +1801,8 @@ class AvatarActor(
|
||||||
avatar.shortcuts.lift(slot).flatten match {
|
avatar.shortcuts.lift(slot).flatten match {
|
||||||
case None => ;
|
case None => ;
|
||||||
case Some(_) =>
|
case Some(_) =>
|
||||||
ctx.run(query[persistence.Shortcut]
|
ctx.run(
|
||||||
|
query[persistence.Shortcut]
|
||||||
.filter(_.avatarId == lift(avatar.id.toLong))
|
.filter(_.avatarId == lift(avatar.id.toLong))
|
||||||
.filter(_.slot == lift(slot))
|
.filter(_.slot == lift(slot))
|
||||||
.delete
|
.delete
|
||||||
|
|
@ -1803,11 +1834,15 @@ class AvatarActor(
|
||||||
|
|
||||||
val result = for {
|
val result = for {
|
||||||
//log this login
|
//log this login
|
||||||
_ <- ctx.run(query[persistence.Avatar].filter(_.id == lift(avatarId))
|
_ <- ctx.run(
|
||||||
|
query[persistence.Avatar]
|
||||||
|
.filter(_.id == lift(avatarId))
|
||||||
.update(_.lastLogin -> lift(LocalDateTime.now()))
|
.update(_.lastLogin -> lift(LocalDateTime.now()))
|
||||||
)
|
)
|
||||||
//log this choice of faction (no empire switching)
|
//log this choice of faction (no empire switching)
|
||||||
_ <- ctx.run(query[persistence.Account].filter(_.id == lift(accountId))
|
_ <- ctx.run(
|
||||||
|
query[persistence.Account]
|
||||||
|
.filter(_.id == lift(accountId))
|
||||||
.update(_.lastFactionId -> lift(avatar.faction.id))
|
.update(_.lastFactionId -> lift(avatar.faction.id))
|
||||||
)
|
)
|
||||||
//retrieve avatar data
|
//retrieve avatar data
|
||||||
|
|
@ -1887,7 +1922,8 @@ class AvatarActor(
|
||||||
val p = Promise[Unit]()
|
val p = Promise[Unit]()
|
||||||
|
|
||||||
import ctx._
|
import ctx._
|
||||||
ctx.run(
|
ctx
|
||||||
|
.run(
|
||||||
query[persistence.Avatar]
|
query[persistence.Avatar]
|
||||||
.filter(_.id == lift(avatar.id))
|
.filter(_.id == lift(avatar.id))
|
||||||
.update(_.cosmetics -> lift(Some(Cosmetic.valuesToObjectCreateValue(cosmetics)): Option[Int]))
|
.update(_.cosmetics -> lift(Some(Cosmetic.valuesToObjectCreateValue(cosmetics)): Option[Int]))
|
||||||
|
|
@ -2177,6 +2213,7 @@ class AvatarActor(
|
||||||
secondsSinceLastLogin
|
secondsSinceLastLogin
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
/** After the user has selected a character to load from the "character select screen,"
|
/** After the user has selected a character to load from the "character select screen,"
|
||||||
* the temporary global unique identifiers used for that screen are stripped from the underlying `Player` object that was selected.
|
* the temporary global unique identifiers used for that screen are stripped from the underlying `Player` object that was selected.
|
||||||
* Characters that were not selected may be destroyed along with their temporary GUIDs.
|
* Characters that were not selected may be destroyed along with their temporary GUIDs.
|
||||||
|
|
@ -2471,16 +2508,18 @@ class AvatarActor(
|
||||||
val locker = Avatar.makeLocker()
|
val locker = Avatar.makeLocker()
|
||||||
saveLockerFunc = storeLocker
|
saveLockerFunc = storeLocker
|
||||||
val out = Promise[LockerContainer]()
|
val out = Promise[LockerContainer]()
|
||||||
ctx.run(query[persistence.Locker].filter(_.avatarId == lift(charId)))
|
ctx
|
||||||
|
.run(query[persistence.Locker].filter(_.avatarId == lift(charId)))
|
||||||
.onComplete {
|
.onComplete {
|
||||||
case Success(entry) if entry.nonEmpty =>
|
case Success(entry) if entry.nonEmpty =>
|
||||||
AvatarActor.buildContainedEquipmentFromClob(locker, entry.head.items, log, restoreAmmo = true)
|
AvatarActor.buildContainedEquipmentFromClob(locker, entry.head.items, log, restoreAmmo = true)
|
||||||
out.completeWith(Future(locker))
|
out.completeWith(Future(locker))
|
||||||
case Success(_) =>
|
case Success(_) =>
|
||||||
//no locker, or maybe default empty locker?
|
//no locker, or maybe default empty locker?
|
||||||
ctx.run(query[persistence.Locker].insert(_.avatarId -> lift(avatar.id), _.items -> lift("")))
|
ctx
|
||||||
.onComplete {
|
.run(query[persistence.Locker].insert(_.avatarId -> lift(avatar.id), _.items -> lift("")))
|
||||||
_ => out.completeWith(Future(locker))
|
.onComplete { _ =>
|
||||||
|
out.completeWith(Future(locker))
|
||||||
}
|
}
|
||||||
case Failure(e) =>
|
case Failure(e) =>
|
||||||
saveLockerFunc = doNotStoreLocker
|
saveLockerFunc = doNotStoreLocker
|
||||||
|
|
@ -2490,23 +2529,24 @@ class AvatarActor(
|
||||||
out.future
|
out.future
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def loadFriendList(avatarId: Long): Future[List[AvatarFriend]] = {
|
def loadFriendList(avatarId: Long): Future[List[AvatarFriend]] = {
|
||||||
import ctx._
|
import ctx._
|
||||||
val out: Promise[List[AvatarFriend]] = Promise()
|
val out: Promise[List[AvatarFriend]] = Promise()
|
||||||
|
|
||||||
val queryResult = ctx.run(
|
val queryResult = ctx.run(
|
||||||
query[persistence.Friend].filter { _.avatarId == lift(avatarId) }
|
query[persistence.Friend]
|
||||||
|
.filter { _.avatarId == lift(avatarId) }
|
||||||
.join(query[persistence.Avatar])
|
.join(query[persistence.Avatar])
|
||||||
.on { case (friend, avatar) => friend.charId == avatar.id }
|
.on { case (friend, avatar) => friend.charId == avatar.id }
|
||||||
.map { case (_, avatar) => (avatar.id, avatar.name, avatar.factionId) }
|
.map { case (_, avatar) => (avatar.id, avatar.name, avatar.factionId) }
|
||||||
)
|
)
|
||||||
queryResult.onComplete {
|
queryResult.onComplete {
|
||||||
case Success(list) =>
|
case Success(list) =>
|
||||||
out.completeWith(Future(
|
out.completeWith(
|
||||||
|
Future(
|
||||||
list.map { case (id, name, faction) => AvatarFriend(id, name, PlanetSideEmpire(faction)) }.toList
|
list.map { case (id, name, faction) => AvatarFriend(id, name, PlanetSideEmpire(faction)) }.toList
|
||||||
))
|
)
|
||||||
|
)
|
||||||
case _ =>
|
case _ =>
|
||||||
out.completeWith(Future(List.empty[AvatarFriend]))
|
out.completeWith(Future(List.empty[AvatarFriend]))
|
||||||
}
|
}
|
||||||
|
|
@ -2518,16 +2558,19 @@ class AvatarActor(
|
||||||
val out: Promise[List[AvatarIgnored]] = Promise()
|
val out: Promise[List[AvatarIgnored]] = Promise()
|
||||||
|
|
||||||
val queryResult = ctx.run(
|
val queryResult = ctx.run(
|
||||||
query[persistence.Ignored].filter { _.avatarId == lift(avatarId) }
|
query[persistence.Ignored]
|
||||||
|
.filter { _.avatarId == lift(avatarId) }
|
||||||
.join(query[persistence.Avatar])
|
.join(query[persistence.Avatar])
|
||||||
.on { case (friend, avatar) => friend.charId == avatar.id }
|
.on { case (friend, avatar) => friend.charId == avatar.id }
|
||||||
.map { case (_, avatar) => (avatar.id, avatar.name) }
|
.map { case (_, avatar) => (avatar.id, avatar.name) }
|
||||||
)
|
)
|
||||||
queryResult.onComplete {
|
queryResult.onComplete {
|
||||||
case Success(list) =>
|
case Success(list) =>
|
||||||
out.completeWith(Future(
|
out.completeWith(
|
||||||
|
Future(
|
||||||
list.map { case (id, name) => AvatarIgnored(id, name) }.toList
|
list.map { case (id, name) => AvatarIgnored(id, name) }.toList
|
||||||
))
|
)
|
||||||
|
)
|
||||||
case _ =>
|
case _ =>
|
||||||
out.completeWith(Future(List.empty[AvatarIgnored]))
|
out.completeWith(Future(List.empty[AvatarIgnored]))
|
||||||
}
|
}
|
||||||
|
|
@ -2539,13 +2582,15 @@ class AvatarActor(
|
||||||
val out: Promise[Array[Option[AvatarShortcut]]] = Promise()
|
val out: Promise[Array[Option[AvatarShortcut]]] = Promise()
|
||||||
|
|
||||||
val queryResult = ctx.run(
|
val queryResult = ctx.run(
|
||||||
query[persistence.Shortcut].filter { _.avatarId == lift(avatarId) }
|
query[persistence.Shortcut]
|
||||||
|
.filter { _.avatarId == lift(avatarId) }
|
||||||
.map { shortcut => (shortcut.slot, shortcut.purpose, shortcut.tile, shortcut.effect1, shortcut.effect2) }
|
.map { shortcut => (shortcut.slot, shortcut.purpose, shortcut.tile, shortcut.effect1, shortcut.effect2) }
|
||||||
)
|
)
|
||||||
val output = Array.fill[Option[AvatarShortcut]](64)(None)
|
val output = Array.fill[Option[AvatarShortcut]](64)(None)
|
||||||
queryResult.onComplete {
|
queryResult.onComplete {
|
||||||
case Success(list) =>
|
case Success(list) =>
|
||||||
list.foreach { case (slot, purpose, tile, effect1, effect2) =>
|
list.foreach {
|
||||||
|
case (slot, purpose, tile, effect1, effect2) =>
|
||||||
output.update(slot, Some(AvatarShortcut(purpose, tile, effect1.getOrElse(""), effect2.getOrElse(""))))
|
output.update(slot, Some(AvatarShortcut(purpose, tile, effect1.getOrElse(""), effect2.getOrElse(""))))
|
||||||
}
|
}
|
||||||
out.completeWith(Future(output))
|
out.completeWith(Future(output))
|
||||||
|
|
@ -2660,6 +2705,7 @@ class AvatarActor(
|
||||||
def transformFriendsList(): List[GameFriend] = {
|
def transformFriendsList(): List[GameFriend] = {
|
||||||
avatar.people.friend.map { f => GameFriend(f.name, f.online) }
|
avatar.people.friend.map { f => GameFriend(f.name, f.online) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transform the ignored players list in a list of packet entities.
|
* Transform the ignored players list in a list of packet entities.
|
||||||
* @return a list of `Friends` suitable for putting into a packet
|
* @return a list of `Friends` suitable for putting into a packet
|
||||||
|
|
@ -2667,6 +2713,7 @@ class AvatarActor(
|
||||||
def transformIgnoredList(): List[GameFriend] = {
|
def transformIgnoredList(): List[GameFriend] = {
|
||||||
avatar.people.ignored.map { f => GameFriend(f.name, f.online) }
|
avatar.people.ignored.map { f => GameFriend(f.name, f.online) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reload the list of friend players or ignored players for the client.
|
* Reload the list of friend players or ignored players for the client.
|
||||||
* This does not update any player's online status, but merely reloads current states.
|
* This does not update any player's online status, but merely reloads current states.
|
||||||
|
|
@ -2693,16 +2740,20 @@ class AvatarActor(
|
||||||
case Some(_) => ;
|
case Some(_) => ;
|
||||||
case None =>
|
case None =>
|
||||||
import ctx._
|
import ctx._
|
||||||
ctx.run(query[persistence.Friend]
|
ctx.run(
|
||||||
|
query[persistence.Friend]
|
||||||
.insert(
|
.insert(
|
||||||
_.avatarId -> lift(avatar.id.toLong),
|
_.avatarId -> lift(avatar.id.toLong),
|
||||||
_.charId -> lift(charId)
|
_.charId -> lift(charId)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
val isOnline = onlineIfNotIgnoredEitherWay(avatar, name)
|
val isOnline = onlineIfNotIgnoredEitherWay(avatar, name)
|
||||||
replaceAvatar(avatar.copy(
|
replaceAvatar(
|
||||||
people = people.copy(friend = people.friend :+ AvatarFriend(charId, name, PlanetSideEmpire(faction), isOnline))
|
avatar.copy(
|
||||||
))
|
people =
|
||||||
|
people.copy(friend = people.friend :+ AvatarFriend(charId, name, PlanetSideEmpire(faction), isOnline))
|
||||||
|
)
|
||||||
|
)
|
||||||
sessionActor ! SessionActor.SendResponse(FriendsResponse(MemberAction.AddFriend, GameFriend(name, isOnline)))
|
sessionActor ! SessionActor.SendResponse(FriendsResponse(MemberAction.AddFriend, GameFriend(name, isOnline)))
|
||||||
sessionActor ! SessionActor.CharSaved
|
sessionActor ! SessionActor.CharSaved
|
||||||
}
|
}
|
||||||
|
|
@ -2724,7 +2775,8 @@ class AvatarActor(
|
||||||
)
|
)
|
||||||
case None => ;
|
case None => ;
|
||||||
}
|
}
|
||||||
ctx.run(query[persistence.Friend]
|
ctx.run(
|
||||||
|
query[persistence.Friend]
|
||||||
.filter(_.avatarId == lift(avatar.id))
|
.filter(_.avatarId == lift(avatar.id))
|
||||||
.filter(_.charId == lift(charId))
|
.filter(_.charId == lift(charId))
|
||||||
.delete
|
.delete
|
||||||
|
|
@ -2734,7 +2786,6 @@ class AvatarActor(
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param name unique character name
|
* @param name unique character name
|
||||||
* @return if the avatar is found, that avatar's unique identifier and the avatar's faction affiliation
|
* @return if the avatar is found, that avatar's unique identifier and the avatar's faction affiliation
|
||||||
*/
|
*/
|
||||||
|
|
@ -2752,11 +2803,13 @@ class AvatarActor(
|
||||||
case None =>
|
case None =>
|
||||||
(None, false)
|
(None, false)
|
||||||
}
|
}
|
||||||
replaceAvatar(avatar.copy(
|
replaceAvatar(
|
||||||
|
avatar.copy(
|
||||||
people = people.copy(
|
people = people.copy(
|
||||||
friend = people.friend.filterNot { _.name.equals(name) } :+ otherFriend.copy(online = online)
|
friend = people.friend.filterNot { _.name.equals(name) } :+ otherFriend.copy(online = online)
|
||||||
)
|
)
|
||||||
))
|
)
|
||||||
|
)
|
||||||
sessionActor ! SessionActor.SendResponse(FriendsResponse(MemberAction.UpdateFriend, GameFriend(name, online)))
|
sessionActor ! SessionActor.SendResponse(FriendsResponse(MemberAction.UpdateFriend, GameFriend(name, online)))
|
||||||
out
|
out
|
||||||
case None =>
|
case None =>
|
||||||
|
|
@ -2782,7 +2835,8 @@ class AvatarActor(
|
||||||
case Some(_) => ;
|
case Some(_) => ;
|
||||||
case None =>
|
case None =>
|
||||||
import ctx._
|
import ctx._
|
||||||
ctx.run(query[persistence.Ignored]
|
ctx.run(
|
||||||
|
query[persistence.Ignored]
|
||||||
.insert(
|
.insert(
|
||||||
_.avatarId -> lift(avatar.id.toLong),
|
_.avatarId -> lift(avatar.id.toLong),
|
||||||
_.charId -> lift(charId)
|
_.charId -> lift(charId)
|
||||||
|
|
@ -2791,7 +2845,9 @@ class AvatarActor(
|
||||||
replaceAvatar(
|
replaceAvatar(
|
||||||
avatar.copy(people = people.copy(ignored = people.ignored :+ AvatarIgnored(charId, name)))
|
avatar.copy(people = people.copy(ignored = people.ignored :+ AvatarIgnored(charId, name)))
|
||||||
)
|
)
|
||||||
sessionActor ! SessionActor.UpdateIgnoredPlayers(FriendsResponse(MemberAction.AddIgnoredPlayer, GameFriend(name)))
|
sessionActor ! SessionActor.UpdateIgnoredPlayers(
|
||||||
|
FriendsResponse(MemberAction.AddIgnoredPlayer, GameFriend(name))
|
||||||
|
)
|
||||||
sessionActor ! SessionActor.CharSaved
|
sessionActor ! SessionActor.CharSaved
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2814,12 +2870,15 @@ class AvatarActor(
|
||||||
)
|
)
|
||||||
case None => ;
|
case None => ;
|
||||||
}
|
}
|
||||||
ctx.run(query[persistence.Ignored]
|
ctx.run(
|
||||||
|
query[persistence.Ignored]
|
||||||
.filter(_.avatarId == lift(avatar.id.toLong))
|
.filter(_.avatarId == lift(avatar.id.toLong))
|
||||||
.filter(_.charId == lift(charId))
|
.filter(_.charId == lift(charId))
|
||||||
.delete
|
.delete
|
||||||
)
|
)
|
||||||
sessionActor ! SessionActor.UpdateIgnoredPlayers(FriendsResponse(MemberAction.RemoveIgnoredPlayer, GameFriend(name)))
|
sessionActor ! SessionActor.UpdateIgnoredPlayers(
|
||||||
|
FriendsResponse(MemberAction.RemoveIgnoredPlayer, GameFriend(name))
|
||||||
|
)
|
||||||
sessionActor ! SessionActor.CharSaved
|
sessionActor ! SessionActor.CharSaved
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2854,7 +2913,8 @@ class AvatarActor(
|
||||||
val implants = avatar.implants.zipWithIndex.map {
|
val implants = avatar.implants.zipWithIndex.map {
|
||||||
case (implant, index) =>
|
case (implant, index) =>
|
||||||
if (index >= BattleRank.withExperience(bep).implantSlots && implant.isDefined) {
|
if (index >= BattleRank.withExperience(bep).implantSlots && implant.isDefined) {
|
||||||
ctx.run(
|
ctx
|
||||||
|
.run(
|
||||||
query[persistence.Implant]
|
query[persistence.Implant]
|
||||||
.filter(_.name == lift(implant.get.definition.Name))
|
.filter(_.name == lift(implant.get.definition.Name))
|
||||||
.filter(_.avatarId == lift(avatar.id))
|
.filter(_.avatarId == lift(avatar.id))
|
||||||
|
|
@ -2862,7 +2922,9 @@ class AvatarActor(
|
||||||
)
|
)
|
||||||
.onComplete {
|
.onComplete {
|
||||||
case Success(_) =>
|
case Success(_) =>
|
||||||
sessionActor ! SessionActor.SendResponse(AvatarImplantMessage(pguid, ImplantAction.Remove, index, 0))
|
sessionActor ! SessionActor.SendResponse(
|
||||||
|
AvatarImplantMessage(pguid, ImplantAction.Remove, index, 0)
|
||||||
|
)
|
||||||
case Failure(exception) =>
|
case Failure(exception) =>
|
||||||
log.error(exception)("db failure")
|
log.error(exception)("db failure")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue