Fixes From 20210421 Logs (#784)

* test before casting to int; unsupported equipment in loadouts

* replacing null with Default.Actor

* in/out times but no actor

* empty password; squad ui elements out of order
This commit is contained in:
Fate-JH 2021-04-21 17:31:02 -04:00 committed by GitHub
parent ffa8e16c07
commit 00c8b92b44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 36 additions and 27 deletions

View file

@ -105,7 +105,7 @@ class LoginActor(middlewareActor: typed.ActorRef[MiddlewareActor.Command], conne
log.trace(s"New login UN:$username. $clientVersion") log.trace(s"New login UN:$username. $clientVersion")
} }
accountLogin(username, password.get) accountLogin(username, password.getOrElse(""))
case ConnectToWorldRequestMessage(name, _, _, _, _, _, _) => case ConnectToWorldRequestMessage(name, _, _, _, _, _, _) =>
log.info(s"Connect to world request for '$name'") log.info(s"Connect to world request for '$name'")

View file

@ -135,19 +135,21 @@ class SocketActor(
val sessionReaper: Cancellable = context.system.scheduler.scheduleWithFixedDelay(0.seconds, 5.seconds)(() => { val sessionReaper: Cancellable = context.system.scheduler.scheduleWithFixedDelay(0.seconds, 5.seconds)(() => {
val now = System.currentTimeMillis() val now = System.currentTimeMillis()
packetActors.keys.foreach(addr => { packetActors.keys.foreach(addr => {
incomingTimes.get(addr) match { packetActors.get(addr) match {
case Some(time) => case Some(child) =>
if (now - time > Config.app.network.session.inboundGraceTime.toMillis) { if(
context.self ! StopChild(packetActors(addr)) (incomingTimes.get(addr) match {
case Some(time) => now - time > Config.app.network.session.inboundGraceTime.toMillis
case _ => false
}) ||
(outgoingTimes.get(addr) match {
case Some(time) => now - time > Config.app.network.session.outboundGraceTime.toMillis
case _ => false
})
) {
context.self ! StopChild(child)
} }
case _ => () case _ => ;
}
outgoingTimes.get(addr) match {
case Some(time) =>
if (now - time > Config.app.network.session.outboundGraceTime.toMillis) {
context.self ! StopChild(packetActors(addr))
}
case _ => ()
} }
}) })
}) })

View file

@ -1283,6 +1283,10 @@ class AvatarActor(
case "Kit" => case "Kit" =>
doll.Slot(objectIndex).Equipment = doll.Slot(objectIndex).Equipment =
Kit(DefinitionUtil.idToDefinition(objectId).asInstanceOf[KitDefinition]) Kit(DefinitionUtil.idToDefinition(objectId).asInstanceOf[KitDefinition])
case "Telepad" | "BoomerTrigger" => ;
//special types of equipment that are not actually loaded
case name =>
log.error(s"failing to add unknown equipment to a loadout - $name")
} }
toolAmmo foreach { toolAmmo => toolAmmo foreach { toolAmmo =>

View file

@ -262,7 +262,7 @@ class ChatActor(
sessionActor ! SessionActor.Suicide() sessionActor ! SessionActor.Suicide()
} }
case (CMT_DESTROY, _, contents) => case (CMT_DESTROY, _, contents) if contents.matches("\\d+") =>
val guid = contents.toInt val guid = contents.toInt
session.zone.GUID(session.zone.map.terminalToSpawnPad.getOrElse(guid, guid)) match { session.zone.GUID(session.zone.map.terminalToSpawnPad.getOrElse(guid, guid)) match {
case Some(pad: VehicleSpawnPad) => case Some(pad: VehicleSpawnPad) =>

View file

@ -174,12 +174,12 @@ class SessionActor(middlewareActor: typed.ActorRef[MiddlewareActor.Command], con
private[this] val damageLog = org.log4s.getLogger(Damageable.LogChannel) private[this] val damageLog = org.log4s.getLogger(Damageable.LogChannel)
var avatarActor: typed.ActorRef[AvatarActor.Command] = context.spawnAnonymous(AvatarActor(context.self)) var avatarActor: typed.ActorRef[AvatarActor.Command] = context.spawnAnonymous(AvatarActor(context.self))
var chatActor: typed.ActorRef[ChatActor.Command] = context.spawnAnonymous(ChatActor(context.self, avatarActor)) var chatActor: typed.ActorRef[ChatActor.Command] = context.spawnAnonymous(ChatActor(context.self, avatarActor))
var accountIntermediary: ActorRef = ActorRef.noSender var accountIntermediary: ActorRef = Default.Actor
var accountPersistence: ActorRef = ActorRef.noSender var accountPersistence: ActorRef = Default.Actor
var galaxyService: ActorRef = ActorRef.noSender var galaxyService: ActorRef = Default.Actor
var squadService: ActorRef = ActorRef.noSender var squadService: ActorRef = Default.Actor
var propertyOverrideManager: ActorRef = Actor.noSender var propertyOverrideManager: ActorRef = Default.Actor
var cluster: typed.ActorRef[ICS.Command] = Actor.noSender var cluster: typed.ActorRef[ICS.Command] = Default.Actor
var _session: Session = Session() var _session: Session = Session()
var progressBarValue: Option[Float] = None var progressBarValue: Option[Float] = None
var shooting: Option[PlanetSideGUID] = None //ChangeFireStateMessage_Start var shooting: Option[PlanetSideGUID] = None //ChangeFireStateMessage_Start
@ -3316,13 +3316,16 @@ class SessionActor(middlewareActor: typed.ActorRef[MiddlewareActor.Command], con
* only the zone-specific squad members will receive the important messages about their squad member's spawn. * only the zone-specific squad members will receive the important messages about their squad member's spawn.
*/ */
def RespawnSquadSetup(): Unit = { def RespawnSquadSetup(): Unit = {
if (squadUI.nonEmpty) { squadUI.get(player.CharId) match {
sendResponse(PlanetsideAttributeMessage(player.GUID, 31, squad_supplement_id)) case Some(elem) =>
continent.AvatarEvents ! AvatarServiceMessage( sendResponse(PlanetsideAttributeMessage(player.GUID, 31, squad_supplement_id))
s"${player.Faction}", continent.AvatarEvents ! AvatarServiceMessage(
AvatarAction.PlanetsideAttribute(player.GUID, 31, squad_supplement_id) s"${player.Faction}",
) AvatarAction.PlanetsideAttribute(player.GUID, 31, squad_supplement_id)
sendResponse(PlanetsideAttributeMessage(player.GUID, 32, squadUI(player.CharId).index)) )
sendResponse(PlanetsideAttributeMessage(player.GUID, 32, elem.index))
case _ =>
log.warn(s"RespawnSquadSetup: asked to redraw squad information, but ${player.Name} has no squad element for squad $squad_supplement_id")
} }
} }