aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2022-06-25 05:08:22 +0000
committerGitHub <noreply@github.com>2022-06-25 05:08:22 +0000
commitca7067e173129f3044ebc8c77634f06da29a086e (patch)
tree2dcfe72bf09a42f6614f9dc988dc0254162ea0bf
parenta0b3b793f9f631a85f243271531640f07490c4ca (diff)
parent69c47eda4c496b13dadd80976bffd2fab7ea5894 (diff)
downloadazalea-drasl-ca7067e173129f3044ebc8c77634f06da29a086e.tar.xz
Merge branch 'main' into azalea-entity
-rwxr-xr-xCargo.lock88
-rw-r--r--azalea-language/Cargo.toml2
-rwxr-xr-xazalea-protocol/Cargo.toml6
-rwxr-xr-xazalea-protocol/src/packets/mod.rs14
-rwxr-xr-xbot/Cargo.toml4
5 files changed, 39 insertions, 75 deletions
diff --git a/Cargo.lock b/Cargo.lock
index b9a60580..5911b133 100755
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -34,9 +34,9 @@ dependencies = [
[[package]]
name = "async-recursion"
-version = "0.3.2"
+version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7d78656ba01f1b93024b7c3a0467f1608e4be67d725749fdcd7d2c7678fd7a2"
+checksum = "2cda8f4bcc10624c4e85bc66b3f452cca98cfa5ca002dc83a16aad2367641bea"
dependencies = [
"proc-macro2",
"quote",
@@ -197,14 +197,10 @@ dependencies = [
"byteorder",
"bytes",
"flate2",
- "num-derive",
- "num-traits",
"packet-macros",
"serde",
"serde_json",
- "thiserror",
"tokio",
- "tokio-util",
"trust-dns-resolver",
"uuid",
]
@@ -507,9 +503,9 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
[[package]]
name = "enum-as-inner"
-version = "0.3.4"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "570d109b813e904becc80d8d5da38376818a143348413f7149f1340fe04754d4"
+checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73"
dependencies = [
"heck",
"proc-macro2",
@@ -559,12 +555,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b"
[[package]]
-name = "futures-sink"
-version = "0.3.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868"
-
-[[package]]
name = "futures-task"
version = "0.3.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -657,21 +647,12 @@ dependencies = [
]
[[package]]
-name = "instant"
-version = "0.1.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
name = "ipconfig"
-version = "0.2.2"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7"
+checksum = "723519edce41262b05d4143ceb95050e4c614f483e78e9fd9e39a8275a84ad98"
dependencies = [
- "socket2 0.3.19",
+ "socket2",
"widestring",
"winapi",
"winreg",
@@ -942,27 +923,25 @@ dependencies = [
[[package]]
name = "parking_lot"
-version = "0.11.2"
+version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
+checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
dependencies = [
- "instant",
"lock_api",
"parking_lot_core",
]
[[package]]
name = "parking_lot_core"
-version = "0.8.5"
+version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216"
+checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929"
dependencies = [
"cfg-if",
- "instant",
"libc",
"redox_syscall",
"smallvec",
- "winapi",
+ "windows-sys",
]
[[package]]
@@ -1260,17 +1239,6 @@ checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83"
[[package]]
name = "socket2"
-version = "0.3.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e"
-dependencies = [
- "cfg-if",
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "socket2"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0"
@@ -1363,7 +1331,7 @@ dependencies = [
"num_cpus",
"once_cell",
"pin-project-lite",
- "socket2 0.4.4",
+ "socket2",
"tokio-macros",
"winapi",
]
@@ -1380,24 +1348,10 @@ dependencies = [
]
[[package]]
-name = "tokio-util"
-version = "0.6.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507"
-dependencies = [
- "bytes",
- "futures-core",
- "futures-sink",
- "log",
- "pin-project-lite",
- "tokio",
-]
-
-[[package]]
name = "trust-dns-proto"
-version = "0.20.4"
+version = "0.21.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca94d4e9feb6a181c690c4040d7a24ef34018d8313ac5044a61d21222ae24e31"
+checksum = "9c31f240f59877c3d4bb3b3ea0ec5a6a0cff07323580ff8c7a605cd7d08b255d"
dependencies = [
"async-trait",
"cfg-if",
@@ -1420,9 +1374,9 @@ dependencies = [
[[package]]
name = "trust-dns-resolver"
-version = "0.20.4"
+version = "0.21.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ecae383baad9995efaa34ce8e57d12c3f305e545887472a492b838f4b5cfb77a"
+checksum = "e4ba72c2ea84515690c9fcef4c6c660bb9df3036ed1051686de84605b74fd558"
dependencies = [
"cfg-if",
"futures-util",
@@ -1584,9 +1538,9 @@ dependencies = [
[[package]]
name = "widestring"
-version = "0.4.3"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c"
+checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983"
[[package]]
name = "winapi"
@@ -1664,9 +1618,9 @@ checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
[[package]]
name = "winreg"
-version = "0.6.2"
+version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9"
+checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69"
dependencies = [
"winapi",
]
diff --git a/azalea-language/Cargo.toml b/azalea-language/Cargo.toml
index b3f71295..dea9aa27 100644
--- a/azalea-language/Cargo.toml
+++ b/azalea-language/Cargo.toml
@@ -9,4 +9,4 @@ version = "0.1.0"
lazy_static = "1.4.0"
serde = "1.0.137"
serde_json = "1.0.81"
-# tokio = {version = "^1.19.2", features = ["fs"]}
+# tokio = {version = "1.19.2", features = ["fs"]}
diff --git a/azalea-protocol/Cargo.toml b/azalea-protocol/Cargo.toml
index 280879dd..17884a51 100755
--- a/azalea-protocol/Cargo.toml
+++ b/azalea-protocol/Cargo.toml
@@ -7,7 +7,7 @@ version = "0.1.0"
[dependencies]
async-compression = {version = "^0.3.8", features = ["tokio", "zlib"], optional = true}
-async-recursion = "^0.3.2"
+async-recursion = "1.0.0"
azalea-auth = {path = "../azalea-auth"}
azalea-brigadier = {path = "../azalea-brigadier"}
azalea-buf = {path = "../azalea-buf"}
@@ -19,8 +19,6 @@ azalea-nbt = {path = "../azalea-nbt"}
byteorder = "^1.4.3"
bytes = "^1.1.0"
flate2 = "1.0.23"
-num-derive = "^0.3.3"
-num-traits = "^0.2.14"
packet-macros = {path = "./packet-macros"}
serde = {version = "1.0.130", features = ["serde_derive"]}
serde_json = "^1.0.72"
@@ -28,7 +26,7 @@ thiserror = "^1.0.30"
tokio = {version = "^1.19.2", features = ["io-util", "net", "macros"]}
tokio-util = "^0.6.9"
trust-dns-resolver = "^0.20.3"
-uuid = "^1.1.2"
+uuid = "1.1.2"
[features]
connecting = []
diff --git a/azalea-protocol/src/packets/mod.rs b/azalea-protocol/src/packets/mod.rs
index 738baa09..b9116228 100755
--- a/azalea-protocol/src/packets/mod.rs
+++ b/azalea-protocol/src/packets/mod.rs
@@ -11,7 +11,7 @@ use std::io::{Read, Write};
pub const PROTOCOL_VERSION: u32 = 759;
-#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, FromPrimitive)]
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum ConnectionProtocol {
Handshake = -1,
Game = 0,
@@ -19,6 +19,18 @@ pub enum ConnectionProtocol {
Login = 2,
}
+impl ConnectionProtocol {
+ pub fn from_i32(i: i32) -> Option<Self> {
+ match i {
+ -1 => Some(ConnectionProtocol::Handshake),
+ 0 => Some(ConnectionProtocol::Game),
+ 1 => Some(ConnectionProtocol::Status),
+ 2 => Some(ConnectionProtocol::Login),
+ _ => None,
+ }
+ }
+}
+
#[derive(Clone, Debug)]
pub enum Packet {
Game(game::GamePacket),
diff --git a/bot/Cargo.toml b/bot/Cargo.toml
index f61bf2fa..974d6f61 100755
--- a/bot/Cargo.toml
+++ b/bot/Cargo.toml
@@ -9,5 +9,5 @@ version = "0.1.0"
azalea-client = {path = "../azalea-client"}
azalea-core = {path = "../azalea-core"}
azalea-protocol = {path = "../azalea-protocol"}
-tokio = "^1.19.2"
-uuid = "^1.1.2"
+tokio = "1.19.2"
+uuid = "1.1.2"