mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-07-15 00:14:43 +00:00
Router Demonstration (ShiftPosition) (#1374)
* augmented player shift state with object delete and object create for other connected players * pausing teleporting player rendering * somehow compiled despite this capitalization error
This commit is contained in:
parent
dff212ac65
commit
83482a7207
5 changed files with 61 additions and 28 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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(
|
||||||
|
|
|
||||||
|
|
@ -467,7 +467,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
|
||||||
sessionLogic.zoning.spawn.reviveTimer.cancel()
|
sessionLogic.zoning.spawn.reviveTimer.cancel()
|
||||||
|
|
|
||||||
|
|
@ -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,26 +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
|
||||||
sendResponse(PlayerStateShiftMessage(ShiftState(0, dest.Position, player.Orientation.z)))
|
events ! AvatarServiceMessage(zoneid, AvatarAction.ObjectDelete(pguid, pguid))
|
||||||
useRouterTelepadEffect(pguid, sguid, dguid)
|
events ! AvatarServiceMessage(player.Name,
|
||||||
continent.LocalEvents ! LocalServiceMessage(
|
AvatarAction.SendResponse(PlanetSideGUID(0), PlayerStateShiftMessage(ShiftState(0, destinationPosition, player.Orientation.z)))
|
||||||
continent.id,
|
)
|
||||||
LocalAction.RouterTelepadTransport(pguid, pguid, sguid, dguid)
|
player.Position = destinationPosition
|
||||||
)
|
events ! AvatarServiceMessage(zoneid, AvatarAction.LoadPlayer(
|
||||||
player.Position = dest.Position
|
pguid,
|
||||||
player.LogActivity(TelepadUseActivity(VehicleSource(router), DeployableSource(remoteTelepad), PlayerSource(player)))
|
player.Definition.ObjectId,
|
||||||
} else {
|
pguid,
|
||||||
log.warn(s"UseRouterTelepadSystem: ${player.Name} can not teleport")
|
player.Definition.Packet.ConstructorData(player).get,
|
||||||
|
None
|
||||||
|
))
|
||||||
|
useRouterTelepadEffect(pguid, sguid, dguid)
|
||||||
|
continent.LocalEvents ! LocalServiceMessage(
|
||||||
|
continent.id,
|
||||||
|
LocalAction.RouterTelepadTransport(pguid, pguid, sguid, dguid)
|
||||||
|
)
|
||||||
|
sessionLogic.zoning.spawn.ShiftPosition = destinationPosition
|
||||||
|
player.LogActivity(TelepadUseActivity(VehicleSource(router), DeployableSource(remoteTelepad), PlayerSource(player)))
|
||||||
|
} else {
|
||||||
|
log.warn(s"UseRouterTelepadSystem: ${player.Name} can not teleport")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
recentTeleportAttempt = time
|
recentTeleportAttemptTime = time
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1463,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
|
||||||
) {
|
) {
|
||||||
|
|
@ -1476,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 = {
|
||||||
|
|
|
||||||
|
|
@ -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(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue