diff --git a/Cargo.toml b/Cargo.toml index 4fefd32fd..17522db43 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -106,13 +106,13 @@ documentation = "https://docs.rs/valence/" license = "MIT" [workspace.dependencies] -aes = "0.8.2" -anyhow = { version = "1.0.70", features = ["backtrace"] } +aes = "0.8.4" +anyhow = { version = "1.0.86", features = ["backtrace"] } approx = "0.5.1" -arrayvec = "0.7.2" -async-trait = "0.1.60" +arrayvec = "0.7.4" +async-trait = "0.1.80" atty = "0.2.14" -base64 = "0.21.0" +base64 = "0.22.1" bevy_app = { version = "0.12", default-features = false } bevy_derive = "0.12" bevy_ecs = { version = "0.12", default-features = false, features = [ @@ -122,65 +122,65 @@ bevy_hierarchy = { version = "0.12", default-features = false } bevy_log = { version = "0.12" } bevy_mod_debugdump = { version = "0.9.0", default-features = false } bevy_utils = { version = "0.12" } -bitfield-struct = "0.5.3" +bitfield-struct = "0.8.0" bitvec = "1.0.1" -byteorder = "1.4.3" -bytes = "1.2.1" +byteorder = "1.5.0" +bytes = "1.6.0" cesu8 = "1.1.0" cfb8 = "0.8.1" -clap = { version = "4.0.30", features = ["derive"] } -derive_more = "1.0.0-beta.3" -directories = "5.0.0" +clap = { version = "4.5.7", features = ["derive"] } +derive_more = "1.0.0-beta.6" +directories = "5.0.1" divan = "0.1.14" -eframe = { version = "0.22.0", default-features = false } -egui = "0.22.0" -egui_dock = "0.6" -flate2 = "1.0.24" +eframe = { version = "0.27.2" } +egui = "0.27.2" +egui_dock = "0.12" +flate2 = "1.0.30" flume = "0.11.0" -fs_extra = "1.2.0" -glam = "0.26.0" -heck = "0.5.0-rc.1" +fs_extra = "1.3.0" +glam = "0.28.0" +heck = "0.5.0" hmac = "0.12.1" -image = "0.24.6" -indexmap = "2.2.1" -itertools = "0.12.0" +image = "0.25.1" +indexmap = "2.2.6" +itertools = "0.13.0" java_string = { path = "crates/java_string", version = "0.1.2" } -lru = "0.12.0" -noise = "0.8.2" -num = "0.4.0" -num-bigint = "0.4.3" -owo-colors = "3.5.0" -ordered-float = "4.1.1" -parking_lot = "0.12.1" -paste = "1.0.11" -petgraph = "0.6.3" -pretty_assertions = "1.3.0" -proc-macro2 = "1.0.56" -quote = "1.0.26" +lru = "0.12.3" +noise = "0.9.0" +num = "0.4.3" +num-bigint = "0.4.5" +owo-colors = "4.0.0" +ordered-float = "4.2.0" +parking_lot = "0.12.3" +paste = "1.0.15" +petgraph = "0.6.5" +pretty_assertions = "1.4.0" +proc-macro2 = "1.0.86" +quote = "1.0.36" rand = "0.8.5" -rayon = "1.7.0" -regex = "1.6.0" -reqwest = { version = "0.11.12", default-features = false } -rfd = "0.11.3" -rsa = "0.9.2" +rayon = "1.10.0" +regex = "1.10.5" +reqwest = { version = "0.12.5", default-features = false } +rfd = "0.14.1" +rsa = "0.9.6" rsa-der = "0.3.0" -rustc-hash = "1.1.0" -serde = "1.0.160" +rustc-hash = "2.0.0" +serde = "1.0.203" serde-value = "0.7.0" -serde_json = "1.0.96" -sha1 = "0.10.5" -sha2 = "0.10.6" -syn = "2.0.15" -syntect = { version = "5.0.0", default-features = false } -tempfile = "3.3.0" -thiserror = "1.0.40" -time = "0.3.17" -tokio = { version = "1.27.0", features = ["full"] } -toml = "0.7.2" -tracing = "0.1.37" -tracing-subscriber = "0.3.16" -url = { version = "2.2.2", features = ["serde"] } -uuid = "1.3.1" +serde_json = "1.0.117" +sha1 = "0.10.6" +sha2 = "0.10.8" +syn = "2.0.67" +syntect = { version = "5.2.0", default-features = false } +tempfile = "3.10.1" +thiserror = "1.0.61" +time = "0.3.36" +tokio = { version = "1.38.0", features = ["full"] } +toml = "0.8.14" +tracing = "0.1.40" +tracing-subscriber = "0.3.18" +url = { version = "2.5.2", features = ["serde"] } +uuid = "1.8.0" valence = { path = ".", version = "0.2.0-alpha.1" } valence_advancement = { path = "crates/valence_advancement", version = "0.2.0-alpha.1" } valence_anvil = { path = "crates/valence_anvil", version = "0.1.0" } @@ -209,7 +209,7 @@ valence_server_common = { path = "crates/valence_server_common", version = "0.2. valence_text = { path = "crates/valence_text", version = "0.2.0-alpha.1" } valence_weather = { path = "crates/valence_weather", version = "0.2.0-alpha.1" } valence_world_border = { path = "crates/valence_world_border", version = "0.2.0-alpha.1" } -zip = "0.6.3" +zip = "2.1.3" [workspace.lints.rust] # missing_debug_implementations = "warn" # TODO: enable me.` diff --git a/crates/java_string/README.md b/crates/java_string/README.md index 7135d6454..8c93a8142 100644 --- a/crates/java_string/README.md +++ b/crates/java_string/README.md @@ -1,10 +1,10 @@ -# java_string +# `java_string` An implementation of Java strings, tolerant of invalid UTF-16 encoding. This allows for round-trip serialization of all Java strings, including those which contain invalid UTF-16, while still -being able to perform useful operations on those strings. +being able to perform useful operations on those strings. -These Java strings use the UTF-8 encoding, with the modification that surrogate code points (code points between U+D800 +These Java strings use the UTF-8 encoding, with the modification that surrogate code points (code points between U+D800 and U+DFFF inclusive) are allowed. This allows for zero-cost conversion from Rust strings to Java strings. This modified encoding is known as "semi-UTF-8" throughout the codebase. Similarly, this crate introduces a `JavaCodePoint` type which is analogous to `char`, except that surrogate code points are allowed. @@ -14,4 +14,4 @@ strings. Please refer to the `std` documentation. # Features -- `serde` Adds support for [`serde`](https://docs.rs/serde/latest/serde/) \ No newline at end of file +- `serde` Adds support for [`serde`](https://docs.rs/serde/latest/serde/) diff --git a/crates/java_string/src/char.rs b/crates/java_string/src/char.rs index f21e7d7b7..8ee4078fa 100644 --- a/crates/java_string/src/char.rs +++ b/crates/java_string/src/char.rs @@ -101,7 +101,7 @@ impl JavaCodePoint { pub const fn as_u32(self) -> u32 { unsafe { // SAFETY: JavaCodePoint has the same repr as a u32 - let result = std::mem::transmute(self); + let result = std::mem::transmute::(self); if result > 0x10ffff { // SAFETY: JavaCodePoint can never have a value > 0x10FFFF. diff --git a/tools/dump_schedule/README.md b/tools/dump_schedule/README.md index d4e3a4511..7207092d9 100644 --- a/tools/dump_schedule/README.md +++ b/tools/dump_schedule/README.md @@ -1,4 +1,4 @@ -# dump_schedule +# `dump_schedule` A simple debugging utility for visualizing Valence's schedule graph. Generates a SVG file. diff --git a/tools/packet_inspector/src/app.rs b/tools/packet_inspector/src/app.rs index c23ac107f..87e4dc31d 100644 --- a/tools/packet_inspector/src/app.rs +++ b/tools/packet_inspector/src/app.rs @@ -1,7 +1,7 @@ use std::net::SocketAddr; use std::sync::{Arc, RwLock}; -use egui_dock::{DockArea, NodeIndex, Style, Tree}; +use egui_dock::{DockArea, DockState, NodeIndex, Style}; use packet_inspector::Proxy; use tokio::task::JoinHandle; @@ -48,7 +48,7 @@ impl egui_dock::TabViewer for TabViewer { } pub(crate) struct GuiApp { - tree: Tree>, + tree: DockState>, shared_state: Arc>, tab_viewer: TabViewer, } @@ -58,16 +58,19 @@ impl GuiApp { let ctx = cc.egui_ctx.clone(); // Default Application Layout - let mut tree: Tree> = Tree::new(vec![Box::new(connection::Connection::new())]); + let mut tree: DockState> = + DockState::new(vec![Box::new(connection::Connection::new())]); - let [a, b] = tree.split_right( + let [a, b] = tree.main_surface_mut().split_right( NodeIndex::root(), 0.3, vec![Box::new(packet_list::PacketList::new())], ); - let [_, _] = tree.split_below(a, 0.25, vec![Box::new(filter::Filter::new())]); - let [_, _] = tree.split_below( + let [_, _] = + tree.main_surface_mut() + .split_below(a, 0.25, vec![Box::new(filter::Filter::new())]); + let [_, _] = tree.main_surface_mut().split_below( b, 0.5, vec![ diff --git a/tools/packet_inspector/src/app/packet_list.rs b/tools/packet_inspector/src/app/packet_list.rs index c8adbc537..574e5f963 100644 --- a/tools/packet_inspector/src/app/packet_list.rs +++ b/tools/packet_inspector/src/app/packet_list.rs @@ -1,7 +1,6 @@ -use eframe::epaint::{PathShape, RectShape}; +use eframe::epaint::PathShape; use egui::{ - Color32, Pos2, Rect, Response, Rgba, Rounding, Sense, Shape, Stroke, TextStyle, Ui, Vec2, - WidgetText, + Color32, Pos2, Rect, Response, Rgba, Sense, Shape, Stroke, TextStyle, Ui, Vec2, WidgetText, }; use packet_inspector::Packet; use valence_protocol::PacketSide; @@ -148,12 +147,8 @@ fn draw_packet_widget(ui: &mut Ui, packet: &Packet, selected: bool) -> Response }; if ui.is_rect_visible(rect) { - ui.painter().add(Shape::Rect(RectShape { - rect, - rounding: Rounding::none(), - fill: fill.into(), - stroke: Stroke::new(1.0, Rgba::BLACK), - })); + ui.painter() + .rect(rect, 0.0, fill, Stroke::new(1.0, Rgba::BLACK)); let shape = get_triangle(packet.side, &rect); ui.painter().add(Shape::Path(shape)); @@ -176,34 +171,33 @@ fn draw_packet_widget(ui: &mut Ui, packet: &Packet, selected: bool) -> Response ui.visuals().weak_text_color() }; - identifier.paint_with_fallback_color( - ui.painter(), + ui.painter().galley( Pos2 { x: rect.left() + 21.0, y: rect.top() + 6.0, }, + identifier, id_and_timestamp_color, ); rect.set_width(rect.width() - 5.0); let label_width = label.size().x + 50.0; - - label.paint_with_fallback_color( - &ui.painter().with_clip_rect(rect), + ui.painter().galley( Pos2 { x: rect.left() + 55.0, y: rect.top() + 6.0, }, + label, text_color, ); - timestamp.paint_with_fallback_color( - &ui.painter().with_clip_rect(rect), + ui.painter().galley( Pos2 { x: rect.left() + label_width + 8.0, y: rect.top() + 6.0, }, + timestamp, id_and_timestamp_color, ); } diff --git a/tools/packet_inspector/src/main.rs b/tools/packet_inspector/src/main.rs index fa7e7b0a0..4d8e049eb 100644 --- a/tools/packet_inspector/src/main.rs +++ b/tools/packet_inspector/src/main.rs @@ -1,5 +1,7 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] +use egui::{IconData, ViewportBuilder}; + mod tri_checkbox; mod app; @@ -8,9 +10,9 @@ mod shared_state; #[tokio::main] async fn main() -> Result<(), Box> { let native_options = eframe::NativeOptions { - icon_data: Some(load_icon()), - initial_window_size: Some(egui::Vec2::new(1024.0, 768.0)), - decorated: true, + viewport: ViewportBuilder::default() + .with_inner_size(egui::Vec2::new(1024.0, 768.0)) + .with_icon(load_icon()), ..Default::default() }; @@ -27,7 +29,7 @@ async fn main() -> Result<(), Box> { Ok(()) } -fn load_icon() -> eframe::IconData { +fn load_icon() -> IconData { let (icon_rgba, icon_width, icon_height) = { let icon = include_bytes!("../../../assets/logo-256x256.png"); let image = image::load_from_memory(icon) @@ -38,7 +40,7 @@ fn load_icon() -> eframe::IconData { (rgba, width, height) }; - eframe::IconData { + IconData { rgba: icon_rgba, width: icon_width, height: icon_height, diff --git a/tools/packet_inspector/src/tri_checkbox.rs b/tools/packet_inspector/src/tri_checkbox.rs index cc92466d4..7b57a3cff 100644 --- a/tools/packet_inspector/src/tri_checkbox.rs +++ b/tools/packet_inspector/src/tri_checkbox.rs @@ -89,12 +89,12 @@ impl<'a> Widget for TriCheckbox<'a> { // let visuals = ui.style().interact_selectable(&response, *checked); let visuals = ui.style().interact(&response); let (small_icon_rect, big_icon_rect) = ui.spacing().icon_rectangles(rect); - ui.painter().add(epaint::RectShape { - rect: big_icon_rect.expand(visuals.expansion), - rounding: visuals.rounding, - fill: visuals.bg_fill, - stroke: visuals.bg_stroke, - }); + ui.painter().add(epaint::RectShape::new( + big_icon_rect.expand(visuals.expansion), + visuals.rounding, + visuals.bg_fill, + visuals.bg_stroke, + )); match *checked { TriCheckboxState::Enabled => { @@ -125,7 +125,8 @@ impl<'a> Widget for TriCheckbox<'a> { rect.min.x + icon_width + icon_spacing, rect.center().y - 0.5 * text.size().y, ); - text.paint_with_visuals(ui.painter(), text_pos, visuals); + + ui.painter().galley(text_pos, text, visuals.text_color()); } } diff --git a/tools/playground/src/playground.template.rs b/tools/playground/src/playground.template.rs index a157355ea..ce42dec81 100644 --- a/tools/playground/src/playground.template.rs +++ b/tools/playground/src/playground.template.rs @@ -6,7 +6,7 @@ use crate::extras::*; const SPAWN_Y: i32 = 64; -pub fn build_app(app: &mut App) { +pub(crate) fn build_app(app: &mut App) { app.insert_resource(NetworkSettings { connection_mode: ConnectionMode::Offline, ..Default::default()