Commit f66e4219 authored by aleajactaest's avatar aleajactaest

decode message STRING_MANAGER:RELOAD_CACHE

parent 08b3a6c1
......@@ -244,12 +244,19 @@ class BitStream():
tmp += x
_size -= 1
return tmp
def readArrayUint8(self, size):
ret = []
for i in range(0, size):
ret.append(self.readUint8())
return ret
def readBitStreamUint8(self, size):
ret = BitStream()
for i in range(0, size):
ret.pushUint8(self.readUint8())
return ret
# ------------------------------------
def __str__(self):
return ''.join([ chr(x) for x in self._tampon])
......@@ -280,6 +287,21 @@ class BitStream():
self._read = readBefore
return ret
def showAllData(self):
ret = ""
readBefore = self._read
self._read = 0
while self._read < self._pos:
if self._pos - self._read >= 8:
data = self.readUint8()
else:
data = self.readSerial(self._pos - self._read)
if ret != "":
ret += "."
ret += hex(data)
self._read = readBefore
return ret
def TestBitStream():
a = BitStream()
a.pushBool(True)
......@@ -1581,6 +1603,496 @@ class CPersistentDataRecord:
class CActionBlock:
def __init__(self):
self.Cycle = 0
self.FirstPacket = 0
self.Actions = None
self.Sucess = True
def getPowerOf2(v):
res=1;
ret=0;
while res<v:
ret += 1
res *= 2
return ret
class DecodeImpulse():
def __init__(self, log):
'''
khanat-opennel-code/code/ryzom/client/src/net_manager.cpp # void initializeNetwork()
'''
self.log = log
self.msgXml = None
self.databaseXml = None
self.GenericMsgHeaderMngr = {}
self.initializeNetwork()
def impulseDatabaseUpdatePlayer(self, msgin):
self.log.debug("TODO:%s" % msgin)
def impulseUpdateInventory(self, msgin):
self.log.debug("TODO")
def impulseInitInventory(self, msgin):
self.log.debug("TODO")
def impulseDatabaseUpdateBank(self, msgin):
self.log.debug("TODO")
def impulseDatabaseInitBank(self, msgin):
self.log.debug("TODO")
def impulseDatabaseResetBank(self, msgin):
self.log.debug("TODO")
def impulseNoUserChar(self, msgin):
self.log.debug("TODO")
def impulseUserChars(self, msgin):
self.log.debug("TODO")
def impulseUserChar(self, msgin):
self.log.debug("TODO")
def impulseFarTP(self, msgin):
self.log.debug("TODO")
def impulseServerReady(self, msgin):
self.log.debug("TODO")
def impulseCharNameValid(self, msgin):
self.log.debug("TODO")
def impulseShardId(self, msgin):
self.log.debug("TODO")
def impulseServerQuitOk(self, msgin):
self.log.debug("TODO")
def impulseServerQuitAbort(self, msgin):
self.log.debug("TODO")
def impulseMailNotification(self, msgin):
self.log.debug("TODO")
def impulseForumNotification(self, msgin):
self.log.debug("TODO")
def impulsePermanentBan(self, msgin):
self.log.debug("TODO")
def impulsePermanentUnban(self, msgin):
self.log.debug("TODO")
def impulseChat(self, msgin):
self.log.debug("TODO")
def impulseTell(self, msgin):
self.log.debug("TODO")
def impulseFarTell(self, msgin):
self.log.debug("TODO")
def impulseChat2(self, msgin):
self.log.debug("TODO")
def impulseDynString(self, msgin):
self.log.debug("TODO")
def inpulseDynStringInChatGroup(self, msgin):
self.log.debug("TODO")
def impulseTell2(self, msgin):
self.log.debug("TODO")
def impulseTP(self, msgin):
self.log.debug("TODO")
def impulseTPWithSeason(self, msgin):
self.log.debug("TODO")
def impulseCorrectPos(self, msgin):
self.log.debug("TODO")
def impulseCombatEngageFailed(self, msgin):
self.log.debug("TODO")
def impulseDynChatOpen(self, msgin):
self.log.debug("TODO")
def impulseDynChatClose(self, msgin):
self.log.debug("TODO")
def impulseBeginCast(self, msgin):
self.log.debug("TODO")
def impulseTeamInvitation(self, msgin):
self.log.debug("TODO")
def impulseTeamShareOpen(self, msgin):
self.log.debug("TODO")
def impulseTeamShareInvalid(self, msgin):
self.log.debug("TODO")
def impulseTeamShareClose(self, msgin):
self.log.debug("TODO")
def impulseTeamContactInit(self, msgin):
self.log.debug("TODO")
def impulseTeamContactCreate(self, msgin):
self.log.debug("TODO")
def impulseTeamContactStatus(self, msgin):
self.log.debug("TODO")
def impulseTeamContactRemove(self, msgin):
self.log.debug("TODO")
def impulseExchangeInvitation(self, msgin):
self.log.debug("TODO")
def impulseExchangeCloseInvitation(self, msgin):
self.log.debug("TODO")
def impulseMountAbort(self, msgin):
self.log.debug("TODO")
def impulseWhere(self, msgin):
self.log.debug("TODO")
def impulseCounter(self, msgin):
self.log.debug("TODO")
def impulsePhraseSend(self, msgin):
self.log.debug("TODO")
def impulseStringResp(self, msgin):
self.log.debug("TODO")
def impulseReloadCache(self, msgin):
timestamp = msgin.readUint32()
self.log.debug("Reload Cache timestamp:%d" % timestamp)
self.log.debug("Message not read (%d) %s" % (msgin.needRead(), msgin.showLastData() ))
def impulseBotChatForceEnd(self, msgin):
self.log.debug("TODO")
def impulseJournalInitCompletedMissions(self, msgin):
self.log.debug("TODO")
def impulseJournalUpdateCompletedMissions(self, msgin):
self.log.debug("TODO")
def impulseJournalAddCompass(self, msgin):
self.log.debug("TODO")
def impulseJournalRemoveCompass(self, msgin):
self.log.debug("TODO")
def impulseGuildJoinProposal(self, msgin):
self.log.debug("TODO")
def impulseGuildAscensor(self, msgin):
self.log.debug("TODO")
def impulseGuildLeaveAscensor(self, msgin):
self.log.debug("TODO")
def impulseGuildAbortCreation(self, msgin):
self.log.debug("TODO")
def impulseGuildOpenGuildWindow(self, msgin):
self.log.debug("TODO")
def impulseGuildOpenInventory(self, msgin):
self.log.debug("TODO")
def impulseGuildCloseInventory(self, msgin):
self.log.debug("TODO")
def impulseGuildUpdatePlayerTitle(self, msgin):
self.log.debug("TODO")
def impulseGuildUseFemaleTitles(self, msgin):
self.log.debug("TODO")
def impulseCloseTempInv(self, msgin):
self.log.debug("TODO")
def impulseRemoteAdmin(self, msgin):
self.log.debug("TODO")
def impulsePhraseDownLoad(self, msgin):
self.log.debug("TODO")
def impulsePhraseConfirmBuy(self, msgin):
self.log.debug("TODO")
def impulsePhraseAckExecuteCyclic(self, msgin):
self.log.debug("TODO")
def impulsePhraseAckExecuteNext(self, msgin):
self.log.debug("TODO")
def impulseItemInfoSet(self, msgin):
self.log.debug("TODO")
def impulseItemInfoRefreshVersion(self, msgin):
self.log.debug("TODO")
def impulsePrereqInfoSet(self, msgin):
self.log.debug("TODO")
def impulseItemOpenRoomInventory(self, msgin):
self.log.debug("TODO")
def impulseItemCloseRoomInventory(self, msgin):
self.log.debug("TODO")
def impulseDeathRespawnPoint(self, msgin):
self.log.debug("TODO")
def impulseDeathRespawn(self, msgin):
self.log.debug("TODO")
def impulseDuelInvitation(self, msgin):
self.log.debug("TODO")
def impulseDuelCancelInvitation(self, msgin):
self.log.debug("TODO")
def impulsePVPChallengeInvitation(self, msgin):
self.log.debug("TODO")
def impulsePVPChallengeCancelInvitation(self, msgin):
self.log.debug("TODO")
def impulsePVPFactionPushFactionWar(self, msgin):
self.log.debug("TODO")
def impulsePVPFactionPopFactionWar(self, msgin):
self.log.debug("TODO")
def impulsePVPFactionFactionWars(self, msgin):
self.log.debug("TODO")
def impulseEncyclopediaUpdate(self, msgin):
self.log.debug("TODO")
def impulseEncyclopediaInit(self, msgin):
self.log.debug("TODO")
def impulseUserBars(self, msgin):
self.log.debug("TODO")
def impulseUserPopup(self, msgin):
self.log.debug("TODO")
def impulseEnterCrZoneProposal(self, msgin):
self.log.debug("TODO")
def impulseCloseEnterCrZoneProposal(self, msgin):
self.log.debug("TODO")
def cbImpulsionGatewayOpen(self, msgin):
self.log.debug("TODO")
def cbImpulsionGatewayMessage (self, msgin):
self.log.debug("TODO")
def cbImpulsionGatewayClose (self, msgin):
self.log.debug("TODO")
def impulseOutpostChooseSide (self, msgin):
self.log.debug("TODO")
def impulseOutpostDeclareWarAck (self, msgin):
self.log.debug("TODO")
def impulseCombatFlyingChaScore1Delta (self, msgin):
self.log.debug("TODO")
def impulseCombatFlyingTextItemSpecialEffectProc (self, msgin):
self.log.debug("TODO")
def impulseCombatFlyingText (self, msgin):
self.log.debug("TODO")
def impulseSetSeason (self, msgin):
self.log.debug("TODO")
def impulseDssDown (self, msgin):
self.log.debug("TODO")
def impulseSetNpcIconDesc (self, msgin):
self.log.debug("TODO")
def impulseServerEventForMissionAvailability (self, msgin):
self.log.debug("TODO")
def impulseSetNpcIconTimer (self, msgin):
self.log.debug("TODO")
def impulseDatabaseInitPlayer(self, msgin):
self.log.debug("TODO")
def initializeNetwork(self):
self.GenericMsgHeaderMngr.setdefault('DB_UPD_PLR', self.impulseDatabaseUpdatePlayer)
self.GenericMsgHeaderMngr.setdefault('DB_INIT:PLR', self.impulseDatabaseInitPlayer)
self.GenericMsgHeaderMngr.setdefault("DB_UPD_INV", self.impulseUpdateInventory)
self.GenericMsgHeaderMngr.setdefault("DB_INIT:INV", self.impulseInitInventory)
self.GenericMsgHeaderMngr.setdefault("DB_GROUP:UPDATE_BANK", self.impulseDatabaseUpdateBank)
self.GenericMsgHeaderMngr.setdefault("DB_GROUP:INIT_BANK", self.impulseDatabaseInitBank)
self.GenericMsgHeaderMngr.setdefault("DB_GROUP:RESET_BANK", self.impulseDatabaseResetBank)
self.GenericMsgHeaderMngr.setdefault("CONNECTION:NO_USER_CHAR", self.impulseNoUserChar)
self.GenericMsgHeaderMngr.setdefault("CONNECTION:USER_CHARS", self.impulseUserChars)
self.GenericMsgHeaderMngr.setdefault("CONNECTION:USER_CHAR", self.impulseUserChar)
self.GenericMsgHeaderMngr.setdefault("CONNECTION:FAR_TP", self.impulseFarTP)
self.GenericMsgHeaderMngr.setdefault("CONNECTION:READY", self.impulseServerReady)
self.GenericMsgHeaderMngr.setdefault("CONNECTION:VALID_NAME", self.impulseCharNameValid)
self.GenericMsgHeaderMngr.setdefault("CONNECTION:SHARD_ID", self.impulseShardId)
self.GenericMsgHeaderMngr.setdefault("CONNECTION:SERVER_QUIT_OK", self.impulseServerQuitOk)
self.GenericMsgHeaderMngr.setdefault("CONNECTION:SERVER_QUIT_ABORT", self.impulseServerQuitAbort)
self.GenericMsgHeaderMngr.setdefault("CONNECTION:MAIL_AVAILABLE", self.impulseMailNotification)
self.GenericMsgHeaderMngr.setdefault("CONNECTION:GUILD_MESSAGE_AVAILABLE", self.impulseForumNotification)
self.GenericMsgHeaderMngr.setdefault("CONNECTION:PERMANENT_BAN", self.impulsePermanentBan)
self.GenericMsgHeaderMngr.setdefault("CONNECTION:UNBAN", self.impulsePermanentUnban)
self.GenericMsgHeaderMngr.setdefault("STRING:CHAT", self.impulseChat)
self.GenericMsgHeaderMngr.setdefault("STRING:TELL", self.impulseTell)
self.GenericMsgHeaderMngr.setdefault("STRING:FAR_TELL", self.impulseFarTell)
self.GenericMsgHeaderMngr.setdefault("STRING:CHAT2", self.impulseChat2)
self.GenericMsgHeaderMngr.setdefault("STRING:DYN_STRING", self.impulseDynString)
self.GenericMsgHeaderMngr.setdefault("STRING:DYN_STRING_GROUP", self.inpulseDynStringInChatGroup)
self.GenericMsgHeaderMngr.setdefault("STRING:TELL2", self.impulseTell2)
self.GenericMsgHeaderMngr.setdefault("TP:DEST", self.impulseTP)
self.GenericMsgHeaderMngr.setdefault("TP:DEST_WITH_SEASON", self.impulseTPWithSeason)
self.GenericMsgHeaderMngr.setdefault("TP:CORRECT", self.impulseCorrectPos)
self.GenericMsgHeaderMngr.setdefault("COMBAT:ENGAGE_FAILED", self.impulseCombatEngageFailed)
self.GenericMsgHeaderMngr.setdefault("BOTCHAT:DYNCHAT_OPEN", self.impulseDynChatOpen)
self.GenericMsgHeaderMngr.setdefault("BOTCHAT:DYNCHAT_CLOSE", self.impulseDynChatClose)
self.GenericMsgHeaderMngr.setdefault("CASTING:BEGIN", self.impulseBeginCast)
self.GenericMsgHeaderMngr.setdefault("TEAM:INVITATION", self.impulseTeamInvitation)
self.GenericMsgHeaderMngr.setdefault("TEAM:SHARE_OPEN", self.impulseTeamShareOpen)
self.GenericMsgHeaderMngr.setdefault("TEAM:SHARE_INVALID", self.impulseTeamShareInvalid)
self.GenericMsgHeaderMngr.setdefault("TEAM:SHARE_CLOSE", self.impulseTeamShareClose)
self.GenericMsgHeaderMngr.setdefault("TEAM:CONTACT_INIT", self.impulseTeamContactInit)
self.GenericMsgHeaderMngr.setdefault("TEAM:CONTACT_CREATE", self.impulseTeamContactCreate)
self.GenericMsgHeaderMngr.setdefault("TEAM:CONTACT_STATUS", self.impulseTeamContactStatus)
self.GenericMsgHeaderMngr.setdefault("TEAM:CONTACT_REMOVE", self.impulseTeamContactRemove)
self.GenericMsgHeaderMngr.setdefault("EXCHANGE:INVITATION", self.impulseExchangeInvitation)
self.GenericMsgHeaderMngr.setdefault("EXCHANGE:CLOSE_INVITATION", self.impulseExchangeCloseInvitation)
self.GenericMsgHeaderMngr.setdefault("ANIMALS:MOUNT_ABORT", self.impulseMountAbort)
self.GenericMsgHeaderMngr.setdefault("DEBUG:REPLY_WHERE", self.impulseWhere)
self.GenericMsgHeaderMngr.setdefault("DEBUG:COUNTER", self.impulseCounter)
self.GenericMsgHeaderMngr.setdefault("STRING_MANAGER:PHRASE_SEND", self.impulsePhraseSend)
self.GenericMsgHeaderMngr.setdefault("STRING_MANAGER:STRING_RESP", self.impulseStringResp)
self.GenericMsgHeaderMngr.setdefault("STRING_MANAGER:RELOAD_CACHE", self.impulseReloadCache)
self.GenericMsgHeaderMngr.setdefault("BOTCHAT:FORCE_END", self.impulseBotChatForceEnd)
self.GenericMsgHeaderMngr.setdefault("JOURNAL:INIT_COMPLETED_MISSIONS", self.impulseJournalInitCompletedMissions)
self.GenericMsgHeaderMngr.setdefault("JOURNAL:UPDATE_COMPLETED_MISSIONS", self.impulseJournalUpdateCompletedMissions)
self.GenericMsgHeaderMngr.setdefault("JOURNAL:ADD_COMPASS", self.impulseJournalAddCompass)
self.GenericMsgHeaderMngr.setdefault("JOURNAL:REMOVE_COMPASS", self.impulseJournalRemoveCompass)
self.GenericMsgHeaderMngr.setdefault("GUILD:JOIN_PROPOSAL", self.impulseGuildJoinProposal)
self.GenericMsgHeaderMngr.setdefault("GUILD:ASCENSOR", self.impulseGuildAscensor)
self.GenericMsgHeaderMngr.setdefault("GUILD:LEAVE_ASCENSOR", self.impulseGuildLeaveAscensor)
self.GenericMsgHeaderMngr.setdefault("GUILD:ABORT_CREATION", self.impulseGuildAbortCreation)
self.GenericMsgHeaderMngr.setdefault("GUILD:OPEN_GUILD_WINDOW", self.impulseGuildOpenGuildWindow)
self.GenericMsgHeaderMngr.setdefault("GUILD:OPEN_INVENTORY", self.impulseGuildOpenInventory)
self.GenericMsgHeaderMngr.setdefault("GUILD:CLOSE_INVENTORY", self.impulseGuildCloseInventory)
self.GenericMsgHeaderMngr.setdefault("GUILD:UPDATE_PLAYER_TITLE", self.impulseGuildUpdatePlayerTitle)
self.GenericMsgHeaderMngr.setdefault("GUILD:USE_FEMALE_TITLES", self.impulseGuildUseFemaleTitles)
self.GenericMsgHeaderMngr.setdefault("HARVEST:CLOSE_TEMP_INVENTORY", self.impulseCloseTempInv)
self.GenericMsgHeaderMngr.setdefault("COMMAND:REMOTE_ADMIN", self.impulseRemoteAdmin)
self.GenericMsgHeaderMngr.setdefault("PHRASE:DOWNLOAD", self.impulsePhraseDownLoad)
self.GenericMsgHeaderMngr.setdefault("PHRASE:CONFIRM_BUY", self.impulsePhraseConfirmBuy)
self.GenericMsgHeaderMngr.setdefault("PHRASE:EXEC_CYCLIC_ACK", self.impulsePhraseAckExecuteCyclic)
self.GenericMsgHeaderMngr.setdefault("PHRASE:EXEC_NEXT_ACK", self.impulsePhraseAckExecuteNext)
self.GenericMsgHeaderMngr.setdefault("ITEM_INFO:SET", self.impulseItemInfoSet)
self.GenericMsgHeaderMngr.setdefault("ITEM_INFO:REFRESH_VERSION", self.impulseItemInfoRefreshVersion)
self.GenericMsgHeaderMngr.setdefault("MISSION_PREREQ:SET", self.impulsePrereqInfoSet)
self.GenericMsgHeaderMngr.setdefault("ITEM:OPEN_ROOM_INVENTORY", self.impulseItemOpenRoomInventory)
self.GenericMsgHeaderMngr.setdefault("ITEM:CLOSE_ROOM_INVENTORY", self.impulseItemCloseRoomInventory)
self.GenericMsgHeaderMngr.setdefault("DEATH:RESPAWN_POINT", self.impulseDeathRespawnPoint)
self.GenericMsgHeaderMngr.setdefault("DEATH:RESPAWN", self.impulseDeathRespawn)
self.GenericMsgHeaderMngr.setdefault("DUEL:INVITATION", self.impulseDuelInvitation)
self.GenericMsgHeaderMngr.setdefault("DUEL:CANCEL_INVITATION", self.impulseDuelCancelInvitation)
self.GenericMsgHeaderMngr.setdefault("PVP_CHALLENGE:INVITATION", self.impulsePVPChallengeInvitation)
self.GenericMsgHeaderMngr.setdefault("PVP_CHALLENGE:CANCEL_INVITATION", self.impulsePVPChallengeCancelInvitation)
self.GenericMsgHeaderMngr.setdefault("PVP_FACTION:PUSH_FACTION_WAR", self.impulsePVPFactionPushFactionWar)
self.GenericMsgHeaderMngr.setdefault("PVP_FACTION:POP_FACTION_WAR", self.impulsePVPFactionPopFactionWar)
self.GenericMsgHeaderMngr.setdefault("PVP_FACTION:FACTION_WARS", self.impulsePVPFactionFactionWars)
self.GenericMsgHeaderMngr.setdefault("ENCYCLOPEDIA:UPDATE", self.impulseEncyclopediaUpdate)
self.GenericMsgHeaderMngr.setdefault("ENCYCLOPEDIA:INIT", self.impulseEncyclopediaInit)
self.GenericMsgHeaderMngr.setdefault("USER:BARS", self.impulseUserBars)
self.GenericMsgHeaderMngr.setdefault("USER:POPUP", self.impulseUserPopup)
self.GenericMsgHeaderMngr.setdefault("MISSION:ASK_ENTER_CRITICAL", self.impulseEnterCrZoneProposal)
self.GenericMsgHeaderMngr.setdefault("MISSION:CLOSE_ENTER_CRITICAL", self.impulseCloseEnterCrZoneProposal)
self.GenericMsgHeaderMngr.setdefault( "MODULE_GATEWAY:FEOPEN", self.cbImpulsionGatewayOpen)
self.GenericMsgHeaderMngr.setdefault( "MODULE_GATEWAY:GATEWAY_MSG", self.cbImpulsionGatewayMessage )
self.GenericMsgHeaderMngr.setdefault( "MODULE_GATEWAY:FECLOSE", self.cbImpulsionGatewayClose )
self.GenericMsgHeaderMngr.setdefault( "OUTPOST:CHOOSE_SIDE", self.impulseOutpostChooseSide )
self.GenericMsgHeaderMngr.setdefault( "OUTPOST:DECLARE_WAR_ACK", self.impulseOutpostDeclareWarAck )
self.GenericMsgHeaderMngr.setdefault( "COMBAT:FLYING_ChaScore1_DELTA", self.impulseCombatFlyingChaScore1Delta )
self.GenericMsgHeaderMngr.setdefault( "COMBAT:FLYING_TEXT_ISE", self.impulseCombatFlyingTextItemSpecialEffectProc )
self.GenericMsgHeaderMngr.setdefault( "COMBAT:FLYING_TEXT", self.impulseCombatFlyingText )
self.GenericMsgHeaderMngr.setdefault( "SEASON:SET", self.impulseSetSeason )
self.GenericMsgHeaderMngr.setdefault( "RING_MISSION:DSS_DOWN", self.impulseDssDown )
self.GenericMsgHeaderMngr.setdefault( "NPC_ICON:SET_DESC", self.impulseSetNpcIconDesc )
self.GenericMsgHeaderMngr.setdefault( "NPC_ICON:SVR_EVENT_MIS_AVL", self.impulseServerEventForMissionAvailability )
self.GenericMsgHeaderMngr.setdefault( "NPC_ICON:SET_TIMER", self.impulseSetNpcIconTimer )
def sizeElement(self, keys = None):
head = self.msgXml
if not keys:
return len(head)
ret = len(head)
for key in keys.split(':'):
for ele in head:
if ele.attrib['name'] == key:
head = ele
ret = len(head)
break
return ret
def searchElement(self, keys):
ret = []
head = self.msgXml
self.log.debug(len(head))
for key in keys.split(':'):
#print(key)
id = 0
for ele in head:
if ele.attrib['name'] == key:
self.log.debug('%s => %d' % (key, id))
ret.append(id)
head = ele
break
id += 1
return ret
def execute(self, msgin):
head = self.msgXml
listpath = []
while True:
nbBit = getPowerOf2(len(head))
#self.log.debug('nbBit:%d' % nbBit)
id = msgin.readSerial(nbBit)
#self.log.debug('id:%s' % str(id))
ele = head[id]
name = ele.attrib['name']
#self.log.debug(name)
listpath.append(name)
fullname = ':'.join(listpath)
if fullname in self.GenericMsgHeaderMngr:
self.log.debug("Found : %s" % fullname)
self.GenericMsgHeaderMngr[fullname](msgin)
return True
else:
#self.log.debug("Non trouve")
for ele in head:
if ele.attrib['name'] == name:
head = ele
break
if head != ele:
self.log.error("Impossible to found %s" % fullname )
return False
return False
def loadMsg(self, msgXml):
self.msgXml = msgXml
# print('-'*80)
# print(self.msgXml)
# print(dir(self.msgXml))
# print('-'*80)
# print(self.sizeElement())
# print(self.sizeElement('STRING'))
# print('-'*20)
# print(self.searchElement("DB_UPD_PLR"))
# print(self.searchElement("STRING:TELL"))
# print('-'*80)
# self.GenericMsgHeaderMngr['DB_UPD_PLR']('test')
# print('-'*80)
def loadDatabase(self, databaseXml):
self.databaseXml = databaseXml
class CAction:
def __init__(self, slot=INVALID_SLOT, code=0):
self.Code = code
......@@ -1633,30 +2145,51 @@ class CActionPosition(CAction):
def __init__(self, slot, code):
super().__init__(slot, code)
def __str__(self):
return "CActionPosition" + super().__str__()
class CActionSync(CAction):
def __init__(self, slot, code):
super().__init__(slot, code)
def __str__(self):
return "CActionSync" + super().__str__()
class CActionDisconnection(CAction):
def __init__(self, slot, code):
super().__init__(slot, code)
def __str__(self):
return "CActionDisconnection" + super().__str__()
class CActionAssociation(CAction):
def __init__(self, slot, code):
super().__init__(slot, code)
def __str__(self):
return "CActionAssociation" + super().__str__()
class CActionDummy(CAction):
def __init__(self, slot, code):
super().__init__(slot, code)
def __str__(self):
return "CActionDummy" + super().__str__()
class CActionLogin(CAction):
def __init__(self, slot, code):
super().__init__(slot, code)
def __str__(self):
return "CActionLogin" + super().__str__()
class CActionTargetSlot(CAction):
def __init__(self, slot, code):
super().__init__(slot, code)
def __str__(self):
return "CActionTargetSlot" + super().__str__()
class CActionGeneric(CAction):
def __init__(self, slot, code):
super().__init__(slot, code)
......@@ -1664,9 +2197,21 @@ class CActionGeneric(CAction):
def unpack(self, message):
size = message.readUint32()
self._Message = message.readArrayUint8(size)
self._Message = message.readBitStreamUint8(size)
def reset(self):
self._Message = None
def genericAction(self, decodeImpulse):
decodeImpulse.execute(self._Message)
def __str__(self):
return "CActionGeneric" + super().__str__() + "[" + self._Message.showAllData() + ']'
class CActionGenericMultiPart(CAction):
'''
khanat-opennel-code/code/ryzom/common/src/game_share/action_generic_multi_part.h # class CActionGenericMultiPart
'''
def __init__(self, slot, code):
super().__init__(slot, code)
self.PartCont = []
......@@ -1680,47 +2225,105 @@ class CActionGenericMultiPart(CAction):
self.NbBlock = message.readUint16()
size = message.readUint32()
self.PartCont = message.readArrayUint8(size)
self.PartCont = message.readBitStreamUint8(size)
def reset(self):
self.PartCont = []
self.Number = 0
self.Part = 0
self.NbBlock = 0
def genericAction(self, decodeImpulse):
'''
khanat-opennel-code/code/ryzom/client/src/network_connection.cpp # void CNetworkConnection::genericAction (CActionGenericMultiPart *agmp)
'''
self.log = logging.getLogger('myLogger')