mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-01-20 02:24:45 +00:00
* mix-in code for akka messaging move item, currently testing on infantry only * adjusted structure of COntainable so callbacks are separate from message-producing functions, are separate from message-sending functionality; massaged LockerContainer until it could support control agency and created a wrapper for its Equipment interfacing; the control structure starts and stops when PlayerControl starts and stops, and it converts whenever necessary * added failsafe conditions to Containable, such as blocking certain messages while completing a MoveItem call, or blocking all messages to reset disruptive MoveItem calls; depiction message callbacks for Player, Locker, and Vehicle, to properly depict the manipulation of items; eliminated the old code from WSA * added useful comments to Containable; moved functionality for deployables, and for container'ing, and dropping logic out from WSA and distributed it appropriately * handling terminal operations - buying an exosuit and selecting an infantry loadout; starting work on support for more persistent equipment timers local to the avatar (that were removed in this update; see wsa changes) * linked terminal page/message with routing policy * tuning vehicle loadout management and display * separated use time from purchase time and applied a system that limits either if that same event would recur too soon; tuning exosuit and loadout changes * some ask timeout handling and comments * normalizing item on ground interactions * rearranging the project structure * merged with master; commas removed * fixing tests * added description strings to Tasks; adjusted the completion conditions for some Tasks * a failed purchase will not block future purchases; increased timeout on move-item tasks * corpses, even one's own, should have properly moveable inventories * for better persistence, until GlobalDefinitions is renovated, moved the object id->name map onto the avatar object, for the purpose of timers; replaced a use of values in GridInventory for a map conversion * max loadouts and max exosuit switch use same cooldown now; hopefully better clarifcation regarding held arm position * manual merge-rebase of master with hand reconstruction of WorldSessionActor and PlayerControl, and variations for other files necessary to maintain both inventory operations and login reliability * test fixes; MAX exo-suit cooldown is now five minutes again
107 lines
5 KiB
Scala
107 lines
5 KiB
Scala
import xerial.sbt.pack.PackPlugin._
|
|
|
|
lazy val commonSettings = Seq(
|
|
organization := "net.psforever",
|
|
version := "1.0.2-SNAPSHOT",
|
|
scalaVersion := "2.13.2",
|
|
scalacOptions := Seq("-unchecked", "-feature", "-deprecation", "-encoding", "utf8", "-language:postfixOps"),
|
|
|
|
// Quiet test options
|
|
// https://github.com/etorreborre/specs2/blob/8305db76c5084e4b3ce5827ce23117f6fb6beee4/common/shared/src/main/scala/org/specs2/main/Report.scala#L94
|
|
// https://etorreborre.github.io/specs2/guide/SPECS2-2.4.17/org.specs2.guide.Runners.html
|
|
testOptions in QuietTest += Tests.Argument(TestFrameworks.Specs2, "showOnly", "x!"),
|
|
// http://www.scalatest.org/user_guide/using_the_runner
|
|
testOptions in QuietTest += Tests.Argument(TestFrameworks.ScalaTest, "-oCEHILMNOPQRX"),
|
|
// Trick taken from https://groups.google.com/d/msg/scala-user/mxV9ok7J_Eg/kt-LnsrD0bkJ
|
|
// scaladoc flags: https://github.com/scala/scala/blob/2.11.x/src/scaladoc/scala/tools/nsc/doc/Settings.scala
|
|
scalacOptions in (Compile,doc) := { Seq(
|
|
"-groups",
|
|
"-implicits",
|
|
"-doc-title", "PSF-LoginServer - ",
|
|
"-doc-version", "master",
|
|
"-doc-footer", "Copyright PSForever",
|
|
// For non unidoc builds, you may need bd.getName before the template parameter
|
|
"-doc-source-url", "https://github.com/psforever/PSF-LoginServer/blob/master/€{FILE_PATH}.scala",
|
|
"-sourcepath", baseDirectory.value.getAbsolutePath // needed for scaladoc relative source paths
|
|
)
|
|
},
|
|
classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.Flat,
|
|
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
|
|
libraryDependencies ++= Seq(
|
|
"com.typesafe.akka" %% "akka-actor" % "2.6.5",
|
|
"com.typesafe.akka" %% "akka-testkit" % "2.6.5" % "test",
|
|
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.2",
|
|
"org.specs2" %% "specs2-core" % "4.9.4" % "test",
|
|
"org.scalatest" %% "scalatest" % "3.1.2" % "test",
|
|
"org.scodec" %% "scodec-core" % "1.11.7",
|
|
"net.java.dev.jna" % "jna" % "5.5.0",
|
|
"com.typesafe.akka" %% "akka-slf4j" % "2.6.5",
|
|
"ch.qos.logback" % "logback-classic" % "1.2.3",
|
|
"org.log4s" %% "log4s" % "1.8.2",
|
|
"org.fusesource.jansi" % "jansi" % "1.12",
|
|
"org.scoverage" %% "scalac-scoverage-plugin" % "1.4.1",
|
|
"com.github.nscala-time" %% "nscala-time" % "2.24.0",
|
|
"com.github.postgresql-async" %% "postgresql-async" % "0.3.0",
|
|
"com.github.t3hnar" %% "scala-bcrypt" % "4.1",
|
|
"org.ini4j" % "ini4j" % "0.5.4",
|
|
"org.scala-graph" %% "graph-core" % "1.13.1",
|
|
"io.kamon" %% "kamon-bundle" % "2.1.0",
|
|
"io.kamon" %% "kamon-apm-reporter" % "2.1.0",
|
|
"org.json4s" %% "json4s-native" % "3.6.8",
|
|
"com.typesafe.akka" %% "akka-stream" % "2.6.5",
|
|
)
|
|
)
|
|
|
|
lazy val pscryptoSettings = Seq(
|
|
unmanagedClasspath in Test += (baseDirectory in ThisBuild).value / "pscrypto-lib",
|
|
unmanagedClasspath in Runtime += (baseDirectory in ThisBuild).value / "pscrypto-lib",
|
|
unmanagedClasspath in Compile += (baseDirectory in ThisBuild).value / "pscrypto-lib"
|
|
)
|
|
|
|
lazy val psloginPackSettings = Seq(
|
|
packMain := Map("ps-login" -> "PsLogin"),
|
|
packArchivePrefix := "pslogin",
|
|
packExtraClasspath := Map("ps-login" -> Seq("${PROG_HOME}/pscrypto-lib",
|
|
"${PROG_HOME}/config")),
|
|
packResourceDir += (baseDirectory.value / "pscrypto-lib" -> "pscrypto-lib"),
|
|
packResourceDir += (baseDirectory.value / "config" -> "config"),
|
|
packResourceDir += (baseDirectory.value / "pslogin/src/main/resources" -> "config")
|
|
)
|
|
|
|
lazy val root = (project in file(".")).
|
|
configs(QuietTest).
|
|
enablePlugins(PackPlugin).
|
|
settings(commonSettings: _*).
|
|
settings(psloginPackSettings: _*).
|
|
enablePlugins(ScalaUnidocPlugin).
|
|
aggregate(pslogin, common).
|
|
dependsOn(pslogin, common)
|
|
|
|
lazy val pslogin = (project in file("pslogin")).
|
|
configs(QuietTest).
|
|
settings(commonSettings: _*).
|
|
settings(
|
|
name := "pslogin",
|
|
// ActorTests have specific timing requirements and will be flaky if run in parallel
|
|
parallelExecution in Test := false,
|
|
// TODO(chord): remove exclusion when WorldSessionActor is refactored: https://github.com/psforever/PSF-LoginServer/issues/279
|
|
coverageExcludedPackages := "WorldSessionActor.*;zonemaps.*",
|
|
// Copy all tests from Test -> QuietTest (we're only changing the run options)
|
|
inConfig(QuietTest)(Defaults.testTasks)
|
|
).
|
|
settings(pscryptoSettings: _*).
|
|
dependsOn(common)
|
|
|
|
lazy val common = (project in file("common")).
|
|
configs(QuietTest).
|
|
settings(commonSettings: _*).
|
|
settings(
|
|
name := "common",
|
|
// Copy all tests from Test -> QuietTest (we're only changing the run options)
|
|
inConfig(QuietTest)(Defaults.testTasks)
|
|
).
|
|
settings(pscryptoSettings: _*)
|
|
|
|
// Special test configuration for really quiet tests (used in CI)
|
|
lazy val QuietTest = config("quiet") extend(Test)
|