* Add multi-attribute aliases to some packets, for user convenience.
* Add support for writing PlayerListItemPacket.
* Add 'fields' attributes to manually-read/written packet classes,
implementing 'field_string' where appropriate to allow enable the
default __repr__ implementation.
* Modify data constructors where appropriate so that __repr__
implementations match their constructor protocols.
* Improve comments on type aliases within packet classes.
* Add/modify tests to cover the new functionality.
Improvements to the test suite:
* List release version names and numbers in minecraft/__init__.py.
* Make some tests, which previously ran for *all* protocol versions,
run only for release protocol versions (to improve test performance).
* Make some tests, which previously ran only for the latest protocol
version, run for all release protocol versions (to improve coverage).
* Print each protocol version being tested to the debug log, to help
identify sources of errors.
* Use the `nose-timer' plugin to show the run time of each test.
Fix errors revealed by increased test coverage:
* Fix: SoundEffectPacket.Pitch is not serialised correctly for early
protocol versions.
* Fix: handleExceptionTest finishes later than necessary because
the test overrode an exception handler used internally by
`_FakeServerTest', causing the server thread to time out after 4s.
* Add support for multiple exception handlers in `Connection'
(required for the above).
Improvements to data descriptors:
* Make syntax of property declarations more consistent/Pythonic.
* Factor the definition of several aliasing properties into the
utility methods `attribute_alias' and `multi_attribute_alias',
which construct suitable data descriptors.
* Define and use the named tuple `Direction' for (pitch, yaw) values.
This commit introduces two backward-incompatible changes which may break
existing code:
(1) `networking.packets.clientbound.play.SpawnObjectPacket.EntityType'
is no longer accessible as an attribute of the the `SpawnObjectPacket'
class: the values now depend on a `ConnectionContext`, and must be
accessed through an instance, or using `SpawnObjectPacket.field_enum'.
See the text of the `AttributeError` raised from the descriptor for
`SpawnObjectPacket.EntityType` for the full details.
(2) For some subclasses of `networking.types.Type', it is necessary to
call the methods `read_with_context' and `send_with_context' instead of
`read' and `send', supplying a `ConnectionContext' for those data types
- currently only `Position` - whose layout depends on it.
The bound address is 0.0.0.0 which usually implies all
available interfaces, which makes sense when listening
for something. However, when connecting to an address,
a specific address needs to be targeted. Hopefully, any
properly configured computer should have `localhost`
pointing to its loopback interface. Fixes#64
(1) Add py35 job to Travis.
(2) To address issue #57: run tests that connect to Mojang's auth server exactly once, during the py35 job.
(3) Measure coverage exactly once, during the py35 job; always submit the result to coveralls.
(4) Fix miscellaneous errors in generate_travis_yml.py.
- Return value of _make_request() is treated as a requests.Request, when it is in fact a requests.Response.
- Some tests in test_authentication use assertRaises() incorrectly, resulting in testing code that never gets run.
- Other miscellaneous errors exposed by the above changes.
Additionally:
- YggdrasilError instances now have fields with specific error information, and _raise_from_response() populates them. (This will be useful for later changes.)