botchallenge icon indicating copy to clipboard operation
botchallenge copied to clipboard

Lack of exceptions for robots and connections

Open paked opened this issue 10 years ago • 1 comments

While messing around in my python interpreter, I found these exception related bugs. I'm guessing this project is being aimed at a not incredibly experienced python audience, so friendly errors and exceptions are probably critical :)

  • If you Robot(USERNAME, SERVER) and you haven't made a robot it doesn't say anything. When checking the blocks around the bot with robot.get_block_type it appears as if the robot is in the air...
  • If you create a robot in the interpreter, and then create one in the game and then go back to the interpreter, doing anything with the bot makes him hang (a network issue?)

This is a really cool project :) I'll be forking and submitting PRs later :)

paked avatar Jan 25 '15 23:01 paked

To add onto this: Calling Robot.get_owner_location() when owner is not on the server results in this:

>>> r.get_location()
Location(x_coord=-1054, y_coord=64, z_coord=6)
>>> r.get_owner_location()
Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    r.get_owner_location()
  File "D:\Applications\Python34\lib\site-packages\botchallenge\robot.py", line 99, in get_owner_location
    return self._locate(robotapi_pb2.RobotReadRequest.OWNER)
  File "D:\Applications\Python34\lib\site-packages\botchallenge\robot.py", line 88, in _locate
    loc_proto = self._action(request).location_response.locations[0]
  File "D:\Applications\Python34\lib\site-packages\google\protobuf\internal\containers.py", line 64, in __getitem__
    return self._values[key]
IndexError: list index out of range

mcpower avatar Jan 26 '15 02:01 mcpower