update spykhanat (decode PropVisualA, PropVisualB & PropVisualC message)

This commit is contained in:
AleaJactaEst 2021-01-11 21:30:01 +01:00
parent d421615d20
commit 43e8becee1
7 changed files with 90 additions and 15 deletions

View file

@ -247,7 +247,7 @@ class SpyPcap():
logging.getLogger(LOGGER).debug("too small no decodeVisualProperties [{0} > {1}]".format(msgin.sizeRead() + (8*8 ), msgin.sizeData() * 8 ))
slot = msgin.readUint8("Slot")
property['slot'] = slot
hearder = 'VisualProperty/Slot'+str(slot) + '/'
hearder = 'VisualProperty/Slot_'+str(slot) + '/'
associationBits = msgin.readSerial(2, "associationBits")
notices.setdefault(hearder + 'associationBits', associationBits)
property['associationBits'] = associationBits

View file

@ -196,7 +196,7 @@ class CActionPosition(CAction):
self.add_notice('px', self.Position16[0] )
self.add_notice('py', self.Position16[1] )
self.add_notice('pz', self.Position16[2] )
self.add_notice('IsRelative', (self.Position16[2] & 0x1) != 0 )
self.add_notice('IsRelative', (self.Position16[2] & 0x1) != 0 )
self.add_notice('Interior', (self.Position16[2] & 0x2) != 0 )
# message.serialAndLog1( Position16[0] );
@ -480,12 +480,42 @@ class CActionSint64(CAction):
logging.getLogger(LOGGER).debug("msgin:%s" % msgin.showAllData())
# self.value = msgin.readSerial( self.NbBits, 'value')
self.value = msgin.readSerialUint64( self.NbBits, self.NameProperty)
self.add_notice(self.NameProperty, self.value)
# Decode Message
if self.PropertyIndex == TPropIndex.TPropIndex.PROPERTY_ORIENTATION:
v1 = struct.pack('I', self.value)
angle_radius = struct.unpack('<f',v1)[0]
angle_degree = angle_radius * 180 / math.pi
self.add_notice(self.NameProperty + '/radius', angle_radius)
elif self.PropertyIndex == TPropIndex.TPropIndex.PROPERTY_VPA:
vba = PropVisual.PropVisualA()
vba.set_compress_data(self.value)
ret = vba.get_notice()
if ret:
for key in ret:
self.add_notice(self.NameProperty + '/' + key, ret[key])
elif self.PropertyIndex == TPropIndex.TPropIndex.PROPERTY_VPB:
vbb= PropVisual.PropVisualB()
vbb.set_compress_data(self.value)
ret = vbb.get_notice()
if ret:
for key in ret:
self.add_notice(self.NameProperty + '/' + key, ret[key])
pass
elif self.PropertyIndex == TPropIndex.TPropIndex.PROPERTY_VPC:
vbc= PropVisual.PropVisualC()
vbc.set_compress_data(self.value)
ret = vbc.get_notice()
if ret:
for key in ret:
self.add_notice(self.NameProperty + '/' + key, ret[key])
pass
else:
self.add_notice(self.NameProperty, self.value)
logging.getLogger(LOGGER).debug("msgin:%s" % msgin.showAllData())
#self.NbBits = msgin.readUint32('NbBits')
logging.getLogger(LOGGER).debug("value:%u" % self.value)
logging.getLogger(LOGGER).debug("msgin:%s" % msgin.showAllData())
#logging.getLogger(LOGGER).debug("value:%u" % self.value)
#logging.getLogger(LOGGER).debug("msgin:%s" % msgin.showAllData())
def pack(self, msgout):
super().pack(msgout)
#msgout.pushUint64(self.value)

View file

@ -97,7 +97,7 @@ class CActionFactory:
action = self.create(slot, Enum.TActionCode.ACTION_POSITION_CODE)
else:
action =self. create(slot, Enum.TActionCode.ACTION_SINT64)
action.setNbBits(propIndex, nameproperty)
action.setNbBits(propIndex, 'Sint64/' + nameproperty)
action.PropertyCode = propIndex
return action

View file

@ -402,8 +402,8 @@ class DecodeDatabase():
self.databasePlr.show()
#raise "ok"
def execute(self, msgin, world):
def execute(self, msgin, world, parent='DatabaseXML/'):
logging.getLogger(LOGGER).debug("Start execute")
ret = self.databasePlr.execute(msgin)
ret = self.databasePlr.execute(msgin, parent)
logging.getLogger(LOGGER).debug("End execute")
return ret

View file

