Jump to content

Invalid literal for int() with base - ItemShop in game


Recommended Posts

  

0518 09:11:24555 :: Traceback (most recent call last):

0518 09:11:24555 ::   File "game.py", line 2914, in BINARY_ServerCommand_Run

0518 09:11:24555 ::   File "stringCommander.py", line 63, in Run

0518 09:11:24555 ::   File "stringCommander.py", line 31, in __call__

0518 09:11:24555 ::   File "stringCommander.py", line 20, in __call__

0518 09:11:24556 ::   File "game.py", line 3443, in ManagerItemshop

0518 09:11:24556 :: ValueError
0518 09:11:24556 :: : 
0518 09:11:24556 :: invalid literal for int() with base 10: '0.4'
0518 09:11:24556 :: 

0518 09:11:24556 :: Unknown Server Command ITEMSHOP SET_LOG#25041#1#0.4#2022-05-18[_]04:41:24#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0 | ITEMSHOP

https://paste2.org/ka4F0CjF ------- game.py

other error: https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

Hello, I have this error, when making the purchase in the ItemShop.

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

You are trying to cast float value to int.

 

To be specific, command looks like this
 

ITEMSHOP SET_LOG#25041#1#0.4#2022-05-18[_]04:41:24#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0 | ITEMSHOP

and parsing happens here:

constInfo.ItemShop['LOGS'].append([int(cmd[1]), int(cmd[2]), int(cmd[3]), cmd[4], [(int(cmd[5]), int(cmd[6])), (int(cmd[7]), int(cmd[8])), (int(cmd[9]), int(cmd[10])), (int(cmd[11]), int(cmd[12]))

to be specific, 

int(cmd[3])

is where give value is 

0.4

which is float.

 

If you want to fix it, change it to 

float(cmd[3])

 

If you found this system somewhere, its probably not the best idea to use it, errors like that show that it wasnt tested properly.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.