kicked player leaves outfit chat

This commit is contained in:
ScrawnyRonnie 2025-09-02 09:19:52 -04:00
parent 0ce5e1ab0c
commit 036d226de1
6 changed files with 22 additions and 0 deletions

View file

@ -482,6 +482,9 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
case AvatarResponse.ShareAntExperienceWithSquad(owner, exp, vehicle) =>
ops.shareAntExperienceWithSquad(owner, exp, vehicle)
case AvatarResponse.RemoveFromOutfitChat(outfit_id) =>
ops.removeFromOutfitChat(outfit_id)
case AvatarResponse.SendResponse(msg) =>
sendResponse(msg)

View file

@ -9,6 +9,7 @@ import net.psforever.packet.game.objectcreate.ConstructorData
import net.psforever.objects.zones.exp
import net.psforever.services.Service
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage, AvatarServiceResponse}
import net.psforever.services.chat.OutfitChannel
import scala.collection.mutable
//
@ -237,6 +238,10 @@ class SessionAvatarHandlers(
}
player.VehicleSeated = None
}
def removeFromOutfitChat(outfit_id: Long): Unit = {
sessionLogic.chat.LeaveChannel(OutfitChannel(outfit_id))
}
}
object SessionAvatarHandlers {

View file

@ -260,6 +260,9 @@ object SessionOutfitHandlers {
kicked.Zone.AvatarEvents ! AvatarServiceMessage(kicked.Zone.id,
AvatarAction.PlanetsideStringAttribute(kicked.GUID, 0, ""))
kicked.Zone.AvatarEvents ! AvatarServiceMessage(
kicked.Name, AvatarAction.RemoveFromOutfitChat(kickedBy.outfit_id))
kicked.outfit_id = 0
kicked.outfit_name = ""
PlayerControl.sendResponse(kicked.Zone, kicked.Name,

View file

@ -484,6 +484,15 @@ class AvatarService(zone: Zone) extends Actor {
)
)
case AvatarAction.RemoveFromOutfitChat(outfit_id) =>
AvatarEvents.publish(
AvatarServiceResponse(
s"/$forChannel/Avatar",
Service.defaultPlayerGUID,
AvatarResponse.RemoveFromOutfitChat(outfit_id)
)
)
case _ => ()
}

View file

@ -164,6 +164,7 @@ object AvatarAction {
final case class FacilityCaptureRewards(building_id: Int, zone_number: Int, exp: Long) extends Action
final case class ShareKillExperienceWithSquad(killer: Player, exp: Long) extends Action
final case class ShareAntExperienceWithSquad(owner: UniquePlayer, exp: Long, vehicle: Vehicle) extends Action
final case class RemoveFromOutfitChat(outfit_id: Long) extends Action
final case class TeardownConnection() extends Action
// final case class PlayerStateShift(killer : PlanetSideGUID, victim : PlanetSideGUID) extends Action

View file

@ -135,4 +135,5 @@ object AvatarResponse {
final case class FacilityCaptureRewards(building_id: Int, zone_number: Int, exp: Long) extends Response
final case class ShareKillExperienceWithSquad(killer: Player, exp: Long) extends Response
final case class ShareAntExperienceWithSquad(owner: UniquePlayer, exp: Long, vehicle: Vehicle) extends Response
final case class RemoveFromOutfitChat(outfit_id: Long) extends Response
}