named parameters for certain longer packets

This commit is contained in:
FateJH 2018-06-09 20:51:54 -04:00
parent ffd8c02de9
commit 8166a43bdc
6 changed files with 110 additions and 94 deletions

View file

@ -66,20 +66,20 @@ object AvatarConverter {
def MakeAppearanceData(obj : Player) : (Int)=>CharacterAppearanceData = { def MakeAppearanceData(obj : Player) : (Int)=>CharacterAppearanceData = {
CharacterAppearanceData( CharacterAppearanceData(
BasicCharacterData(obj.Name, obj.Faction, obj.Sex, obj.Head, obj.Voice), BasicCharacterData(obj.Name, obj.Faction, obj.Sex, obj.Head, obj.Voice),
0, voice2 = 0,
false, black_ops = false,
false, jammered = false,
obj.ExoSuit, obj.ExoSuit,
"", outfit_name = "",
0, outfit_logo = 0,
obj.isBackpack, obj.isBackpack,
obj.Orientation.y, facingPitch = obj.Orientation.y,
obj.FacingYawUpper, facingYawUpper = obj.FacingYawUpper,
true, lfs = true,
GrenadeState.None, GrenadeState.None,
false, is_cloaking = false,
false, charging_pose = false,
false, on_zipline = false,
RibbonBars() RibbonBars()
) )
} }
@ -112,8 +112,8 @@ object AvatarConverter {
obj.Stamina, obj.Stamina,
obj.Certifications.toList.sortBy(_.id), //TODO is sorting necessary? obj.Certifications.toList.sortBy(_.id), //TODO is sorting necessary?
MakeImplantEntries(obj), MakeImplantEntries(obj),
List.empty[String], //TODO fte list firstTimeEvents = List.empty[String], //TODO fte list
List.empty[String], //TODO tutorial list tutorials = List.empty[String], //TODO tutorial list
MakeCosmetics(obj.BEP) MakeCosmetics(obj.BEP)
) )
} }

View file

@ -25,10 +25,15 @@ class CharacterSelectConverter extends AvatarConverter {
DetailedCharacterData( DetailedCharacterData(
obj.BEP, obj.BEP,
obj.CEP, obj.CEP,
1, 1, 0, 1, 1, healthMax = 1,
Nil, health = 1,
armor = 0,
staminaMax = 1,
stamina = 1,
certs = Nil,
MakeImplantEntries(obj), //necessary for correct stream length MakeImplantEntries(obj), //necessary for correct stream length
Nil, Nil, firstTimeEvents = Nil,
tutorials = Nil,
AvatarConverter.MakeCosmetics(obj.BEP) AvatarConverter.MakeCosmetics(obj.BEP)
), ),
InventoryData(recursiveMakeHolsters(obj.Holsters().iterator)), InventoryData(recursiveMakeHolsters(obj.Holsters().iterator)),
@ -46,20 +51,20 @@ class CharacterSelectConverter extends AvatarConverter {
private def MakeAppearanceData(obj : Player) : (Int)=>CharacterAppearanceData = { private def MakeAppearanceData(obj : Player) : (Int)=>CharacterAppearanceData = {
CharacterAppearanceData( CharacterAppearanceData(
BasicCharacterData(obj.Name, obj.Faction, obj.Sex, obj.Head, CharacterVoice.Mute), BasicCharacterData(obj.Name, obj.Faction, obj.Sex, obj.Head, CharacterVoice.Mute),
0, voice2 = 0,
false, black_ops = false,
false, jammered = false,
obj.ExoSuit, obj.ExoSuit,
"", outfit_name = "",
0, outfit_logo = 0,
false, backpack = false,
0f, facingPitch = 0,
0f, facingYawUpper = 0,
true, lfs = true,
GrenadeState.None, GrenadeState.None,
false, is_cloaking = false,
false, charging_pose = false,
false, on_zipline = false,
RibbonBars() RibbonBars()
) )
} }

View file

@ -19,9 +19,18 @@ class CorpseConverter extends AvatarConverter {
PlacementData(obj.Position, Vector3(0,0, obj.Orientation.z)), PlacementData(obj.Position, Vector3(0,0, obj.Orientation.z)),
MakeAppearanceData(obj), MakeAppearanceData(obj),
DetailedCharacterData( DetailedCharacterData(
0, 0, 0, 0, 0, 0, 0, bep = 0,
Nil, Nil, Nil, Nil, cep = 0,
None healthMax = 0,
health = 0,
armor = 0,
staminaMax = 0,
stamina = 0,
certs = Nil,
implants = Nil,
firstTimeEvents = Nil,
tutorials = Nil,
cosmetics = None
), ),
InventoryData((MakeHolsters(obj) ++ MakeInventory(obj)).sortBy(_.parentSlot)), InventoryData((MakeHolsters(obj) ++ MakeInventory(obj)).sortBy(_.parentSlot)),
DrawnSlot.None DrawnSlot.None
@ -37,20 +46,20 @@ class CorpseConverter extends AvatarConverter {
private def MakeAppearanceData(obj : Player) : (Int)=>CharacterAppearanceData = { private def MakeAppearanceData(obj : Player) : (Int)=>CharacterAppearanceData = {
CharacterAppearanceData( CharacterAppearanceData(
BasicCharacterData(obj.Name, obj.Faction, CharacterGender.Male, 0, CharacterVoice.Mute), BasicCharacterData(obj.Name, obj.Faction, CharacterGender.Male, 0, CharacterVoice.Mute),
0, voice2 = 0,
false, black_ops = false,
false, jammered = false,
obj.ExoSuit, obj.ExoSuit,
"", outfit_name = "",
0, outfit_logo = 0,
true, backpack = true,
obj.Orientation.y, //TODO is this important? facingPitch = obj.Orientation.y, //TODO is this important?
0, facingYawUpper = 0,
true, lfs = true,
GrenadeState.None, GrenadeState.None,
false, is_cloaking = false,
false, charging_pose = false,
false, on_zipline = false,
RibbonBars() RibbonBars()
) )
} }

View file

@ -18,21 +18,22 @@ class VehicleConverter extends ObjectCreateConverter[Vehicle]() {
VehicleData( VehicleData(
PlacementData(obj.Position, obj.Orientation, obj.Velocity), PlacementData(obj.Position, obj.Orientation, obj.Velocity),
obj.Faction, obj.Faction,
false, //bops bops = false,
health < 3, //destroyed destroyed = health < 3,
0, unk1 = 0,
obj.Jammered, //jammered obj.Jammered,
false, unk2 = false,
obj.Owner match { obj.Owner match {
case Some(owner) => owner case Some(owner) => owner
case None => PlanetSideGUID(0) case None => PlanetSideGUID(0)
}, },
false, unk3 = false,
health, health,
false, false, unk4 = false,
no_mount_points = false,
obj.DeploymentState, obj.DeploymentState,
false, unk5 = false,
false, unk6 = false,
obj.Cloaked, obj.Cloaked,
SpecificFormatData(obj), SpecificFormatData(obj),
Some(InventoryData(MakeDriverSeat(obj) ++ MakeUtilities(obj) ++ MakeMountings(obj))) Some(InventoryData(MakeDriverSeat(obj) ++ MakeUtilities(obj) ++ MakeMountings(obj)))

View file

@ -331,8 +331,8 @@ class PacketCodingActor extends Actor with MDCContextAware {
/** /**
* Accept a series of packets and transform it into a series of packet encodings. * Accept a series of packets and transform it into a series of packet encodings.
* Packets that do not encode properly are simply excluded for the product. * Packets that do not encode properly are simply excluded from the product.
* This is not treated as an error or exception; a warning will mrely be logged. * This is not treated as an error or exception; a warning will merely be logged.
* @param iter the `Iterator` for a series of packets * @param iter the `Iterator` for a series of packets
* @param out updated series of byte stream data produced through successful packet encoding; * @param out updated series of byte stream data produced through successful packet encoding;
* defaults to an empty list * defaults to an empty list

View file

@ -337,7 +337,7 @@ class WorldSessionActor extends Actor with MDCContextAware {
msg.facingYaw, msg.facingYaw,
msg.facingPitch, msg.facingPitch,
msg.facingYawUpper, msg.facingYawUpper,
0, unk1 = 0,
msg.is_crouching, msg.is_crouching,
msg.is_jumping, msg.is_jumping,
msg.jump_thrust, msg.jump_thrust,
@ -4226,27 +4226,27 @@ class WorldSessionActor extends Actor with MDCContextAware {
def initFacility(continentNumber : Int, buildingNumber : Int, building : Building) : Unit = { def initFacility(continentNumber : Int, buildingNumber : Int, building : Building) : Unit = {
sendResponse( sendResponse(
BuildingInfoUpdateMessage( BuildingInfoUpdateMessage(
continentNumber, //Zone continentNumber,
buildingNumber, //Facility buildingNumber,
8, //NTU% ntu_level = 8,
false, //Hacked is_hacked = false,
PlanetSideEmpire.NEUTRAL, //Base hacked by empire_hack = PlanetSideEmpire.NEUTRAL,
0, //Time remaining for hack (ms) hack_time_remaining = 0,
building.Faction, //Base owned by building.Faction,
0, //!! Field != 0 will cause malformed packet. See class def. unk1 = 0, //!! Field != 0 will cause malformed packet. See class def.
None, unk1x = None,
PlanetSideGeneratorState.Normal, //Generator state PlanetSideGeneratorState.Normal,
true, //Respawn tubes operating state spawn_tubes_normal = true,
false, //Force dome state force_dome_active = false,
0, //Lattice benefits lattice_benefit = 0,
0, //!! Field > 0 will cause malformed packet. See class def. cavern_benefit = 0, //!! Field > 0 will cause malformed packet. See class def.
Nil, unk4 = Nil,
0, unk5 = 0,
false, unk6 = false,
8, //!! Field != 8 will cause malformed packet. See class def. unk7 = 8, //!! Field != 8 will cause malformed packet. See class def.
None, unk7x = None,
false, //Boosted spawn room pain field boost_spawn_pain = false,
false //Boosted generator room pain field boost_generator_pain = false
) )
) )
sendResponse(DensityLevelUpdateMessage(continentNumber, buildingNumber, List(0,0, 0,0, 0,0, 0,0))) sendResponse(DensityLevelUpdateMessage(continentNumber, buildingNumber, List(0,0, 0,0, 0,0, 0,0)))
@ -4266,26 +4266,27 @@ class WorldSessionActor extends Actor with MDCContextAware {
def initGate(continentNumber : Int, buildingNumber : Int, building : Building) : Unit = { def initGate(continentNumber : Int, buildingNumber : Int, building : Building) : Unit = {
sendResponse( sendResponse(
BuildingInfoUpdateMessage( BuildingInfoUpdateMessage(
continentNumber, buildingNumber, continentNumber,
0, buildingNumber,
false, ntu_level = 0,
PlanetSideEmpire.NEUTRAL, is_hacked = false,
0, empire_hack = PlanetSideEmpire.NEUTRAL,
hack_time_remaining = 0,
building.Faction, building.Faction,
0, unk1 = 0,
None, unk1x = None,
PlanetSideGeneratorState.Normal, PlanetSideGeneratorState.Normal,
true, spawn_tubes_normal = true,
false, force_dome_active = false,
0, lattice_benefit = 0,
0, cavern_benefit = 0,
Nil, unk4 = Nil,
0, unk5 = 0,
false, unk6 = false,
8, unk7 = 8,
None, unk7x = None,
false, boost_spawn_pain = false,
false boost_generator_pain = false
) )
) )
sendResponse(DensityLevelUpdateMessage(continentNumber, buildingNumber, List(0,0, 0,0, 0,0, 0,0))) sendResponse(DensityLevelUpdateMessage(continentNumber, buildingNumber, List(0,0, 0,0, 0,0, 0,0)))