diff options
| author | salmonik <salmonik@tuta.io> | 2026-07-12 22:06:54 +0200 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-07-12 22:06:54 +0200 |
| commit | ce30a8732c21a1c936ac560b5c94576df2e26b22 (patch) | |
| tree | 259a81d24b84ddfda51a6aa96c80ecb4a4afcfae /src/rcon.rs | |
| parent | second stable (diff) | |
| download | minecraft-ui-ce30a8732c21a1c936ac560b5c94576df2e26b22.tar.gz minecraft-ui-ce30a8732c21a1c936ac560b5c94576df2e26b22.zip | |
remove unused code, also, third stable
Diffstat (limited to 'src/rcon.rs')
| -rw-r--r-- | src/rcon.rs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/rcon.rs b/src/rcon.rs index b91fe9b..eb3b72a 100644 --- a/src/rcon.rs +++ b/src/rcon.rs | |||
| @@ -112,22 +112,16 @@ impl RconClient { | |||
| 112 | .map_err(|e| RconError::Response(format!("Failed to read payload: {e}")))?; | 112 | .map_err(|e| RconError::Response(format!("Failed to read payload: {e}")))?; |
| 113 | 113 | ||
| 114 | let request_id = i32::from_le_bytes([payload[0], payload[1], payload[2], payload[3]]); | 114 | let request_id = i32::from_le_bytes([payload[0], payload[1], payload[2], payload[3]]); |
| 115 | let packet_type = i32::from_le_bytes([payload[4], payload[5], payload[6], payload[7]]); | ||
| 116 | 115 | ||
| 117 | let body_bytes = &payload[8..payload.len() - 2]; | 116 | let body_bytes = &payload[8..payload.len() - 2]; |
| 118 | let body = String::from_utf8_lossy(body_bytes).to_string(); | 117 | let body = String::from_utf8_lossy(body_bytes).to_string(); |
| 119 | 118 | ||
| 120 | Ok(RconPacket { | 119 | Ok(RconPacket { request_id, body }) |
| 121 | request_id, | ||
| 122 | packet_type, | ||
| 123 | body, | ||
| 124 | }) | ||
| 125 | } | 120 | } |
| 126 | } | 121 | } |
| 127 | 122 | ||
| 128 | #[derive(Debug)] | 123 | #[derive(Debug)] |
| 129 | struct RconPacket { | 124 | struct RconPacket { |
| 130 | request_id: i32, | 125 | request_id: i32, |
| 131 | packet_type: i32, | ||
| 132 | body: String, | 126 | body: String, |
| 133 | } | 127 | } |