@ -400,7 +400,7 @@ class ImpulseNpcIconSetDesc(ImpulseBase):
self.data.pushUint32(state)
def readDatabases(self, world, decodeDatabase):
return decodeDatabase.execute(self.data, world)
return decodeDatabase.execute(self.data, world, 'MsgXML/NPC_ICON/SET_DESC/DatabaseXML')
class ImpulsePhraseDownload(ImpulseBase):
@ -728,7 +728,7 @@ class impulseDatabaseInitPlayer(ImpulseBase):
for i in range(0, propertyCount):
logging.getLogger(LOGGER).debug("read i:%d" % i)
logging.getLogger(LOGGER).debug("#" * 80)
state, data = databaseXml.execute(msgin, world)
state, data = databaseXml.execute(msgin, world, 'MsgXML/DB_INIT/PLR/DatabaseXML/')
if state:
# DecodeDatabase.print_dico(data)
self.append_notice(data)
@ -817,7 +817,7 @@ class impulseDbGroupInitBank(ImpulseBase):
logging.getLogger(LOGGER).debug("read %s" % id)
self.name = name.replace(':', '_')
_ = self.readUint32(msgin, '%s_serverTick' % id)
bank = self.readSerialEnum(msgin, Enum.TCDBBank.NB_BITS_FOR_CDBBANK, '%s_bank' % id, Enum.TCDBBank)
_ = self.readSerialEnum(msgin, Enum.TCDBBank.NB_BITS_FOR_CDBBANK, '%s_bank' % id, Enum.TCDBBank)
propertyCount = self.readUint16(msgin, '%s_propertyCount' % id)
for i in range(0, propertyCount):
raise "TODO"
@ -837,7 +837,7 @@ class impulseDatabaseUpdatePlayer(ImpulseBase):
_ = self.readUint32(msgin, '%s_serverTick' % id)
propertyCount = self.readUint16(msgin, '%s_propertyCount' % id)
for i in range(0, propertyCount):
state, data = databaseXml.execute(msgin, world)
state, data = databaseXml.execute(msgin, world, 'MsgXML/DB_UPD_PLR/DatabaseXML/')
if state:
DecodeDatabase.print_dico(data)
# for key, value in data:

View file

@ -91,6 +91,21 @@ class PropVisualA:
outyaml.write("{0} ArmColor: {1}\n".format(space, self.ArmColor))
outyaml.write("{0} HatModel: {1}\n".format(space, self.HatModel))
outyaml.write("{0} HatColor: {1}\n".format(space, self.HatColor))
def get_notice(self):
ret = { 'sex': self.Sex,
'JacketModel': self.JacketModel,
'JacketColor': self.JacketColor,
'TrouserModel': self.TrouserModel,
'TrouserColor': self.TrouserColor,
'WeaponRightHand': self.WeaponRightHand,
'WeaponLeftHand': self.WeaponLeftHand,
'ArmModel': self.ArmModel,
'ArmColor': self.ArmColor,
'HatModel': self.HatModel,
'HatColor': self.HatColor
}
return ret
# uint64 Name : 16;
# uint64 HandsModel : 9; // max: 512 current: 90
@ -100,6 +115,7 @@ class PropVisualA:
# uint64 RTrail : 4;
# uint64 LTrail : 3;
class PropVisualB:
# khanat-opennel-code/code/ryzom/common/src/game_share/player_visual_properties.h:105 struct SPropVisualB
def __init__(self):
@ -136,6 +152,17 @@ class PropVisualB:
outyaml.write("{0} RTrail: {1}\n".format(space, self.RTrail))
outyaml.write("{0} LTrail: {1}\n".format(space, self.LTrail))
def get_notice(self):
ret = { 'Name': self.Name,
'HandsModel': self.HandsModel,
'HandsColor': self.HandsColor,
'FeetModel': self.FeetModel,
'FeetColor': self.FeetColor,
'RTrail': self.RTrail,
'LTrail': self.LTrail
}
return ret
# uint64 MorphTarget1 : 3; // max: 8 current: 8
# uint64 MorphTarget2 : 3; // max: 8 current: 8
# uint64 MorphTarget3 : 3; // max: 8 current: 8
@ -151,7 +178,7 @@ class PropVisualB:
# uint64 ArmsWidth : 4; // max: 16 current: 16
# uint64 LegsWidth : 4; // max: 16 current: 16
# uint64 BreastSize : 4; // max: 16 current: 16
class PropVisualC:
# khanat-opennel-code/code/ryzom/common/src/game_share/player_visual_properties.h:163 struct SPropVisualC
def __init__(self):
@ -219,3 +246,22 @@ class PropVisualC:
outyaml.write("{0} ArmsWidth: {1}\n".format(space, self.ArmsWidth))
outyaml.write("{0} LegsWidth: {1}\n".format(space, self.LegsWidth))
outyaml.write("{0} BreastSize: {1}\n".format(space, self.BreastSize))
def get_notice(self):
ret = { 'MorphTarget1': self.MorphTarget1,
'MorphTarget2': self.MorphTarget2,
'MorphTarget3': self.MorphTarget3,
'MorphTarget4': self.MorphTarget4,
'MorphTarget5': self.MorphTarget5,
'MorphTarget6': self.MorphTarget6,
'MorphTarget7': self.MorphTarget7,
'MorphTarget8': self.MorphTarget8,
'EyesColor': self.EyesColor,
'Tattoo': self.Tattoo,
'CharacterHeight': self.CharacterHeight,
'TorsoWidth': self.TorsoWidth,
'ArmsWidth': self.ArmsWidth,
'LegsWidth': self.LegsWidth,
'BreastSize': self.BreastSize
}
return ret

View file

@ -58,7 +58,6 @@ class TVPNodeBase():
if nbLevels > 1:
self.VPA.makeDescendants( nbLevels-1 );
self.VPB.makeDescendants( nbLevels-1 );
def build_tree(self):
# khanat-opennel-code/code/ryzom/common/src/game_share/entity_types.h:458 uint buildTree()