mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-12 23:14:42 +00:00
Add base certifications config option
This commit is contained in:
parent
2781d1d5b8
commit
91e76d2397
5 changed files with 21 additions and 11 deletions
|
|
@ -101,6 +101,15 @@ game {
|
||||||
# Starting command rank
|
# Starting command rank
|
||||||
cr = 0
|
cr = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Certifications to add to every character. Note that they do not become free, their cost is deducted from the
|
||||||
|
# player's certification points. The default base certifications are 0 cost.
|
||||||
|
# Values are `Certification` member names.
|
||||||
|
base-certifications = [
|
||||||
|
standard_assault,
|
||||||
|
standard_armor,
|
||||||
|
agile_armor
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
anti-cheat {
|
anti-cheat {
|
||||||
|
|
@ -141,7 +150,7 @@ network {
|
||||||
|
|
||||||
development {
|
development {
|
||||||
# List of GM commands available to everyone
|
# List of GM commands available to everyone
|
||||||
# Values are ChatMessageType members, for example: [CMT_ADDBATTLEEXPERIENCE, CMT_CAPTUREBASE]
|
# Values are `ChatMessageType` members, for example: [CMT_ADDBATTLEEXPERIENCE, CMT_CAPTUREBASE]
|
||||||
unprivileged-gm-commands = []
|
unprivileged-gm-commands = []
|
||||||
|
|
||||||
net-sim {
|
net-sim {
|
||||||
|
|
|
||||||
|
|
@ -355,7 +355,7 @@ class AvatarActor(
|
||||||
loadouts = loadouts,
|
loadouts = loadouts,
|
||||||
// make sure we always have the base certifications
|
// make sure we always have the base certifications
|
||||||
certifications =
|
certifications =
|
||||||
certs.map(cert => Certification.withValue(cert.id)).toSet ++ Certification.values.filter(_.cost == 0),
|
certs.map(cert => Certification.withValue(cert.id)).toSet ++ Config.app.game.baseCertifications,
|
||||||
implants = implants.map(implant => Some(Implant(implant.toImplantDefinition))).padTo(3, None)
|
implants = implants.map(implant => Some(Implant(implant.toImplantDefinition))).padTo(3, None)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ case object Certification extends IntEnum[Certification] {
|
||||||
case object BFRAntiInfantry
|
case object BFRAntiInfantry
|
||||||
extends Certification(value = 25, name = "TODO4", cost = 1, requires = Set(BattleFrameRobotics)) // TODO name
|
extends Certification(value = 25, name = "TODO4", cost = 1, requires = Set(BattleFrameRobotics)) // TODO name
|
||||||
|
|
||||||
case object StandardExoSuit extends Certification(value = 26, name = "TODO5", cost = 0)
|
case object StandardExoSuit extends Certification(value = 26, name = "standard_armor", cost = 0)
|
||||||
|
|
||||||
case object AgileExoSuit extends Certification(value = 27, name = "agile_armor", cost = 0)
|
case object AgileExoSuit extends Certification(value = 27, name = "agile_armor", cost = 0)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -295,7 +295,7 @@ object GamePacketOpcode extends Enumeration {
|
||||||
= Value
|
= Value
|
||||||
|
|
||||||
private def noDecoder(opcode: GamePacketOpcode.Type) =
|
private def noDecoder(opcode: GamePacketOpcode.Type) =
|
||||||
(bits: BitVector) => Attempt.failure(Err(s"Could not find a marshaller for game packet $opcode (${bits.toHex}"))
|
(bits: BitVector) => Attempt.failure(Err(s"Could not find a marshaller for game packet $opcode (${bits.toHex})"))
|
||||||
|
|
||||||
/// Mapping of packet IDs to decoders. Notice that we are using the @switch annotation which ensures that the Scala
|
/// Mapping of packet IDs to decoders. Notice that we are using the @switch annotation which ensures that the Scala
|
||||||
/// compiler will be able to optimize this as a lookup table (switch statement). Microbenchmarks show a nearly 400x
|
/// compiler will be able to optimize this as a lookup table (switch statement). Microbenchmarks show a nearly 400x
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
package net.psforever.util
|
package net.psforever.util
|
||||||
|
|
||||||
import java.nio.file.Paths
|
import java.nio.file.Paths
|
||||||
|
|
||||||
import com.typesafe.config.{Config => TypesafeConfig}
|
import com.typesafe.config.{Config => TypesafeConfig}
|
||||||
import enumeratum.{Enum, EnumEntry}
|
import enumeratum.{Enum, EnumEntry}
|
||||||
import enumeratum.values.{IntEnum, IntEnumEntry}
|
import enumeratum.values.{IntEnum, IntEnumEntry}
|
||||||
import net.psforever.objects.avatar.{BattleRank, CommandRank}
|
import net.psforever.objects.avatar.{BattleRank, Certification, CommandRank}
|
||||||
import net.psforever.packet.game.ServerType
|
import net.psforever.packet.game.ServerType
|
||||||
import net.psforever.types.ChatMessageType
|
import net.psforever.types.ChatMessageType
|
||||||
import pureconfig.ConfigConvert.viaNonEmptyStringOpt
|
import pureconfig.ConfigConvert.viaNonEmptyStringOpt
|
||||||
|
|
@ -34,6 +33,7 @@ object Config {
|
||||||
case e: ServerType if e.name == v => e.asInstanceOf[A]
|
case e: ServerType if e.name == v => e.asInstanceOf[A]
|
||||||
case e: BattleRank if e.value.toString == v => e.asInstanceOf[A]
|
case e: BattleRank if e.value.toString == v => e.asInstanceOf[A]
|
||||||
case e: CommandRank if e.value.toString == v => e.asInstanceOf[A]
|
case e: CommandRank if e.value.toString == v => e.asInstanceOf[A]
|
||||||
|
case e: Certification if e.name == v => e.asInstanceOf[A]
|
||||||
},
|
},
|
||||||
_.value.toString
|
_.value.toString
|
||||||
)
|
)
|
||||||
|
|
@ -119,10 +119,10 @@ case class NetworkConfig(
|
||||||
)
|
)
|
||||||
|
|
||||||
case class MiddlewareConfig(
|
case class MiddlewareConfig(
|
||||||
packetBundlingDelay: FiniteDuration,
|
packetBundlingDelay: FiniteDuration,
|
||||||
inReorderTimeout: FiniteDuration,
|
inReorderTimeout: FiniteDuration,
|
||||||
inSubslotMissingDelay: FiniteDuration,
|
inSubslotMissingDelay: FiniteDuration,
|
||||||
inSubslotMissingAttempts: Int
|
inSubslotMissingAttempts: Int
|
||||||
)
|
)
|
||||||
|
|
||||||
case class SessionConfig(
|
case class SessionConfig(
|
||||||
|
|
@ -138,7 +138,8 @@ case class GameConfig(
|
||||||
cepRate: Double,
|
cepRate: Double,
|
||||||
newAvatar: NewAvatar,
|
newAvatar: NewAvatar,
|
||||||
hart: HartConfig,
|
hart: HartConfig,
|
||||||
sharedMaxCooldown: Boolean
|
sharedMaxCooldown: Boolean,
|
||||||
|
baseCertifications: Seq[Certification]
|
||||||
)
|
)
|
||||||
|
|
||||||
case class NewAvatar(
|
case class NewAvatar(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue