mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-12 15:04:39 +00:00
Fix implant auto activation not always working
This commit is contained in:
parent
490e6244e7
commit
2dc1b5736a
2 changed files with 11 additions and 18 deletions
|
|
@ -846,12 +846,6 @@ class AvatarActor(
|
||||||
case other => other
|
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")
|
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.get(slot).foreach(_.cancel())
|
||||||
implantTimers(slot) = context.scheduleOnce(
|
implantTimers(slot) = context.scheduleOnce(
|
||||||
implant.definition.InitializationDuration.seconds,
|
implant.definition.InitializationDuration.seconds,
|
||||||
|
|
@ -1086,6 +1072,14 @@ class AvatarActor(
|
||||||
SetImplantInitialized(implant.definition.implantType)
|
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, _) => ;
|
case (None, _) => ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4600,14 +4600,13 @@ class SessionActor(middlewareActor: typed.ActorRef[MiddlewareActor.Command], con
|
||||||
if (action == ImplantAction.Activation) {
|
if (action == ImplantAction.Activation) {
|
||||||
CancelZoningProcessWithDescriptiveReason("cancel_implant")
|
CancelZoningProcessWithDescriptiveReason("cancel_implant")
|
||||||
avatar.implants(slot) match {
|
avatar.implants(slot) match {
|
||||||
case Some(implant) if implant.initialized =>
|
case Some(implant) =>
|
||||||
if (!implant.active) {
|
if (status == 1) {
|
||||||
avatarActor ! AvatarActor.ActivateImplant(implant.definition.implantType)
|
avatarActor ! AvatarActor.ActivateImplant(implant.definition.implantType)
|
||||||
} else {
|
} else {
|
||||||
avatarActor ! AvatarActor.DeactivateImplant(implant.definition.implantType)
|
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…
Add table
Add a link
Reference in a new issue