mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-01-19 18:44:45 +00:00
restored killed->autorevive functionality; removed last traces of old door code from general operations
This commit is contained in:
parent
720bc97838
commit
ce2be64a54
|
|
@ -5,12 +5,10 @@ import akka.actor.{ActorContext, typed}
|
|||
import net.psforever.actors.session.support.AvatarHandlerFunctions
|
||||
import net.psforever.login.WorldSession.PutLoadoutEquipmentInInventory
|
||||
import net.psforever.objects.PlanetSideGameObject
|
||||
import net.psforever.objects.definition.converter.OCM
|
||||
import net.psforever.objects.inventory.Container
|
||||
import net.psforever.objects.serverobject.containable.ContainableBehavior
|
||||
import net.psforever.objects.serverobject.mount.Mountable
|
||||
import net.psforever.packet.game.{AvatarImplantMessage, CreateShortcutMessage, ImplantAction}
|
||||
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
|
||||
import net.psforever.types.ImplantType
|
||||
|
||||
//
|
||||
|
|
@ -438,28 +436,11 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
|
|||
sendResponse(ReloadMessage(itemGuid, ammo_clip=1, unk1=0))
|
||||
|
||||
case AvatarResponse.Killed(mount) =>
|
||||
val pguid = player.GUID
|
||||
val avatarId = player.Definition.ObjectId
|
||||
//pure logic
|
||||
sessionLogic.shooting.shotsWhileDead = 0
|
||||
sessionLogic.zoning.CancelZoningProcess()
|
||||
|
||||
//player state changes
|
||||
AvatarActor.updateToolDischargeFor(avatar)
|
||||
player.FreeHand.Equipment.foreach { item =>
|
||||
DropEquipmentFromInventory(player)(item)
|
||||
}
|
||||
sessionLogic.general.dropSpecialSlotItem()
|
||||
sessionLogic.general.toggleMaxSpecialState(enable = false)
|
||||
sessionLogic.keepAliveFunc = sessionLogic.zoning.NormalKeepAlive
|
||||
sessionLogic.zoning.zoningStatus = Zoning.Status.None
|
||||
ops.revive(player.GUID)
|
||||
AvatarActor.savePlayerLocation(player)
|
||||
avatarActor ! AvatarActor.InitializeImplants
|
||||
AvatarActor.updateToolDischargeFor(avatar)
|
||||
player.FreeHand.Equipment.foreach { item =>
|
||||
DropEquipmentFromInventory(player)(item)
|
||||
}
|
||||
continent.GUID(mount)
|
||||
.collect {
|
||||
case obj: Vehicle if obj.Destroyed =>
|
||||
|
|
@ -469,13 +450,17 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
|
|||
sessionLogic.general.unaccessContainer(obj)
|
||||
case _ => ()
|
||||
}
|
||||
//player state changes
|
||||
sessionLogic.general.dropSpecialSlotItem()
|
||||
sessionLogic.general.toggleMaxSpecialState(enable = false)
|
||||
player.FreeHand.Equipment.foreach(DropEquipmentFromInventory(player)(_))
|
||||
AvatarActor.updateToolDischargeFor(avatar)
|
||||
AvatarActor.savePlayerLocation(player)
|
||||
player.VehicleSeated = None
|
||||
sendResponse(OCM.detailed(player))
|
||||
continent.AvatarEvents ! AvatarServiceMessage(
|
||||
continent.id,
|
||||
AvatarAction.LoadPlayer(pguid, avatarId, pguid, player.Definition.Packet.ConstructorData(player).get, None)
|
||||
)
|
||||
sendResponse(ChatMsg(ChatMessageType.UNK_225, "CSR MODE"))
|
||||
ops.revive(player.GUID)
|
||||
avatarActor ! AvatarActor.InitializeImplants
|
||||
//render
|
||||
CustomerServiceRepresentativeMode.renderPlayer(sessionLogic, continent, player)
|
||||
|
||||
case AvatarResponse.Release(tplayer) if isNotSameTarget =>
|
||||
sessionLogic.zoning.spawn.DepictPlayerAsCorpse(tplayer)
|
||||
|
|
|
|||
|
|
@ -42,8 +42,6 @@ object GeneralLogic {
|
|||
}
|
||||
|
||||
class GeneralLogic(val ops: GeneralOperations, implicit val context: ActorContext) extends GeneralFunctions {
|
||||
private var openDoor: Option[Door] = None
|
||||
|
||||
def sessionLogic: SessionData = ops.sessionLogic
|
||||
|
||||
private val avatarActor: typed.ActorRef[AvatarActor.Command] = ops.avatarActor
|
||||
|
|
@ -95,18 +93,6 @@ class GeneralLogic(val ops: GeneralOperations, implicit val context: ActorContex
|
|||
sendResponse(PlanetsideAttributeMessage(avatarGuid, 4, maxArmor))
|
||||
continent.AvatarEvents ! AvatarServiceMessage(continent.id, AvatarAction.PlanetsideAttribute(avatarGuid, 4, maxArmor))
|
||||
}
|
||||
//doors
|
||||
openDoor
|
||||
.collect {
|
||||
case door
|
||||
if Vector3.DistanceSquared(door.Position.xy, player.Position.xy) > math.pow(door.Definition.continuousOpenDistance, 2).toFloat =>
|
||||
if (!door.isOpen) {
|
||||
sendResponse(GenericObjectStateMsg(door.GUID, state = 17))
|
||||
}
|
||||
openDoor = None
|
||||
case door if !door.isOpen =>
|
||||
sendResponse(GenericObjectStateMsg(door.GUID, state = 16))
|
||||
}
|
||||
//expected
|
||||
val isMoving = WorldEntity.isMoving(vel)
|
||||
val isMovingPlus = isMoving || isJumping || jumpThrust
|
||||
|
|
|
|||
Loading…
Reference in a new issue