style: set group_imports rustfmt option
This commit is contained in:
parent
6e288faa8d
commit
d400850b93
1
rustfmt.toml
Normal file
1
rustfmt.toml
Normal file
@ -0,0 +1 @@
|
|||||||
|
group_imports = "StdExternalCrate"
|
@ -1,7 +1,9 @@
|
|||||||
use crate::build_info;
|
|
||||||
use clap::Parser;
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
use clap::Parser;
|
||||||
|
|
||||||
|
use crate::build_info;
|
||||||
|
|
||||||
/// A Minecraft bot with Lua scripting support
|
/// A Minecraft bot with Lua scripting support
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
#[command(version = build_info::version_formatted())]
|
#[command(version = build_info::version_formatted())]
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
use crate::{
|
|
||||||
State,
|
|
||||||
lua::{eval, exec, reload},
|
|
||||||
};
|
|
||||||
use azalea::{brigadier::prelude::*, chat::ChatPacket, prelude::*};
|
use azalea::{brigadier::prelude::*, chat::ChatPacket, prelude::*};
|
||||||
use futures::lock::Mutex;
|
use futures::lock::Mutex;
|
||||||
use mlua::{Function, Table};
|
use mlua::{Function, Table};
|
||||||
use ncr::utils::prepend_header;
|
use ncr::utils::prepend_header;
|
||||||
|
|
||||||
|
use crate::{
|
||||||
|
State,
|
||||||
|
lua::{eval, exec, reload},
|
||||||
|
};
|
||||||
|
|
||||||
pub type Ctx = CommandContext<Mutex<CommandSource>>;
|
pub type Ctx = CommandContext<Mutex<CommandSource>>;
|
||||||
|
|
||||||
pub struct CommandSource {
|
pub struct CommandSource {
|
||||||
|
@ -1,11 +1,5 @@
|
|||||||
use crate::{
|
use std::{net::SocketAddr, process::exit};
|
||||||
State,
|
|
||||||
commands::CommandSource,
|
|
||||||
http::serve,
|
|
||||||
lua::{client, direction::Direction, player::Player, vec3::Vec3},
|
|
||||||
particle,
|
|
||||||
replay::recorder::Recorder,
|
|
||||||
};
|
|
||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
use azalea::{
|
use azalea::{
|
||||||
brigadier::exceptions::BuiltInExceptions::DispatcherUnknownCommand, prelude::*,
|
brigadier::exceptions::BuiltInExceptions::DispatcherUnknownCommand, prelude::*,
|
||||||
@ -16,11 +10,18 @@ use hyper_util::rt::TokioIo;
|
|||||||
use log::{debug, error, info, trace};
|
use log::{debug, error, info, trace};
|
||||||
use mlua::{Error, Function, IntoLuaMulti, Table};
|
use mlua::{Error, Function, IntoLuaMulti, Table};
|
||||||
use ncr::utils::trim_header;
|
use ncr::utils::trim_header;
|
||||||
use std::{net::SocketAddr, process::exit};
|
|
||||||
use tokio::net::TcpListener;
|
use tokio::net::TcpListener;
|
||||||
|
|
||||||
#[cfg(feature = "matrix")]
|
#[cfg(feature = "matrix")]
|
||||||
use crate::matrix;
|
use crate::matrix;
|
||||||
|
use crate::{
|
||||||
|
State,
|
||||||
|
commands::CommandSource,
|
||||||
|
http::serve,
|
||||||
|
lua::{client, direction::Direction, player::Player, vec3::Vec3},
|
||||||
|
particle,
|
||||||
|
replay::recorder::Recorder,
|
||||||
|
};
|
||||||
|
|
||||||
#[allow(clippy::too_many_lines)]
|
#[allow(clippy::too_many_lines)]
|
||||||
pub async fn handle_event(client: Client, event: Event, state: State) -> Result<()> {
|
pub async fn handle_event(client: Client, event: Event, state: State) -> Result<()> {
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
use crate::{
|
|
||||||
State,
|
|
||||||
lua::{eval, exec, reload},
|
|
||||||
};
|
|
||||||
use http_body_util::{BodyExt, Empty, Full, combinators::BoxBody};
|
use http_body_util::{BodyExt, Empty, Full, combinators::BoxBody};
|
||||||
use hyper::{
|
use hyper::{
|
||||||
Error, Method, Request, Response, StatusCode,
|
Error, Method, Request, Response, StatusCode,
|
||||||
body::{Bytes, Incoming},
|
body::{Bytes, Incoming},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use crate::{
|
||||||
|
State,
|
||||||
|
lua::{eval, exec, reload},
|
||||||
|
};
|
||||||
|
|
||||||
pub async fn serve(
|
pub async fn serve(
|
||||||
request: Request<Incoming>,
|
request: Request<Incoming>,
|
||||||
state: State,
|
state: State,
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
use super::{Client, Container, ContainerRef, ItemStack, Vec3};
|
|
||||||
use azalea::{
|
use azalea::{
|
||||||
BlockPos,
|
BlockPos,
|
||||||
inventory::{Inventory, Menu, Player, SlotList},
|
inventory::{Inventory, Menu, Player, SlotList},
|
||||||
@ -8,6 +7,8 @@ use azalea::{
|
|||||||
use log::error;
|
use log::error;
|
||||||
use mlua::{Lua, Result, UserDataRef, Value};
|
use mlua::{Lua, Result, UserDataRef, Value};
|
||||||
|
|
||||||
|
use super::{Client, Container, ContainerRef, ItemStack, Vec3};
|
||||||
|
|
||||||
pub fn container(_lua: &Lua, client: &Client) -> Result<Option<ContainerRef>> {
|
pub fn container(_lua: &Lua, client: &Client) -> Result<Option<ContainerRef>> {
|
||||||
Ok(client.get_open_container().map(ContainerRef))
|
Ok(client.get_open_container().map(ContainerRef))
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
use super::{Client, Vec3};
|
|
||||||
use azalea::{
|
use azalea::{
|
||||||
BlockPos, BotClientExt,
|
BlockPos, BotClientExt,
|
||||||
protocol::packets::game::{ServerboundUseItem, s_interact::InteractionHand},
|
protocol::packets::game::{ServerboundUseItem, s_interact::InteractionHand},
|
||||||
@ -7,6 +6,8 @@ use azalea::{
|
|||||||
use log::error;
|
use log::error;
|
||||||
use mlua::{Lua, Result, UserDataRef};
|
use mlua::{Lua, Result, UserDataRef};
|
||||||
|
|
||||||
|
use super::{Client, Vec3};
|
||||||
|
|
||||||
pub fn attack(_lua: &Lua, client: &mut Client, entity_id: i32) -> Result<()> {
|
pub fn attack(_lua: &Lua, client: &mut Client, entity_id: i32) -> Result<()> {
|
||||||
client.attack(MinecraftEntityId(entity_id));
|
client.attack(MinecraftEntityId(entity_id));
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -6,15 +6,17 @@ mod movement;
|
|||||||
mod state;
|
mod state;
|
||||||
mod world;
|
mod world;
|
||||||
|
|
||||||
|
use std::ops::{Deref, DerefMut};
|
||||||
|
|
||||||
|
use azalea::{Client as AzaleaClient, world::MinecraftEntityId};
|
||||||
|
use mlua::{Lua, Result, UserData, UserDataFields, UserDataMethods};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
container::{Container, ContainerRef, item_stack::ItemStack},
|
container::{Container, ContainerRef, item_stack::ItemStack},
|
||||||
direction::Direction,
|
direction::Direction,
|
||||||
player::Player,
|
player::Player,
|
||||||
vec3::Vec3,
|
vec3::Vec3,
|
||||||
};
|
};
|
||||||
use azalea::{Client as AzaleaClient, world::MinecraftEntityId};
|
|
||||||
use mlua::{Lua, Result, UserData, UserDataFields, UserDataMethods};
|
|
||||||
use std::ops::{Deref, DerefMut};
|
|
||||||
|
|
||||||
pub struct Client(pub Option<AzaleaClient>);
|
pub struct Client(pub Option<AzaleaClient>);
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
use super::{Client, Direction, Vec3};
|
|
||||||
use azalea::{
|
use azalea::{
|
||||||
BlockPos, BotClientExt, SprintDirection, WalkDirection,
|
BlockPos, BotClientExt, SprintDirection, WalkDirection,
|
||||||
entity::Position,
|
entity::Position,
|
||||||
@ -13,6 +12,8 @@ use azalea::{
|
|||||||
use log::error;
|
use log::error;
|
||||||
use mlua::{FromLua, Lua, Result, Table, UserDataRef, Value};
|
use mlua::{FromLua, Lua, Result, Table, UserDataRef, Value};
|
||||||
|
|
||||||
|
use super::{Client, Direction, Vec3};
|
||||||
|
|
||||||
pub fn direction(_lua: &Lua, client: &Client) -> Result<Direction> {
|
pub fn direction(_lua: &Lua, client: &Client) -> Result<Direction> {
|
||||||
let direction = client.direction();
|
let direction = client.direction();
|
||||||
Ok(Direction {
|
Ok(Direction {
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
use crate::hacks::anti_knockback::AntiKnockback;
|
|
||||||
|
|
||||||
use super::Client;
|
|
||||||
use azalea::{
|
use azalea::{
|
||||||
ClientInformation,
|
ClientInformation,
|
||||||
entity::metadata::{AirSupply, Score},
|
entity::metadata::{AirSupply, Score},
|
||||||
@ -9,6 +6,9 @@ use azalea::{
|
|||||||
};
|
};
|
||||||
use mlua::{Error, Lua, Result, Table, UserDataRef};
|
use mlua::{Error, Lua, Result, Table, UserDataRef};
|
||||||
|
|
||||||
|
use super::Client;
|
||||||
|
use crate::hacks::anti_knockback::AntiKnockback;
|
||||||
|
|
||||||
pub fn air_supply(_lua: &Lua, client: &Client) -> Result<i32> {
|
pub fn air_supply(_lua: &Lua, client: &Client) -> Result<i32> {
|
||||||
Ok(client.component::<AirSupply>().0)
|
Ok(client.component::<AirSupply>().0)
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
use super::{Client, Direction, Vec3};
|
|
||||||
use azalea::{
|
use azalea::{
|
||||||
BlockPos,
|
BlockPos,
|
||||||
blocks::{BlockState, BlockStates},
|
blocks::{BlockState, BlockStates},
|
||||||
@ -11,6 +10,8 @@ use azalea::{
|
|||||||
};
|
};
|
||||||
use mlua::{Function, Lua, Result, Table, UserDataRef};
|
use mlua::{Function, Lua, Result, Table, UserDataRef};
|
||||||
|
|
||||||
|
use super::{Client, Direction, Vec3};
|
||||||
|
|
||||||
pub fn blocks(
|
pub fn blocks(
|
||||||
_lua: &Lua,
|
_lua: &Lua,
|
||||||
client: &Client,
|
client: &Client,
|
||||||
|
@ -2,10 +2,11 @@
|
|||||||
mod queries;
|
mod queries;
|
||||||
pub mod find;
|
pub mod find;
|
||||||
|
|
||||||
use super::{Client, Direction, Vec3};
|
|
||||||
use azalea::{BlockPos, auto_tool::AutoToolClientExt, blocks::BlockState, world::InstanceName};
|
use azalea::{BlockPos, auto_tool::AutoToolClientExt, blocks::BlockState, world::InstanceName};
|
||||||
use mlua::{Lua, Result, Table};
|
use mlua::{Lua, Result, Table};
|
||||||
|
|
||||||
|
use super::{Client, Direction, Vec3};
|
||||||
|
|
||||||
pub fn best_tool_for_block(lua: &Lua, client: &Client, block_state: u16) -> Result<Table> {
|
pub fn best_tool_for_block(lua: &Lua, client: &Client, block_state: u16) -> Result<Table> {
|
||||||
let result = client.best_tool_in_hotbar_for_block(BlockState { id: block_state });
|
let result = client.best_tool_in_hotbar_for_block(BlockState { id: block_state });
|
||||||
let table = lua.create_table()?;
|
let table = lua.create_table()?;
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
use crate::ListenerMap;
|
use std::time::{SystemTime, UNIX_EPOCH};
|
||||||
|
|
||||||
use futures::executor::block_on;
|
use futures::executor::block_on;
|
||||||
use mlua::{Function, Lua, Result, Table};
|
use mlua::{Function, Lua, Result, Table};
|
||||||
use std::time::{SystemTime, UNIX_EPOCH};
|
|
||||||
|
use crate::ListenerMap;
|
||||||
|
|
||||||
pub fn register_globals(lua: &Lua, globals: &Table, event_listeners: ListenerMap) -> Result<()> {
|
pub fn register_globals(lua: &Lua, globals: &Table, event_listeners: ListenerMap) -> Result<()> {
|
||||||
let m = event_listeners.clone();
|
let m = event_listeners.clone();
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
use super::room::Room;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use matrix_sdk::{
|
use matrix_sdk::{
|
||||||
Client as MatrixClient,
|
Client as MatrixClient,
|
||||||
ruma::{RoomId, UserId},
|
ruma::{RoomId, UserId},
|
||||||
};
|
};
|
||||||
use mlua::{Error, UserData, UserDataFields, UserDataMethods};
|
use mlua::{Error, UserData, UserDataFields, UserDataMethods};
|
||||||
use std::sync::Arc;
|
|
||||||
|
use super::room::Room;
|
||||||
|
|
||||||
pub struct Client(pub Arc<MatrixClient>);
|
pub struct Client(pub Arc<MatrixClient>);
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
use super::member::Member;
|
|
||||||
use matrix_sdk::{
|
use matrix_sdk::{
|
||||||
RoomMemberships,
|
RoomMemberships,
|
||||||
room::Room as MatrixRoom,
|
room::Room as MatrixRoom,
|
||||||
@ -6,6 +5,8 @@ use matrix_sdk::{
|
|||||||
};
|
};
|
||||||
use mlua::{Error, UserData, UserDataFields, UserDataMethods};
|
use mlua::{Error, UserData, UserDataFields, UserDataMethods};
|
||||||
|
|
||||||
|
use super::member::Member;
|
||||||
|
|
||||||
pub struct Room(pub MatrixRoom);
|
pub struct Room(pub MatrixRoom);
|
||||||
|
|
||||||
impl UserData for Room {
|
impl UserData for Room {
|
||||||
|
@ -13,13 +13,15 @@ pub mod vec3;
|
|||||||
#[cfg(feature = "matrix")]
|
#[cfg(feature = "matrix")]
|
||||||
pub mod matrix;
|
pub mod matrix;
|
||||||
|
|
||||||
use crate::{ListenerMap, build_info::built};
|
|
||||||
use mlua::{Lua, Table};
|
|
||||||
use std::{
|
use std::{
|
||||||
fmt::{self, Display, Formatter},
|
fmt::{self, Display, Formatter},
|
||||||
io,
|
io,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use mlua::{Lua, Table};
|
||||||
|
|
||||||
|
use crate::{ListenerMap, build_info::built};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
CreateEnv(mlua::Error),
|
CreateEnv(mlua::Error),
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
use log::error;
|
|
||||||
use mlua::{Lua, Result, Table};
|
|
||||||
use std::{
|
use std::{
|
||||||
ffi::OsString,
|
ffi::OsString,
|
||||||
process::{Command, Stdio},
|
process::{Command, Stdio},
|
||||||
thread,
|
thread,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use log::error;
|
||||||
|
use mlua::{Lua, Result, Table};
|
||||||
|
|
||||||
pub fn register_globals(lua: &Lua, globals: &Table) -> Result<()> {
|
pub fn register_globals(lua: &Lua, globals: &Table) -> Result<()> {
|
||||||
globals.set(
|
globals.set(
|
||||||
"system",
|
"system",
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
use mlua::{Error, Function, Lua, Result, Table};
|
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
|
use mlua::{Error, Function, Lua, Result, Table};
|
||||||
use tokio::time::{sleep, timeout};
|
use tokio::time::{sleep, timeout};
|
||||||
|
|
||||||
pub fn register_globals(lua: &Lua, globals: &Table) -> Result<()> {
|
pub fn register_globals(lua: &Lua, globals: &Table) -> Result<()> {
|
||||||
|
13
src/main.rs
13
src/main.rs
@ -13,6 +13,13 @@ mod replay;
|
|||||||
#[cfg(feature = "matrix")]
|
#[cfg(feature = "matrix")]
|
||||||
mod matrix;
|
mod matrix;
|
||||||
|
|
||||||
|
use std::{
|
||||||
|
collections::HashMap,
|
||||||
|
env,
|
||||||
|
fs::{OpenOptions, read_to_string},
|
||||||
|
sync::Arc,
|
||||||
|
};
|
||||||
|
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use arguments::Arguments;
|
use arguments::Arguments;
|
||||||
use azalea::{
|
use azalea::{
|
||||||
@ -31,12 +38,6 @@ use hacks::HacksPlugin;
|
|||||||
use log::debug;
|
use log::debug;
|
||||||
use mlua::{Function, Lua, Table};
|
use mlua::{Function, Lua, Table};
|
||||||
use replay::{plugin::RecordPlugin, recorder::Recorder};
|
use replay::{plugin::RecordPlugin, recorder::Recorder};
|
||||||
use std::{
|
|
||||||
collections::HashMap,
|
|
||||||
env,
|
|
||||||
fs::{OpenOptions, read_to_string},
|
|
||||||
sync::Arc,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[cfg(feature = "mimalloc")]
|
#[cfg(feature = "mimalloc")]
|
||||||
#[global_allocator]
|
#[global_allocator]
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
use super::Context;
|
use std::time::Duration;
|
||||||
use crate::{
|
|
||||||
events::call_listeners,
|
|
||||||
lua::{eval, exec, matrix::room::Room as LuaRoom, reload},
|
|
||||||
};
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use log::{debug, error};
|
use log::{debug, error};
|
||||||
use matrix_sdk::{
|
use matrix_sdk::{
|
||||||
@ -13,9 +10,14 @@ use matrix_sdk::{
|
|||||||
message::{MessageType, OriginalSyncRoomMessageEvent, RoomMessageEventContent},
|
message::{MessageType, OriginalSyncRoomMessageEvent, RoomMessageEventContent},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use std::time::Duration;
|
|
||||||
use tokio::time::sleep;
|
use tokio::time::sleep;
|
||||||
|
|
||||||
|
use super::Context;
|
||||||
|
use crate::{
|
||||||
|
events::call_listeners,
|
||||||
|
lua::{eval, exec, matrix::room::Room as LuaRoom, reload},
|
||||||
|
};
|
||||||
|
|
||||||
pub async fn on_regular_room_message(
|
pub async fn on_regular_room_message(
|
||||||
event: OriginalSyncRoomMessageEvent,
|
event: OriginalSyncRoomMessageEvent,
|
||||||
room: Room,
|
room: Room,
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
mod bot;
|
mod bot;
|
||||||
mod verification;
|
mod verification;
|
||||||
|
|
||||||
use crate::{State, lua::matrix::client::Client as LuaClient};
|
use std::{path::Path, sync::Arc};
|
||||||
|
|
||||||
use anyhow::{Context as _, Result};
|
use anyhow::{Context as _, Result};
|
||||||
use bot::{on_regular_room_message, on_stripped_state_member};
|
use bot::{on_regular_room_message, on_stripped_state_member};
|
||||||
use log::{error, warn};
|
use log::{error, warn};
|
||||||
@ -10,10 +11,11 @@ use matrix_sdk::{
|
|||||||
};
|
};
|
||||||
use mlua::Table;
|
use mlua::Table;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::{path::Path, sync::Arc};
|
|
||||||
use tokio::fs;
|
use tokio::fs;
|
||||||
use verification::{on_device_key_verification_request, on_room_message_verification_request};
|
use verification::{on_device_key_verification_request, on_room_message_verification_request};
|
||||||
|
|
||||||
|
use crate::{State, lua::matrix::client::Client as LuaClient};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct Context {
|
pub struct Context {
|
||||||
state: State,
|
state: State,
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
use std::time::Duration;
|
||||||
|
|
||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
use log::{error, info, warn};
|
use log::{error, info, warn};
|
||||||
@ -15,7 +17,6 @@ use matrix_sdk::{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use std::time::Duration;
|
|
||||||
use tokio::time::sleep;
|
use tokio::time::sleep;
|
||||||
|
|
||||||
async fn confirm_emojis(sas: SasVerification, emoji: [Emoji; 7]) {
|
async fn confirm_emojis(sas: SasVerification, emoji: [Emoji; 7]) {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#![allow(clippy::needless_pass_by_value)]
|
#![allow(clippy::needless_pass_by_value)]
|
||||||
|
|
||||||
use super::recorder::Recorder;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use azalea::{
|
use azalea::{
|
||||||
ecs::{event::EventReader, system::Query},
|
ecs::{event::EventReader, system::Query},
|
||||||
packet::{
|
packet::{
|
||||||
@ -15,7 +16,8 @@ use bevy_app::{First, Plugin};
|
|||||||
use bevy_ecs::{schedule::IntoSystemConfigs, system::ResMut};
|
use bevy_ecs::{schedule::IntoSystemConfigs, system::ResMut};
|
||||||
use log::error;
|
use log::error;
|
||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
use std::sync::Arc;
|
|
||||||
|
use super::recorder::Recorder;
|
||||||
|
|
||||||
pub struct RecordPlugin {
|
pub struct RecordPlugin {
|
||||||
pub recorder: Arc<Mutex<Option<Recorder>>>,
|
pub recorder: Arc<Mutex<Option<Recorder>>>,
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
use crate::build_info;
|
use std::{
|
||||||
|
fs::File,
|
||||||
|
io::{BufWriter, Write},
|
||||||
|
time::{Instant, SystemTime, UNIX_EPOCH},
|
||||||
|
};
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use azalea::{
|
use azalea::{
|
||||||
buf::AzaleaWriteVar,
|
buf::AzaleaWriteVar,
|
||||||
@ -7,13 +12,10 @@ use azalea::{
|
|||||||
};
|
};
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
use std::{
|
|
||||||
fs::File,
|
|
||||||
io::{BufWriter, Write},
|
|
||||||
time::{Instant, SystemTime, UNIX_EPOCH},
|
|
||||||
};
|
|
||||||
use zip::{ZipWriter, write::SimpleFileOptions};
|
use zip::{ZipWriter, write::SimpleFileOptions};
|
||||||
|
|
||||||
|
use crate::build_info;
|
||||||
|
|
||||||
#[derive(Resource)]
|
#[derive(Resource)]
|
||||||
pub struct Recorder {
|
pub struct Recorder {
|
||||||
zip_writer: BufWriter<ZipWriter<File>>,
|
zip_writer: BufWriter<ZipWriter<File>>,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user