small touch-up

This commit is contained in:
FateJH 2019-10-08 18:47:03 -04:00
parent f7098618d7
commit 5a1527ae10
6 changed files with 30 additions and 14 deletions

View file

@ -15,7 +15,7 @@ class SquadFeatures(val Squad : Squad) {
* Dispatched only once when a squad is first listed
* or when the squad leader searches for recruits by proximity or for certain roles or by invite
* or when a spontaneous squad forms,
* whichever happens first.
* whatever happens first.
* Additionally, the packets are also sent when the check is made when the continent is changed (or set).
*/
private var initialAssociation : Boolean = true
@ -151,4 +151,4 @@ class SquadFeatures(val Squad : Squad) {
}
Prompt
}
}
}

View file

@ -122,7 +122,8 @@ import scodec.codecs._
* ` - 0 is LFS`<br>
* ` - 1 is LFSM (Looking for Squad Members)`<br>
* ` - n is the supplemental squad identifier number; same as "LFS;" for the leader, sets "LFSM" after the first manual flagging`<br>
* `32 - Info under avatar name : 0 = Looking For Squad Members, 1 = LFS`<br>
* `32 - Maintain the squad role index, when a member of a squad;<br>
* - OLD: "Info under avatar name : 0 = Looking For Squad Members, 1 = LFS`"<br>
* `35 - BR. Value is the BR`<br>
* `36 - CR. Value is the CR`<br>
* `43 - Info on avatar name : 0 = Nothing, 1 = "(LD)" message`<br>

View file

@ -18,7 +18,6 @@ object SquadResponse {
final case class SetListSquad(squad_guid : PlanetSideGUID) extends Response
final case class Membership(request_type : SquadResponseType.Value, unk1 : Int, unk2 : Int, unk3 : Long, unk4 : Option[Long], player_name : String, unk5 : Boolean, unk6 : Option[Option[String]]) extends Response //see SquadMembershipResponse
final case class Invite(from_char_id : Long, to_char_id : Long, name : String) extends Response
final case class WantsSquadPosition(leader_char_id : Long, bid_name : String) extends Response
final case class Join(squad : Squad, positionsToUpdate : List[Int], channel : String) extends Response
final case class Leave(squad : Squad, positionsToUpdate : List[(Long, Int)]) extends Response

View file

@ -2240,7 +2240,13 @@ class SquadService extends Actor {
val toChannel = s"/${features.ToChannel}/Squad"
memberCharIds.foreach { charId =>
SquadEvents.subscribe(UserEvents(charId), toChannel)
Publish(charId, SquadResponse.Join(squad, indices, toChannel))
Publish(charId,
SquadResponse.Join(
squad,
indices.filterNot(_ == position) :+ position,
toChannel
)
)
InitWaypoints(charId, squad.GUID)
}
//fully update for all users
@ -2255,7 +2261,11 @@ class SquadService extends Actor {
charId,
SquadResponse.Join(
squad,
squad.Membership.zipWithIndex.collect({ case (member, index) if member.CharId > 0 => index }).toList,
squad.Membership
.zipWithIndex
.collect({ case (member, index) if member.CharId > 0 => index })
.filterNot(_== position)
.toList :+ position,
toChannel
)
)
@ -2580,10 +2590,20 @@ class SquadService extends Actor {
}
}
/**
* na
* @param charId the player's unique character identifier number
* @param sender the `ActorRef` associated with this character
*/
def LeaveService(charId : String, sender : ActorRef) : Unit = {
LeaveService(charId.toLong, sender)
}
/**
* na
* @param charId the player's unique character identifier number
* @param sender the `ActorRef` associated with this character
*/
def LeaveService(charId : Long, sender : ActorRef) : Unit = {
refused.remove(charId)
continueToMonitorDetails.remove(charId)
@ -2690,6 +2710,7 @@ class SquadService extends Actor {
//remove squad from listing
factionListings.remove(index)
//Publish(faction, SquadResponse.RemoveFromList(Seq(index)))
squadFeatures(squad.GUID).Refuse
Publish(faction, SquadResponse.InitList(PublishedLists(factionListings)))
}
case None =>

View file

@ -1315,7 +1315,7 @@ class DetailedCharacterDataTest extends Specification {
a.data.v5.isEmpty mustEqual true
a.exosuit mustEqual ExoSuitType.Standard
a.unk5 mustEqual 0
a.unk6 mustEqual 1267466L
a.char_id mustEqual 1267466L
a.unk7 mustEqual 3
a.unk8 mustEqual 3
a.unk9 mustEqual 0