Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

9.81 protocol client don't get first packet. #3

Open
Corun-Kail opened this issue Mar 12, 2017 · 0 comments
Open

9.81 protocol client don't get first packet. #3

Corun-Kail opened this issue Mar 12, 2017 · 0 comments

Comments

@Corun-Kail
Copy link

During login using otclient with 9.81 protocol server does not send first packet:
In /game/protocols/980.py on line 17(class Packet, function speed) provided value is not an integer. Same problem happens in /game/packet.py on line 140. Because of those events server does not send first packets and client timeout happens.

Error from console

Connection made from ('127.0.0.1', 36968)
Connection lost from ('127.0.0.1', 36968)
Connection made from ('127.0.0.1', 43496)
Ping: 1.0478496551513672 ms
Client protocol version 981
Loading of 30.30.sec took: 0.050471s
[E 170312 22:02:32 ioloop:633] Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fadee77e200>, <game.hack_concurrent.Future object at 0x7fadeea4df90>)
Traceback (most recent call last):
File "/home/kail/Projects/PyOT/PyOTTest/lib/python3.3/site-packages/tornado/ioloop.py", line 604, in _run_callback
ret = callback()
File "/home/kail/Projects/PyOT/PyOTTest/lib/python3.3/site-packages/tornado/stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "/home/kail/Projects/PyOT/PyOTTest/lib/python3.3/site-packages/tornado/gen.py", line 1104, in
self.future, lambda f: self.run())
File "/home/kail/Projects/PyOT/PyOTTest/lib/python3.3/site-packages/tornado/gen.py", line 1049, in run
self.result_future.set_exc_info(sys.exc_info())
File "./game/hack_concurrent.py", line 282, in set_exc_info
self.set_exception(exc_info[1])
File "./game/hack_concurrent.py", line 265, in set_exception
self._set_done()
File "./game/hack_concurrent.py", line 292, in _set_done
cb(self)
File "/home/kail/Projects/PyOT/PyOTTest/lib/python3.3/site-packages/tornado/stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "/home/kail/Projects/PyOT/PyOTTest/lib/python3.3/site-packages/tornado/gen.py", line 199, in final_callback
if future.result() is not None:
File "./game/hack_concurrent.py", line 204, in result
raise_exc_info(self._exc_info)
File "", line 3, in raise_exc_info
File "/home/kail/Projects/PyOT/PyOTTest/lib/python3.3/site-packages/tornado/gen.py", line 1024, in run
yielded = self.gen.send(value)
File "game/service/gameserver.py", line 257, in onFirstPacket
self.player.sendFirstPacket()
File "./game/player.py", line 320, in sendFirstPacket
stream.double(857.36)
File "game/packet.py", line 140, in double
self.uint32((round(data, 3) * 1000) + 0x7FFFFFFF)
File "game/packet.py", line 121, in uint32
self.raw(pack(data))
struct.error: required argument is not an integer
[E 170312 22:02:32 ioloop:633] Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fadee4d0d40>, Position<981, 982, 7>, True, 60, 0, 5, Position<980, 986, 7>, None, False)
Traceback (most recent call last):
File "/home/kail/Projects/PyOT/PyOTTest/lib/python3.3/site-packages/tornado/ioloop.py", line 604, in _run_callback
ret = callback()
File "/home/kail/Projects/PyOT/PyOTTest/lib/python3.3/site-packages/tornado/stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "./game/monster.py", line 575, in spawn
stream.addTileCreature(position, stackpos, monster, player)
File "./game/protocols/base.py", line 320, in addTileCreature
self.creature(creature, known, removeKnown, player)
File "./game/protocols/base.py", line 247, in creature
self.speed(creature.speed) # Speed
File "./game/protocols/980.py", line 17, in speed
self.uint16((speed - 49) // 2)
File "game/packet.py", line 112, in uint16
self.raw(pack(data))
struct.error: required argument is not an integer
[E 170312 22:02:32 ioloop:633] Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fadee4d03b0>, Position<975, 984, 7>, True, 60, 0, 5, Position<980, 986, 7>, None, False)
Traceback (most recent call last):
File "/home/kail/Projects/PyOT/PyOTTest/lib/python3.3/site-packages/tornado/ioloop.py", line 604, in _run_callback
ret = callback()
File "/home/kail/Projects/PyOT/PyOTTest/lib/python3.3/site-packages/tornado/stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "./game/monster.py", line 575, in spawn
stream.addTileCreature(position, stackpos, monster, player)
File "./game/protocols/base.py", line 320, in addTileCreature
self.creature(creature, known, removeKnown, player)
File "./game/protocols/base.py", line 247, in creature
self.speed(creature.speed) # Speed
File "./game/protocols/980.py", line 17, in speed
self.uint16((speed - 49) // 2)
File "game/packet.py", line 112, in uint16
self.raw(pack(data))
struct.error: required argument is not an integer
[E 170312 22:02:32 ioloop:633] Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fadee4d0950>, Position<980, 986, 7>, True, 60, 0, 5, Position<980, 986, 7>, None, False)
Traceback (most recent call last):
File "/home/kail/Projects/PyOT/PyOTTest/lib/python3.3/site-packages/tornado/ioloop.py", line 604, in _run_callback
ret = callback()
File "/home/kail/Projects/PyOT/PyOTTest/lib/python3.3/site-packages/tornado/stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "./game/monster.py", line 575, in spawn
stream.addTileCreature(position, stackpos, monster, player)
File "./game/protocols/base.py", line 320, in addTileCreature
self.creature(creature, known, removeKnown, player)
File "./game/protocols/base.py", line 247, in creature
self.speed(creature.speed) # Speed
File "./game/protocols/980.py", line 17, in speed
self.uint16((speed - 49) // 2)
File "game/packet.py", line 112, in uint16
self.raw(pack(data))
struct.error: required argument is not an integer
[E 170312 22:02:32 ioloop:633] Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fadee4d0680>, Position<977, 988, 7>, True, 60, 0, 5, Position<980, 986, 7>, None, False)
Traceback (most recent call last):
File "/home/kail/Projects/PyOT/PyOTTest/lib/python3.3/site-packages/tornado/ioloop.py", line 604, in _run_callback
ret = callback()
File "/home/kail/Projects/PyOT/PyOTTest/lib/python3.3/site-packages/tornado/stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "./game/monster.py", line 575, in spawn
stream.addTileCreature(position, stackpos, monster, player)
File "./game/protocols/base.py", line 320, in addTileCreature
self.creature(creature, known, removeKnown, player)
File "./game/protocols/base.py", line 247, in creature
self.speed(creature.speed) # Speed
File "./game/protocols/980.py", line 17, in speed
self.uint16((speed - 49) // 2)
File "game/packet.py", line 112, in uint16
self.raw(pack(data))
struct.error: required argument is not an integer
[E 170312 22:02:32 ioloop:633] Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fadee4d05f0>, Position<985, 988, 7>, True, 60, 0, 5, Position<980, 986, 7>, None, False)
Traceback (most recent call last):
File "/home/kail/Projects/PyOT/PyOTTest/lib/python3.3/site-packages/tornado/ioloop.py", line 604, in _run_callback
ret = callback()
File "/home/kail/Projects/PyOT/PyOTTest/lib/python3.3/site-packages/tornado/stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "./game/monster.py", line 575, in spawn
stream.addTileCreature(position, stackpos, monster, player)
File "./game/protocols/base.py", line 320, in addTileCreature
self.creature(creature, known, removeKnown, player)
File "./game/protocols/base.py", line 247, in creature
self.speed(creature.speed) # Speed
File "./game/protocols/980.py", line 17, in speed
self.uint16((speed - 49) // 2)
File "game/packet.py", line 112, in uint16
self.raw(pack(data))
struct.error: required argument is not an integer

Simply using math.floor to bring value to integer allowed for connection but with broken graphics, quite probably because math.floor provides wrong values. I am not entirely sure though.
screenshot from 2017-03-12 21-41-25
screenshot from 2017-03-12 21-43-13
screenshot from 2017-03-12 21-49-08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant