removed redundant subscription; made sure to publish waypoint events properly

This commit is contained in:
FateJH 2019-10-14 16:20:51 -04:00
parent 7d9d5105f6
commit 16afb63b34
2 changed files with 11 additions and 5 deletions

View file

@ -955,11 +955,18 @@ class SquadService extends Actor {
}) match {
case (Some(squad), Some(_)) =>
//waypoint added or updated
SquadServiceResponse(s"/${squadFeatures(squad.GUID).ToChannel}/Squad", tplayer.CharId, SquadResponse.WaypointEvent(WaypointEventAction.Add, playerCharId, wtype, None, info, 1))
Publish(
s"${squadFeatures(squad.GUID).ToChannel}",
SquadResponse.WaypointEvent(WaypointEventAction.Add, playerCharId, wtype, None, info, 1),
Seq(tplayer.CharId)
)
case (Some(squad), None) =>
//waypoint removed?
SquadServiceResponse(s"/${squadFeatures(squad.GUID).ToChannel}/Squad", tplayer.CharId, SquadResponse.WaypointEvent(WaypointEventAction.Remove, playerCharId, wtype, None, None, 0))
//waypoint removed
Publish(
s"${squadFeatures(squad.GUID).ToChannel}",
SquadResponse.WaypointEvent(WaypointEventAction.Remove, playerCharId, wtype, None, None, 0),
Seq(tplayer.CharId)
)
case msg =>
log.warn(s"Unsupported squad waypoint behavior: $msg")