Commit 4474fed1 authored by aleajactaest's avatar aleajactaest

update output on spykhanat, adding visual property

parent 2ae6bc93
This diff is collapsed.
......@@ -184,7 +184,7 @@ class CActionPosition(CAction):
ret.setdefault("Position", ', '.join([str(x) for x in self.Position]))
ret.setdefault("Position16", ', '.join([str(x) for x in self.Position16]))
ret.setdefault("IsRelative", str(self.IsRelative))
ret.setdefault("IsRelative", str(self.IsRelative))
ret.setdefault("Interior", str(self.Interior))
return ret
def unpack(self, message):
......@@ -196,8 +196,8 @@ 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 )
self.add_notice('Interior', self.Position16[2] & 0x2 )
self.add_notice('IsRelative', (self.Position16[2] & 0x1) != 0 )
self.add_notice('Interior', (self.Position16[2] & 0x2) != 0 )
# message.serialAndLog1( Position16[0] );
# message.serialAndLog1( Position16[1] );
......@@ -465,6 +465,7 @@ class CActionSint64(CAction):
TPropIndex.TPropIndex.PROPERTY_PVP_CLAN: 32 ,
TPropIndex.TPropIndex.PROPERTY_OWNER_PEOPLE: 3 , # 4 races and unknow
TPropIndex.TPropIndex.PROPERTY_OUTPOST_INFOS: 16 } # 15+1
self.set_header_notice("Action/Sint64")
def get_parameter(self):
ret = super().get_parameter()
......@@ -479,6 +480,7 @@ 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)
logging.getLogger(LOGGER).debug("msgin:%s" % msgin.showAllData())
#self.NbBits = msgin.readUint32('NbBits')
logging.getLogger(LOGGER).debug("value:%u" % self.value)
......
......@@ -193,6 +193,7 @@ class TVPNodeBase():
def decodeDiscreetProperty(self, msgin, propIndex, slot, world):
# khanat-opennel-code/code/ryzom/client/src/network_connection.cpp:1746 void CNetworkConnection::decodeDiscreetProperty
logging.getLogger(LOGGER).debug("decodeDiscreetProperty")
notices = {}
action = None
if propIndex == Enum.TPropIndex.PROPERTY_TARGET_LIST:
logging.getLogger(LOGGER).debug("PROPERTY_TARGET_LIST")
......@@ -204,10 +205,11 @@ class TVPNodeBase():
d1 = msgin.readUint8( "TargetSlots_{0}".format(i));
logging.getLogger(LOGGER).debug("data:{0}".format(d1))
# Update property
return []
return [], notices
logging.getLogger(LOGGER).debug("CActionFactory : {0}".format(slot))
action = CActionFactory.CActionFactory(world).createByPropIndex(slot, self.PropIndex, self.NameProperty)
action.set_header_notice("-")
logging.getLogger(LOGGER).debug("unpack: {0}".format(slot))
action.unpack(msgin)
if self.PropIndex == Enum.TPropIndex.PROPERTY_SHEET:
......@@ -221,7 +223,9 @@ class TVPNodeBase():
else:
pass
logging.getLogger(LOGGER).debug("[decodeDiscreetProperty] (%s)" % (msgin.showAllData()))
return action
for key in action.notice:
notices.setdefault(key[2:], action.notice[key])
return action, notices
def decodeDiscreetProperties(self, clientid, msgin, slot, world):
......@@ -229,23 +233,30 @@ class TVPNodeBase():
logging.getLogger(LOGGER).debug("decodeDiscreetProperties " + self.Name)
self.BranchHasPayload = msgin.readBool("BranchHasPayload [{0}, NameProperty:{1}]".format(self.Name, self.NameProperty))
actions = []
notices = {}
if self.BranchHasPayload:
if self.isLeaf():
# SlotContext.NetworkConnection->decodeDiscreetProperty( msgin, PropIndex );
logging.getLogger(LOGGER).debug("isLeaf")
action = self.decodeDiscreetProperty(msgin, self.PropIndex, slot, world)
action, addnotices = self.decodeDiscreetProperty(msgin, self.PropIndex, slot, world)
for key in addnotices:
notices.setdefault(key, addnotices[key])
if action:
actions.append(action)
else:
if self.VPA:
tmp = self.VPA.decodeDiscreetProperties(clientid, msgin, slot, world)
tmp, addnotices = self.VPA.decodeDiscreetProperties(clientid, msgin, slot, world)
for key in addnotices:
notices.setdefault(key, addnotices[key])
for action in tmp:
actions.append(action)
if self.VPB:
tmp = self.VPB.decodeDiscreetProperties(clientid, msgin, slot, world)
tmp, addnotices = self.VPB.decodeDiscreetProperties(clientid, msgin, slot, world)
for key in addnotices:
notices.setdefault(key, addnotices[key])
for action in tmp:
actions.append(action)
return actions
return actions, notices
def decodeDiscreetPropertiesVpbVpb(self, clientid, msgin, slot, world):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment