mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-01-20 02:24:45 +00:00
Fix implant auto activation not always working
This commit is contained in:
parent
490e6244e7
commit
2dc1b5736a
|
|
@ -846,12 +846,6 @@ class AvatarActor(
|
|||
case other => other
|
||||
})
|
||||
|
||||
// automatic targeting implant activation is a client side feature
|
||||
// For some reason it doesn't always work with 100% reliability, so we're also activating it server side
|
||||
// Must be delayed by a bit or the client will toggle it off again
|
||||
if (implantType == ImplantType.Targeting) {
|
||||
context.scheduleOnce(2.seconds, context.self, ActivateImplant(implantType))
|
||||
}
|
||||
case None => log.error(s"set initialized called for unknown implant $implantType")
|
||||
}
|
||||
|
||||
|
|
@ -1071,14 +1065,6 @@ class AvatarActor(
|
|||
)
|
||||
)
|
||||
|
||||
// Start client side initialization timer, visible on the character screen
|
||||
// Progress accumulates according to the client's knowledge of the implant initialization time
|
||||
// What is normally a 60s timer that is set to 120s on the server will still visually update as if 60s
|
||||
session.get.zone.AvatarEvents ! AvatarServiceMessage(
|
||||
avatar.name,
|
||||
AvatarAction.SendResponse(Service.defaultPlayerGUID, ActionProgressMessage(slot + 6, 0))
|
||||
)
|
||||
|
||||
implantTimers.get(slot).foreach(_.cancel())
|
||||
implantTimers(slot) = context.scheduleOnce(
|
||||
implant.definition.InitializationDuration.seconds,
|
||||
|
|
@ -1086,6 +1072,14 @@ class AvatarActor(
|
|||
SetImplantInitialized(implant.definition.implantType)
|
||||
)
|
||||
|
||||
// Start client side initialization timer, visible on the character screen
|
||||
// Progress accumulates according to the client's knowledge of the implant initialization time
|
||||
// What is normally a 60s timer that is set to 120s on the server will still visually update as if 60s\
|
||||
session.get.zone.AvatarEvents ! AvatarServiceMessage(
|
||||
avatar.name,
|
||||
AvatarAction.SendResponse(Service.defaultPlayerGUID, ActionProgressMessage(slot + 6, 0))
|
||||
)
|
||||
|
||||
case (None, _) => ;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4600,14 +4600,13 @@ class SessionActor(middlewareActor: typed.ActorRef[MiddlewareActor.Command], con
|
|||
if (action == ImplantAction.Activation) {
|
||||
CancelZoningProcessWithDescriptiveReason("cancel_implant")
|
||||
avatar.implants(slot) match {
|
||||
case Some(implant) if implant.initialized =>
|
||||
if (!implant.active) {
|
||||
case Some(implant) =>
|
||||
if (status == 1) {
|
||||
avatarActor ! AvatarActor.ActivateImplant(implant.definition.implantType)
|
||||
} else {
|
||||
avatarActor ! AvatarActor.DeactivateImplant(implant.definition.implantType)
|
||||
}
|
||||
case Some(implant) if !implant.initialized => ()
|
||||
case _ => log.error(s"AvatarImplantMessage: ${player.Name} has an unknown implant in $slot")
|
||||
case _ => log.error(s"AvatarImplantMessage: ${player.Name} has an unknown implant in $slot")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue