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

View file

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

View file

@ -19,9 +19,18 @@ class CorpseConverter extends AvatarConverter {
PlacementData(obj.Position, Vector3(0,0, obj.Orientation.z)),
MakeAppearanceData(obj),
DetailedCharacterData(
0, 0, 0, 0, 0, 0, 0,
Nil, Nil, Nil, Nil,
None
bep = 0,
cep = 0,
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)),
DrawnSlot.None
@ -37,20 +46,20 @@ class CorpseConverter extends AvatarConverter {
private def MakeAppearanceData(obj : Player) : (Int)=>CharacterAppearanceData = {
CharacterAppearanceData(
BasicCharacterData(obj.Name, obj.Faction, CharacterGender.Male, 0, CharacterVoice.Mute),
0,
false,
false,
voice2 = 0,
black_ops = false,
jammered = false,
obj.ExoSuit,
"",
0,
true,
obj.Orientation.y, //TODO is this important?
0,
true,
outfit_name = "",
outfit_logo = 0,
backpack = true,
facingPitch = obj.Orientation.y, //TODO is this important?
facingYawUpper = 0,
lfs = true,
GrenadeState.None,
false,
false,
false,
is_cloaking = false,
charging_pose = false,
on_zipline = false,
RibbonBars()
)
}

View file

@ -18,21 +18,22 @@ class VehicleConverter extends ObjectCreateConverter[Vehicle]() {
VehicleData(
PlacementData(obj.Position, obj.Orientation, obj.Velocity),
obj.Faction,
false, //bops
health < 3, //destroyed
0,
obj.Jammered, //jammered
false,
bops = false,
destroyed = health < 3,
unk1 = 0,
obj.Jammered,
unk2 = false,
obj.Owner match {
case Some(owner) => owner
case None => PlanetSideGUID(0)
},
false,
unk3 = false,
health,
false, false,
unk4 = false,
no_mount_points = false,
obj.DeploymentState,
false,
false,
unk5 = false,
unk6 = false,
obj.Cloaked,
SpecificFormatData(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.
* Packets that do not encode properly are simply excluded for the product.
* This is not treated as an error or exception; a warning will mrely be logged.
* Packets that do not encode properly are simply excluded from the product.
* 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 out updated series of byte stream data produced through successful packet encoding;
* defaults to an empty list

View file

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