pausing teleporting player rendering

This commit is contained in:
Fate-JH 2026-05-25 18:55:24 -04:00
parent 4f74dbaf80
commit e5d5e65c7f
4 changed files with 60 additions and 39 deletions

View file

@ -574,7 +574,7 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
sessionLogic.actionsToCancel() sessionLogic.actionsToCancel()
sessionLogic.terminals.CancelAllProximityUnits() sessionLogic.terminals.CancelAllProximityUnits()
AvatarActor.savePlayerLocation(player) AvatarActor.savePlayerLocation(player)
sessionLogic.zoning.spawn.shiftPosition = Some(player.Position) sessionLogic.zoning.spawn.ShiftPosition = Some(player.Position)
//respawn //respawn
val respawnTimer = 300000 //milliseconds val respawnTimer = 300000 //milliseconds

View file

@ -169,7 +169,16 @@ class GeneralLogic(val ops: GeneralOperations, implicit val context: ActorContex
// //
val eagleEye: Boolean = ops.canSeeReallyFar val eagleEye: Boolean = ops.canSeeReallyFar
val isNotVisible: Boolean = sessionLogic.zoning.zoningStatus == Zoning.Status.Deconstructing || val isNotVisible: Boolean = sessionLogic.zoning.zoningStatus == Zoning.Status.Deconstructing ||
(player.isAlive && sessionLogic.zoning.spawn.deadState == DeadState.RespawnTime) (player.isAlive && sessionLogic.zoning.spawn.deadState == DeadState.RespawnTime) ||
(sessionLogic.zoning.spawn.ShiftPosition match {
case Some(position) if Vector3.DistanceSquared(position, pos) < 25f =>
sessionLogic.zoning.spawn.ShiftPosition = None
false
case Some(_) =>
true
case _ =>
false
})
continent.AvatarEvents ! AvatarServiceMessage( continent.AvatarEvents ! AvatarServiceMessage(
continent.id, continent.id,
AvatarAction.PlayerState( AvatarAction.PlayerState(

View file

@ -182,7 +182,7 @@ class GeneralOperations(
) extends CommonSessionInterfacingFunctionality { ) extends CommonSessionInterfacingFunctionality {
private[session] var progressBarValue: Option[Float] = None private[session] var progressBarValue: Option[Float] = None
private[session] var accessedContainer: Option[PlanetSideGameObject with Container] = None private[session] var accessedContainer: Option[PlanetSideGameObject with Container] = None
private[session] var recentTeleportAttempt: Long = 0 private[session] var recentTeleportAttemptTime: Long = 0
private[session] var kitToBeUsed: Option[PlanetSideGUID] = None private[session] var kitToBeUsed: Option[PlanetSideGUID] = None
// If a special item (e.g. LLU) has been attached to the player the GUID should be stored here, or cleared when dropped, since the drop hotkey doesn't send the GUID of the object to be dropped. // If a special item (e.g. LLU) has been attached to the player the GUID should be stored here, or cleared when dropped, since the drop hotkey doesn't send the GUID of the object to be dropped.
private[session] var specialItemSlotGuid: Option[PlanetSideGUID] = None private[session] var specialItemSlotGuid: Option[PlanetSideGUID] = None
@ -1210,8 +1210,8 @@ class GeneralOperations(
sessionLogic.zoning.CancelZoningProcessWithDescriptiveReason("cancel_use") sessionLogic.zoning.CancelZoningProcessWithDescriptiveReason("cancel_use")
if (msg.unk3) { if (msg.unk3) {
msg.object_id match { msg.object_id match {
case ObjectClass.avatar | ObjectClass.avatar_bot | ObjectClass.avatar_bot_agile | ObjectClass.avatar_bot_agile_no_weapon | case ObjectClass.avatar | ObjectClass.avatar_bot | ObjectClass.avatar_bot_agile | ObjectClass.avatar_bot_agile_no_weapon |
ObjectClass.avatar_bot_max | ObjectClass.avatar_bot_max_no_weapon | ObjectClass.avatar_bot_reinforced | ObjectClass.avatar_bot_max | ObjectClass.avatar_bot_max_no_weapon | ObjectClass.avatar_bot_reinforced |
ObjectClass.avatar_bot_reinforced_no_weapon | ObjectClass.avatar_bot_standard | ObjectClass.avatar_bot_standard_no_weapon => ObjectClass.avatar_bot_reinforced_no_weapon | ObjectClass.avatar_bot_standard | ObjectClass.avatar_bot_standard_no_weapon =>
equipment match { equipment match {
case Some(tool: Tool) if tool.Definition == GlobalDefinitions.bank => case Some(tool: Tool) if tool.Definition == GlobalDefinitions.bank =>
@ -1424,38 +1424,38 @@ class GeneralOperations(
dest: PlanetSideGameObject with TelepadLike dest: PlanetSideGameObject with TelepadLike
): Unit = { ): Unit = {
val time = System.currentTimeMillis() val time = System.currentTimeMillis()
if ( if (time - recentTeleportAttemptTime > 2000L) {
time - recentTeleportAttempt > 2000L && router.DeploymentState == DriveState.Deployed && if (router.DeploymentState == DriveState.Deployed && internalTelepad.Active && remoteTelepad.Active) {
internalTelepad.Active && val pguid = player.GUID
remoteTelepad.Active val sguid = src.GUID
) { val dguid = dest.GUID
val pguid = player.GUID val events = continent.AvatarEvents
val sguid = src.GUID val zoneid = continent.id
val dguid = dest.GUID val destinationPosition = dest.Position
val events = continent.AvatarEvents events ! AvatarServiceMessage(zoneid, AvatarAction.ObjectDelete(pguid, pguid))
val zoneid = continent.id events ! AvatarServiceMessage(player.Name,
events ! AvatarServiceMessage(zoneid, AvatarAction.ObjectDelete(pguid, pguid)) AvatarAction.SendResponse(PlanetSideGUID(0), PlayerStateShiftMessage(ShiftState(0, destinationPosition, player.Orientation.z)))
events ! AvatarServiceMessage(player.Name, )
AvatarAction.SendResponse(PlanetSideGUID(0), PlayerStateShiftMessage(ShiftState(0, dest.Position, player.Orientation.z))) player.Position = destinationPosition
) events ! AvatarServiceMessage(zoneid, AvatarAction.LoadPlayer(
player.Position = dest.Position pguid,
events ! AvatarServiceMessage(zoneid, AvatarAction.LoadPlayer( player.Definition.ObjectId,
pguid, pguid,
player.Definition.ObjectId, player.Definition.Packet.ConstructorData(player).get,
pguid, None
player.Definition.Packet.ConstructorData(player).get, ))
None useRouterTelepadEffect(pguid, sguid, dguid)
)) continent.LocalEvents ! LocalServiceMessage(
useRouterTelepadEffect(pguid, sguid, dguid) continent.id,
continent.LocalEvents ! LocalServiceMessage( LocalAction.RouterTelepadTransport(pguid, pguid, sguid, dguid)
zoneid, )
LocalAction.RouterTelepadTransport(pguid, pguid, sguid, dguid) sessionLogic.zoning.spawn.ShiftPosition = destinationPosition
) player.LogActivity(TelepadUseActivity(VehicleSource(router), DeployableSource(remoteTelepad), PlayerSource(player)))
player.LogActivity(TelepadUseActivity(VehicleSource(router), DeployableSource(remoteTelepad), PlayerSource(player))) } else {
} else { log.warn(s"UseRouterTelepadSystem: ${player.Name} can not teleport")
log.warn(s"UseRouterTelepadSystem: ${player.Name} can not teleport") }
} }
recentTeleportAttempt = time recentTeleportAttemptTime = time
} }
/** /**
@ -1475,7 +1475,7 @@ class GeneralOperations(
): Unit = { ): Unit = {
val time = System.currentTimeMillis() val time = System.currentTimeMillis()
if ( if (
time - recentTeleportAttempt > 2000L && router.DeploymentState == DriveState.Deployed && time - recentTeleportAttemptTime > 2000L && router.DeploymentState == DriveState.Deployed &&
internalTelepad.Active && internalTelepad.Active &&
remoteTelepad.Active remoteTelepad.Active
) { ) {
@ -1488,7 +1488,7 @@ class GeneralOperations(
} else { } else {
log.warn(s"UseRouterTelepadSystem: ${player.Name} can not teleport") log.warn(s"UseRouterTelepadSystem: ${player.Name} can not teleport")
} }
recentTeleportAttempt = time recentTeleportAttemptTime = time
} }
def handleUseCaptureFlag(obj: CaptureFlag): Unit = { def handleUseCaptureFlag(obj: CaptureFlag): Unit = {

View file

@ -1998,7 +1998,7 @@ class ZoningOperations(
* As they should arrive roughly every 250 milliseconds this allows for a very crude method of scheduling tasks up to four times per second * As they should arrive roughly every 250 milliseconds this allows for a very crude method of scheduling tasks up to four times per second
*/ */
private[session] var upstreamMessageCount: Int = 0 private[session] var upstreamMessageCount: Int = 0
private[session] var shiftPosition: Option[Vector3] = None private var shiftPosition: Option[Vector3] = None
private[session] var shiftOrientation: Option[Vector3] = None private[session] var shiftOrientation: Option[Vector3] = None
private[session] var drawDeloyableIcon: PlanetSideGameObject with Deployable => Unit = RedrawDeployableIcons private[session] var drawDeloyableIcon: PlanetSideGameObject with Deployable => Unit = RedrawDeployableIcons
private[session] var populateAvatarAwardRibbonsFunc: (Int, Long) => Unit = setupAvatarAwardMessageDelivery private[session] var populateAvatarAwardRibbonsFunc: (Int, Long) => Unit = setupAvatarAwardMessageDelivery
@ -4120,6 +4120,18 @@ class ZoningOperations(
def clearAllQueuedActivity(): Unit = { def clearAllQueuedActivity(): Unit = {
queuedActivities = Seq() queuedActivities = Seq()
} }
def ShiftPosition: Option[Vector3] = shiftPosition
def ShiftPosition_=(toPosition: Option[Vector3]): Option[Vector3] = {
shiftPosition = toPosition
ShiftPosition
}
def ShiftPosition_=(toPosition: Vector3): Option[Vector3] = {
shiftPosition = Some(toPosition)
ShiftPosition
}
} }
def doorsThatShouldBeClosedOrBeOpenedByRange( def doorsThatShouldBeClosedOrBeOpenedByRange(