turicfr / CPPS-PCL

A Penguin Client Library for Club Penguin Private Servers written in Python
42 stars 12 forks source link

ValueError that causes error in all other Client actions #32

Open fm1randa opened 4 years ago

fm1randa commented 4 years ago

I've already noticed that it happens both at the beginning, after logging in, and after a while during the runtime, during the add item script execution, for example. An error example in the beginning (CPBrasil):

Connecting to login server at 188.165.206.119:9700...
Logging in...
Sending verChk request...
# Send: <msg t="sys"><body action="verChk" r="0"><ver v="153" /></body></msg>
# Receive: <msg t='sys'><body action='apiOK' r='0'></body></msg>
Received apiOK response
Sending rndK request...
# Send: <msg t="sys"><body action="rndK" r="-1"></body></msg>
# Receive: <msg t='sys'><body action='rndK' r='-1'><k>e4a2dbcca10a7246817a83cd</k></body></msg>
Received rndK response: e4a2dbcca10a7246817a83cd
# Send: <msg t="sys"><body action="login" r="0"><login z="w1"><nick><![CDATA[bot14092001]]></nick><pword><![CDATA[4fe3af99955627da0c7de79807d5442f]]></pword></login></body></msg>
# Receive: %xt%gbs%-1%bc|5%na|true%fe|true%%
# Receive: %xt%gbl%-1%319854|{f9683601-ee0f-4560-a4d4-602145e279f4}|k1ra|offline%202425|{3328796a-2b4f-4c36-8f25-2b5a4fb0a211}|duhx0210|offline%881811|{894f2b6c-6047-45bd-a57e-8178fc475f1e}|tigresavipbr|offline%905339|{40513c7a-a02a-4413-8e42-66a1d35cb53f}|mariagab4|offline%914035|{9c1402ec-792e-4335-ace5-ba4420100223}|spaceycher|offline%
# Receive: %xt%gbos%-1%102|102%
# Receive: %xt%l%-1%912917|4d0b0811-df47-428b-8b24-dbd3d8744209|bot14092001|4fe3af99955627da0c7de79807d5442f|NULL|45|2%13115924ab85df53ac335124794cc2b2%ef9bfd93109362e21be12fcd45f49bce%100,3|101,1|102,1%
Logged in
Connecting to game server at 188.165.206.119:9877...
Joining server...
Sending verChk request...
# Send: <msg t="sys"><body action="verChk" r="0"><ver v="153" /></body></msg>
# Receive: <msg t='sys'><body action='apiOK' r='0'></body></msg>
Received apiOK response
Sending rndK request...
# Send: <msg t="sys"><body action="rndK" r="-1"></body></msg>
# Receive: <msg t='sys'><body action='rndK' r='-1'><k>e4a2dbcca10a7246817a83cd</k></body></msg>
Received rndK response: e4a2dbcca10a7246817a83cd
# Send: <msg t="sys"><body action="login" r="0"><login z="w1"><nick><![CDATA[912917|4d0b0811-df47-428b-8b24-dbd3d8744209|bot14092001|4fe3af99955627da0c7de79807d5442f|NULL|45|2]]></nick><pword><![CDATA[89fe7fca94e4d7fc689da3e5323e87984fe3af99955627da0c7de79807d5442f#13115924ab85df53ac335124794cc2b2]]></pword></login></body></msg>
# Receive: %xt%l%-1%
# Send: %xt%s%j#js%-1%912917%4fe3af99955627da0c7de79807d5442f%en%
Joined server
Connected!
>>> # Receive: %xt%gs%-1%bc|6%na|true%fe|true%%
# Unhandled packet: %xt%gs%-1%bc|6%na|true%fe|true%%
# Receive: %xt%gb%-1%319854|{f9683601-ee0f-4560-a4d4-602145e279f4}|k1ra|offline%202425|{3328796a-2b4f-4c36-8f25-2b5a4fb0a211}|duhx0210|offline%881811|{894f2b6c-6047-45bd-a57e-8178fc475f1e}|tigresavipbr|offline%905339|{40513c7a-a02a-4413-8e42-66a1d35cb53f}|mariagab4|offline%914035|{9c1402ec-792e-4335-ace5-ba4420100223}|spaceycher|offline%|||offline%
# Unhandled packet: %xt%gb%-1%319854|{f9683601-ee0f-4560-a4d4-602145e279f4}|k1ra|offline%202425|{3328796a-2b4f-4c36-8f25-2b5a4fb0a211}|duhx0210|offline%881811|{894f2b6c-6047-45bd-a57e-8178fc475f1e}|tigresavipbr|offline%905339|{40513c7a-a02a-4413-8e42-66a1d35cb53f}|mariagab4|offline%914035|{9c1402ec-792e-4335-ace5-ba4420100223}|spaceycher|offline%|||offline%
# Receive: %xt%gbf%-1%
# Unhandled packet: %xt%gbf%-1%
# Receive: %xt%bon%-1%{3328796a-2b4f-4c36-8f25-2b5a4fb0a211}%202425%100%100%
# Receive: %xt%bon%-1%%100%100%
Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\Python27\lib\threading.py", line 530, in __bootstrap_inner
    self.run()
  File "C:\Python27\lib\threading.py", line 483, in run
    self.__target(*self.__args, **self.__kwargs)
  File "C:\Users\filip\Desktop\CPPS-PCL-master\client.py", line 745, in _game
    thread.join()
  File "C:\Users\filip\Desktop\CPPS-PCL-master\client.py", line 23, in run
    super(_ExceptionThread, self).run(*args, **kwargs)
  File "C:\Python27\lib\threading.py", line 483, in run
    self.__target(*self.__args, **self.__kwargs)
  File "C:\Users\filip\Desktop\CPPS-PCL-master\client.py", line 51, in inner_handle
    self._callback(packet)
  File "C:\Users\filip\Desktop\CPPS-PCL-master\client.py", line 502, in _bon
    penguin_id = int(packet[4])
ValueError: invalid literal for int() with base 10: '{3328796a-2b4f-4c36-8f25-2b5a4fb0a211}'

After this error, all other actions return an error:

>>> coins
Current coins: -1
>>> buddies
Fetching buddies...
# Send: %xt%s%b#gb%-1%
Failed to fetch buddies
>>> igloo
Fetching player information...
# Send: %xt%s%u#gp%-1%912917%
Failed to fetch player information
Joining penguin #912917's igloo...
# Send: %xt%s%j#jp%-1%913917%
Failed to join penguin #912917's igloo
>>> penguins
Current penguins in room -1:

But apparently, even with an error message, the commands are sometimes executed successfully.