mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-01-19 18:44:45 +00:00
llu handling, report accurate capture data
This commit is contained in:
parent
d00fa6a6bf
commit
354376882a
|
|
@ -4,6 +4,7 @@ package net.psforever.actors.session.normal
|
|||
import akka.actor.ActorContext
|
||||
import net.psforever.actors.session.support.{MountHandlerFunctions, SessionData, SessionMountHandlers}
|
||||
import net.psforever.actors.zone.ZoneActor
|
||||
import net.psforever.objects.avatar.SpecialCarry
|
||||
import net.psforever.objects.{GlobalDefinitions, PlanetSideGameObject, Player, Vehicle, Vehicles}
|
||||
import net.psforever.objects.definition.{BasicDefinition, ObjectDefinition}
|
||||
import net.psforever.objects.serverobject.affinity.FactionAffinity
|
||||
|
|
@ -296,6 +297,13 @@ class MountHandlerLogic(val ops: SessionMountHandlers, implicit val context: Act
|
|||
ChatMsg(ChatMessageType.CMT_OPEN, wideContents=false, recipient="", "You are not the driver of this vehicle.", note=None)
|
||||
)
|
||||
}
|
||||
if (obj.Zone.blockMap.sector(obj).buildingList.exists {
|
||||
case wg: WarpGate =>
|
||||
Vector3.DistanceSquared(obj.Position, wg.Position) < math.pow(wg.Definition.SOIRadius, 2)
|
||||
case _ => false
|
||||
} && tplayer.Carrying.contains(SpecialCarry.CaptureFlag)) {
|
||||
sendResponse(ChatMsg(ChatMessageType.UNK_224, "@VehicleMount_CaptureFlagWithVehicleInWarpgate"))
|
||||
}
|
||||
|
||||
case Mountable.CanNotMount(obj: Mountable, seatNumber) =>
|
||||
log.warn(s"MountVehicleMsg: ${tplayer.Name} attempted to mount $obj's seat $seatNumber, but was not allowed")
|
||||
|
|
|
|||
|
|
@ -1441,9 +1441,12 @@ class GeneralOperations(
|
|||
}
|
||||
|
||||
def handleUseCaptureFlag(obj: CaptureFlag): Unit = {
|
||||
if (player.ZoningRequest != Zoning.Method.None) {
|
||||
sessionLogic.zoning.CancelZoningProcessWithDescriptiveReason("cancel_use")
|
||||
}
|
||||
// LLU can normally only be picked up the faction that owns it
|
||||
specialItemSlotGuid match {
|
||||
case None if obj.Faction == player.Faction =>
|
||||
case None if obj.Faction == player.Faction && player.ZoningRequest == Zoning.Method.None =>
|
||||
specialItemSlotGuid = Some(obj.GUID)
|
||||
player.Carrying = SpecialCarry.CaptureFlag
|
||||
continent.LocalEvents ! CaptureFlagManager.PickupFlag(obj, player)
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class SessionAvatarHandlers(
|
|||
} else {
|
||||
cappedModifiedExp
|
||||
}
|
||||
exp.ToDatabase.reportFacilityCapture(charId, buildingId, zoneNumber, finalExp, expType="cep")
|
||||
exp.ToDatabase.reportFacilityCapture(charId, zoneNumber, buildingId, finalExp, expType="cep")
|
||||
avatarActor ! AvatarActor.AwardCep(finalExp)
|
||||
Some(finalExp)
|
||||
|
||||
|
|
@ -116,9 +116,9 @@ class SessionAvatarHandlers(
|
|||
}
|
||||
val modifiedExp = (cep * individualContribution).toLong
|
||||
val finalBep = math.min(modifiedExp, 2250L) // 2250 max bep for capture
|
||||
exp.ToDatabase.reportFacilityCapture(charId, buildingId, zoneNumber, finalBep, expType="bep")
|
||||
avatarActor ! AvatarActor.AwardFacilityCaptureBep(modifiedExp)
|
||||
Some(modifiedExp)
|
||||
exp.ToDatabase.reportFacilityCapture(charId, zoneNumber, buildingId, finalBep, expType="bep")
|
||||
avatarActor ! AvatarActor.AwardFacilityCaptureBep(finalBep)
|
||||
Some(finalBep)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import akka.pattern.ask
|
|||
import akka.util.Timeout
|
||||
import net.psforever.actors.session.support.SpawnOperations.ActivityQueuedTask
|
||||
import net.psforever.login.WorldSession
|
||||
import net.psforever.objects.avatar.{BattleRank, DeployableToolbox}
|
||||
import net.psforever.objects.avatar.{BattleRank, DeployableToolbox, SpecialCarry}
|
||||
import net.psforever.objects.avatar.scoring.{CampaignStatistics, ScoreCard, SessionStatistics}
|
||||
import net.psforever.objects.definition.converter.OCM
|
||||
import net.psforever.objects.entity.WorldEntity
|
||||
|
|
@ -781,41 +781,56 @@ class ZoningOperations(
|
|||
}
|
||||
|
||||
def handleRecall(): Unit = {
|
||||
player.ZoningRequest = Zoning.Method.Recall
|
||||
zoningType = Zoning.Method.Recall
|
||||
zoningChatMessageType = ChatMessageType.CMT_RECALL
|
||||
zoningStatus = Zoning.Status.Request
|
||||
beginZoningCountdown(() => {
|
||||
cluster ! ICS.GetRandomSpawnPoint(
|
||||
Zones.sanctuaryZoneNumber(player.Faction),
|
||||
player.Faction,
|
||||
Seq(SpawnGroup.Sanctuary),
|
||||
context.self
|
||||
)
|
||||
})
|
||||
if (player.Carrying.contains(SpecialCarry.CaptureFlag)) {
|
||||
CancelZoningProcessWithDescriptiveReason("cancel")
|
||||
}
|
||||
else {
|
||||
player.ZoningRequest = Zoning.Method.Recall
|
||||
zoningType = Zoning.Method.Recall
|
||||
zoningChatMessageType = ChatMessageType.CMT_RECALL
|
||||
zoningStatus = Zoning.Status.Request
|
||||
beginZoningCountdown(() => {
|
||||
cluster ! ICS.GetRandomSpawnPoint(
|
||||
Zones.sanctuaryZoneNumber(player.Faction),
|
||||
player.Faction,
|
||||
Seq(SpawnGroup.Sanctuary),
|
||||
context.self
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
def handleInstantAction(): Unit = {
|
||||
player.ZoningRequest = Zoning.Method.InstantAction
|
||||
zoningType = Zoning.Method.InstantAction
|
||||
zoningChatMessageType = ChatMessageType.CMT_INSTANTACTION
|
||||
zoningStatus = Zoning.Status.Request
|
||||
cluster ! ICS.GetInstantActionSpawnPoint(player.Faction, context.self)
|
||||
if (player.Carrying.contains(SpecialCarry.CaptureFlag)) {
|
||||
CancelZoningProcessWithDescriptiveReason("cancel")
|
||||
}
|
||||
else {
|
||||
player.ZoningRequest = Zoning.Method.InstantAction
|
||||
zoningType = Zoning.Method.InstantAction
|
||||
zoningChatMessageType = ChatMessageType.CMT_INSTANTACTION
|
||||
zoningStatus = Zoning.Status.Request
|
||||
cluster ! ICS.GetInstantActionSpawnPoint(player.Faction, context.self)
|
||||
}
|
||||
}
|
||||
|
||||
def handleQuit(): Unit = {
|
||||
//priority is given to quit over other zoning methods
|
||||
if (session.zoningType == Zoning.Method.InstantAction || session.zoningType == Zoning.Method.Recall) {
|
||||
if (player.Carrying.contains(SpecialCarry.CaptureFlag)) {
|
||||
CancelZoningProcessWithDescriptiveReason("cancel")
|
||||
}
|
||||
player.ZoningRequest = Zoning.Method.Quit
|
||||
zoningType = Zoning.Method.Quit
|
||||
zoningChatMessageType = ChatMessageType.CMT_QUIT
|
||||
zoningStatus = Zoning.Status.Request
|
||||
beginZoningCountdown(() => {
|
||||
log.info(s"Good-bye, ${player.Name}")
|
||||
sessionLogic.immediateDisconnect()
|
||||
})
|
||||
else {
|
||||
//priority is given to quit over other zoning methods
|
||||
if (session.zoningType == Zoning.Method.InstantAction || session.zoningType == Zoning.Method.Recall) {
|
||||
CancelZoningProcessWithDescriptiveReason("cancel")
|
||||
}
|
||||
player.ZoningRequest = Zoning.Method.Quit
|
||||
zoningType = Zoning.Method.Quit
|
||||
zoningChatMessageType = ChatMessageType.CMT_QUIT
|
||||
zoningStatus = Zoning.Status.Request
|
||||
beginZoningCountdown(() => {
|
||||
log.info(s"Good-bye, ${player.Name}")
|
||||
sessionLogic.immediateDisconnect()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
def handleSetZone(zoneId: String, position: Vector3): Unit = {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import scala.concurrent.Future
|
|||
|
||||
final case class MajorFacilityHackParticipation(building: Building) extends FacilityHackParticipation {
|
||||
private implicit val timeout: Timeout = 10.seconds
|
||||
private val log = org.log4s.getLogger
|
||||
|
||||
private var hotSpotLayersOverTime: Seq[List[HotSpotInfo]] = Seq[List[HotSpotInfo]]()
|
||||
|
||||
|
|
@ -174,6 +175,8 @@ final case class MajorFacilityHackParticipation(building: Building) extends Faci
|
|||
val playersInSoi = building.PlayersInSOI.filter {
|
||||
_.Faction == victorFaction
|
||||
}
|
||||
log.info(s"Facility Capture Event - Was Resecure: $isResecured, Victor: $victorFaction, Opposing: $failSafeOpposingFaction, " +
|
||||
s"Victor Size: $contributionVictorSize, Opposing Size: $contributionOpposingSize, Experience: $baseExperienceFromFacilityCapture")
|
||||
if (baseExperienceFromFacilityCapture > 0) {
|
||||
//2) population modifier
|
||||
//The value of the first should grow as population grows.
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ package net.psforever.objects.vehicles.control
|
|||
import akka.actor.Cancellable
|
||||
import net.psforever.actors.zone.ZoneActor
|
||||
import net.psforever.objects._
|
||||
import net.psforever.objects.avatar.SpecialCarry
|
||||
import net.psforever.objects.definition.{VehicleDefinition, WithShields}
|
||||
import net.psforever.objects.definition.converter.OCM
|
||||
import net.psforever.objects.entity.WorldEntity
|
||||
|
|
@ -21,6 +22,7 @@ import net.psforever.objects.serverobject.environment.interaction.{InteractWithE
|
|||
import net.psforever.objects.serverobject.hackable.GenericHackables
|
||||
import net.psforever.objects.serverobject.mount.{Mountable, MountableBehavior, RadiationInMountableInteraction}
|
||||
import net.psforever.objects.serverobject.repair.RepairableVehicle
|
||||
import net.psforever.objects.serverobject.structures.WarpGate
|
||||
import net.psforever.objects.serverobject.terminals.Terminal
|
||||
import net.psforever.objects.serverobject.turret.auto.AffectedByAutomaticTurretFire
|
||||
import net.psforever.objects.sourcing.{PlayerSource, SourceEntry, VehicleSource}
|
||||
|
|
@ -122,6 +124,14 @@ class VehicleControl(vehicle: Vehicle)
|
|||
if vehicle.DeploymentState == DriveState.AutoPilot =>
|
||||
sender() ! Mountable.MountMessages(user, Mountable.CanNotMount(vehicle, mountPoint))
|
||||
|
||||
case Mountable.TryMount(user, mountPoint)
|
||||
if vehicle.Zone.blockMap.sector(vehicle).buildingList.exists {
|
||||
case wg: WarpGate =>
|
||||
Vector3.DistanceSquared(vehicle.Position, wg.Position) < math.pow(wg.Definition.SOIRadius, 2)
|
||||
case _ => false
|
||||
} && user.Carrying.contains(SpecialCarry.CaptureFlag) =>
|
||||
sender() ! Mountable.MountMessages(user, Mountable.CanNotMount(vehicle, mountPoint))
|
||||
|
||||
case msg @ Mountable.TryMount(player, mount_point) =>
|
||||
mountBehavior.apply(msg)
|
||||
mountCleanup(mount_point, player)
|
||||
|
|
|
|||
|
|
@ -284,8 +284,8 @@ object CaptureFlagManager {
|
|||
.GUID(flagGuid)
|
||||
.collect {
|
||||
case flag: CaptureFlag
|
||||
if LoseFlagViolentlyToEnvironment(target, Set(EnvironmentAttribute.Water, EnvironmentAttribute.Lava, EnvironmentAttribute.Death)) ||
|
||||
LoseFlagViolentlyToWarpGateEnvelope(zone, target) =>
|
||||
if LoseFlagViolentlyToEnvironment(target, Set(EnvironmentAttribute.Water, EnvironmentAttribute.Lava, EnvironmentAttribute.Death)) /*||
|
||||
LoseFlagViolentlyToWarpGateEnvelope(zone, target)*/ =>
|
||||
flag.Destroyed = true
|
||||
zone.LocalEvents ! LocalServiceMessage("", LocalAction.LluLost(flag))
|
||||
true
|
||||
|
|
|
|||
Loading…
Reference in a new issue