mirror of
https://port.numenaute.org/aleajactaest/clientbot.git
synced 2024-12-18 15:38:43 +00:00
update spkykhanat
This commit is contained in:
parent
4c2bfcdf2e
commit
065b290753
4 changed files with 31 additions and 5 deletions
10
spykhanat.py
10
spykhanat.py
|
@ -246,6 +246,11 @@ class SpyPcap():
|
|||
pass
|
||||
except BitStream.OverflowError:
|
||||
noerror = False
|
||||
except RuntimeError:
|
||||
noerror = False
|
||||
except TypeError as e:
|
||||
logging.getLogger(LOGGER).debug("[Client -> Server] Impossible to decode %s (not read:%u, msg:%s)" % (e.__class__, msgin.needRead(), msgin.showAllData()))
|
||||
#raise e
|
||||
except Exception as e:
|
||||
logging.getLogger(LOGGER).debug("[Client -> Server] end %s (not read:%u)" % (e.__class__, msgin.needRead()))
|
||||
raise e
|
||||
|
@ -262,6 +267,11 @@ class SpyPcap():
|
|||
) #, Reference = Parent, Name = "%s_%d" % (target, 0))
|
||||
if impulse:
|
||||
impulses.append(impulse)
|
||||
except BitStream.OverflowError as e:
|
||||
logging.getLogger(LOGGER).debug("[Client -> Server] error:%s : %s"% (e.__class__, msgin.showAllData()))
|
||||
except AttributeError as e:
|
||||
logging.getLogger(LOGGER).debug("[Client -> Server] error:%s : %s"% (e.__class__, msgin.showAllData()))
|
||||
#raise "Bad message"
|
||||
except Impulse.ImpulseNoElement:
|
||||
pass
|
||||
ids += 1
|
||||
|
|
|
@ -332,6 +332,7 @@ class CActionGenericMultiPart(CAction):
|
|||
msgout.pushUint8(self.Number)
|
||||
msgout.pushUint16(self.Part)
|
||||
msgout.pushUint16(self.NbBlock)
|
||||
raise "Missing size param"
|
||||
msgout.pushArrayUint8(self.PartCont)
|
||||
|
||||
def reset(self):
|
||||
|
@ -340,7 +341,7 @@ class CActionGenericMultiPart(CAction):
|
|||
self.Part = 0
|
||||
self.NbBlock = 0
|
||||
|
||||
def genericAction(self, decodeImpulse, world, cGenericMultiPartTemp, Reference, Name):
|
||||
def genericAction(self, decodeImpulse, world, cGenericMultiPartTemp, Reference = None, Name = None):
|
||||
'''
|
||||
khanat-opennel-code/code/ryzom/client/src/network_connection.cpp # void CNetworkConnection::genericAction (CActionGenericMultiPart *agmp)
|
||||
'''
|
||||
|
|
|
@ -96,11 +96,11 @@ class CActionFactory:
|
|||
khanat-opennel-code/code/ryzom/common/src/game_share/action_factory.cpp : CAction *CActionFactory::unpack (NLMISC::CBitMemStream &message, NLMISC::TGameCycle /* currentCycle */ )
|
||||
'''
|
||||
if msgin.needRead() >= 8:
|
||||
shortcode = msgin.readBool('shortcode')
|
||||
shortcode = msgin.readBool('CActionFactory:shortcode')
|
||||
if shortcode:
|
||||
code = msgin.readSerial(2, 'code')
|
||||
code = msgin.readSerial(2, 'CActionFactory:code')
|
||||
else:
|
||||
code = msgin.readUint8('code')
|
||||
code = msgin.readUint8('CActionFactory:code')
|
||||
logging.getLogger(LOGGER).debug("[decoded] %s" % msgin.showAllData())
|
||||
action = self.create(CAction.INVALID_SLOT, code)
|
||||
if action:
|
||||
|
@ -117,6 +117,8 @@ class CActionFactory:
|
|||
action.add_reference(Reference)
|
||||
if Name:
|
||||
action.set_name(Name)
|
||||
else:
|
||||
raise RuntimeError
|
||||
return action
|
||||
|
||||
|
||||
|
|
|
@ -639,6 +639,18 @@ class impulseDatabaseInitPlayer(ImpulseBase):
|
|||
propertyCount = self.readUint32(msgin, '%s_propertyCount' % id)
|
||||
|
||||
|
||||
class ImpulseConnectionDeleteChar(ImpulseBase):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
def read(self, name, msgin, world):
|
||||
# khanat-opennel-code/code/ryzom/client/src/net_manager.cpp void impulseDatabaseInitPlayer(NLMISC::CBitMemStream &impulse)
|
||||
# khanat-opennel-code/code/ryzom/server/src/simulation_service/simulated_editor.cpp void impulseDatabaseInitPlayer(NLMISC::CBitMemStream &impulse)
|
||||
id = "ConnectionDeleteChar"
|
||||
logging.getLogger(LOGGER).debug("read")
|
||||
self.name = name.replace(':', '_')
|
||||
self.readUint8(msgin, '%s_slot' % id)
|
||||
|
||||
class DecodeImpulseSimple:
|
||||
def __init__(self):
|
||||
'''
|
||||
|
@ -654,6 +666,7 @@ class DecodeImpulseSimple:
|
|||
self.GenericMsgHeaderMngr.setdefault( "BOTCHAT:SET_FILTERS", ImpulseBotchatSetFilters )
|
||||
self.GenericMsgHeaderMngr.setdefault( "CONNECTION:ASK_NAME", ImpulseConnectionAskName )
|
||||
self.GenericMsgHeaderMngr.setdefault( "CONNECTION:CREATE_CHAR", ImpulseConnectionCreateChar )
|
||||
self.GenericMsgHeaderMngr.setdefault( "CONNECTION:DELETE_CHAR", ImpulseConnectionDeleteChar )
|
||||
self.GenericMsgHeaderMngr.setdefault( "CONNECTION:READY", ImpulseConnectionReady )
|
||||
self.GenericMsgHeaderMngr.setdefault( "CONNECTION:SELECT_CHAR", ImpulseConnectionSelectChar )
|
||||
self.GenericMsgHeaderMngr.setdefault( "CONNECTION:SHARD_ID", ImpulseConnectionShardId )
|
||||
|
@ -674,7 +687,7 @@ class DecodeImpulseSimple:
|
|||
self.GenericMsgHeaderMngr.setdefault( "STRING_MANAGER:STRING_RQ", ImpulseSringManagerStringRq )
|
||||
self.GenericMsgHeaderMngr.setdefault( "ENCYCLOPEDIA:INIT", impulseEncyclopediaInit )
|
||||
self.GenericMsgHeaderMngr.setdefault( "DB_INIT:INV", impulseInitInventory)
|
||||
# self.GenericMsgHeaderMngr.setdefault( "DB_INIT:PLR", impulseDatabaseInitPlayer)
|
||||
self.GenericMsgHeaderMngr.setdefault( "DB_INIT:PLR", impulseDatabaseInitPlayer)
|
||||
|
||||
def execute(self, msgin, world, references = [], name=""):
|
||||
'''
|
||||
|
|
Loading…
Reference in a new issue