Commit Graph

19 Commits (master)

Author SHA1 Message Date
James T. Martin ada29edd06
Upgrade to tokio 1.0, with request update, un-breaking auth. 2021-01-05 12:08:38 -08:00
James T. Martin 0a0b9c3c25
Upgrade to tokio 0.3. This breaks authentication because
reqwest does not support the tokio 0.3 runtime yet.
2020-12-02 12:24:57 -08:00
James T. Martin e107ab8284
Upgrade dependencies to latest major versions, except tokio.
This upgrade excludes tokio 0.3 because reqwest is not yet compatible with tokio 0.3;
see https://github.com/seanmonstar/reqwest/issues/1060.
2020-12-02 12:20:08 -08:00
James T. Martin 900f08c17c
Added README 2020-12-02 12:09:39 -08:00
James T. Martin 9acc85be48
Begin work on higher-level network abstractions. 2020-07-27 04:01:14 -07:00
James T. Martin 389bafe89d
Massively improve low-level packet stream interface.
Also, now PacketStream (whose previous version was Connection)
should now, in theory (untested) support client connections to servers.
2020-07-26 23:56:02 -07:00
James T. Martin 5aa93b97d0
Overhaul GitHub workflow: fmt, lint, check, and build.
* Run a check for every target and feature combination.
* Build natively for every target.
2020-07-26 16:01:29 -07:00
James T. Martin bdeb8bb6a4
Apply suggested rustfmt and clippy changes. 2020-07-26 15:15:52 -07:00
James T. Martin 5302c04fa4
Make into optional features: authentication, compression, encryption. 2020-07-26 14:33:51 -07:00
James T. Martin 60c9a48293
Got encryption working! It's ugly, but it works. Cleanup tomorrow. 2020-07-26 02:05:49 -07:00
James T. Martin 3701b59a11
Added support for compressed packets.
I also had to bring packet serialization/deserialization
back out of PacketFormat so that I could make it a trait object
in the connection (before it was generic over PacketMap).
However, now that Connection abstracts over PacketFormat,
it actually reduced code duplication to do so.

I also reorganized the hierarchy a bit, moving packet formats
under the connection module and most other things under the
protocol module.
2020-07-25 12:20:01 -07:00
James T. Martin a89562f9d6
Mapped entire login state and added trivial offline login flow. 2020-07-25 01:33:00 -07:00
James T. Martin afc8a4aaaa
Correctly distinguish packet maps and protocol states. 2020-07-25 00:26:30 -07:00
James T. Martin 2a0f97be29
Abstract out connection state with phantom protocol state markers. 2020-07-24 23:44:38 -07:00
James T. Martin cfc7bd6f46
Massive net refactoring, protocol now defined via macros!
* Fixed cli.yml, which was blatently broken previously.

* Split PacketData into PacketReadable and PacketWritable,
  which allows implementing PacketWritable for un-owned types
  (for example, &str and &[u8]).

* Added impl_packet_data_for_num! and impl_varnum!
  which makes defining packet serialization
  for the numbers very concise.

* Added define_packet! macro which
  makes defining packets easy and much less tedious.

* Added ProtocolState macro which encapsulates
  packet enums and packet ids into a single unit.

* Added define_packet! macro which makes
  defining protocol states trivial
  (it's just a simple id/packet mapping).

* Made packet serialization/deserialization part of PacketFormat,
  which massively simplifies the API.

It took a while to get the hang of this all,
but the more I use Rust, the more I love it.
2020-07-24 22:22:09 -07:00
James T. Martin 0b5d3c026f
Added PacketData trait to allow serializing any data types. 2020-07-24 18:20:07 -07:00
James T. Martin d32118db4f
Begin work on improving network packet abstractions.
* Packet header/stream stuff is now defined by a PacketFormat.
* Actual packet serialization/deserialization is handled by
  PacketSerializer/PacketDeserializer.
* The end API is still awkaward, so more work is needed.
2020-07-24 11:16:37 -07:00
James T. Martin 9ee0dbe63e
Add license (GPLv3+). 2020-07-23 23:40:43 -07:00
James T. Martin 172796420a
The server successfully responds to status pings. 2020-07-23 23:32:46 -07:00