binary refactor
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
name = "openworm"
|
name = "openworm"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
default-run = "client"
|
default-run = "openworm-client"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
arboard = { version = "3.6.1", features = ["wayland-data-control"] }
|
arboard = { version = "3.6.1", features = ["wayland-data-control"] }
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
#![windows_subsystem = "windows"]
|
|
||||||
|
|
||||||
use openworm::{client::App, net::install_crypto_provider};
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
install_crypto_provider();
|
|
||||||
App::run();
|
|
||||||
}
|
|
||||||
@@ -7,7 +7,7 @@ use winit::{
|
|||||||
window::{Window, WindowId},
|
window::{Window, WindowId},
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::client::ClientEvent;
|
use crate::ClientEvent;
|
||||||
|
|
||||||
use super::Client;
|
use super::Client;
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
@@ -1,29 +1,33 @@
|
|||||||
use std::sync::Arc;
|
#![windows_subsystem = "windows"]
|
||||||
|
|
||||||
pub use app::App;
|
use crate::{app::App, net::NetSender, ui::*};
|
||||||
|
pub use app::AppHandle;
|
||||||
use arboard::Clipboard;
|
use arboard::Clipboard;
|
||||||
use input::Input;
|
use input::Input;
|
||||||
use iris::prelude::*;
|
use iris::prelude::*;
|
||||||
|
use openworm::{
|
||||||
|
net::{ClientMsg, ServerMsg, install_crypto_provider},
|
||||||
|
rsc::{CLIENT_DATA, ClientData, DataDir},
|
||||||
|
};
|
||||||
use render::Renderer;
|
use render::Renderer;
|
||||||
|
use std::sync::Arc;
|
||||||
use winit::{
|
use winit::{
|
||||||
event::{Ime, WindowEvent},
|
event::{Ime, WindowEvent},
|
||||||
event_loop::{ActiveEventLoop, EventLoopProxy},
|
event_loop::{ActiveEventLoop, EventLoopProxy},
|
||||||
window::Window,
|
window::Window,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
fn main() {
|
||||||
client::ui::{Edited, Submit, main_view, msg_widget},
|
install_crypto_provider();
|
||||||
net::{ClientMsg, ServerMsg, client::NetSender},
|
App::run();
|
||||||
rsc::{CLIENT_DATA, ClientData, DataDir},
|
}
|
||||||
};
|
|
||||||
|
|
||||||
mod app;
|
mod app;
|
||||||
mod input;
|
mod input;
|
||||||
|
mod net;
|
||||||
mod render;
|
mod render;
|
||||||
mod ui;
|
mod ui;
|
||||||
|
|
||||||
pub use app::AppHandle;
|
|
||||||
|
|
||||||
pub enum ClientEvent {
|
pub enum ClientEvent {
|
||||||
Connect { send: NetSender, username: String },
|
Connect { send: NetSender, username: String },
|
||||||
ServerMsg(ServerMsg),
|
ServerMsg(ServerMsg),
|
||||||
@@ -1,10 +1,6 @@
|
|||||||
use crate::{
|
use crate::{AppHandle, ClientEvent};
|
||||||
client::{AppHandle, ClientEvent},
|
use openworm::net::{
|
||||||
net::{
|
ClientMsg, RecvHandler, SERVER_NAME, ServerMsg, SkipServerVerification, recv_uni, send_uni,
|
||||||
ClientMsg, SERVER_NAME, ServerMsg,
|
|
||||||
no_cert::SkipServerVerification,
|
|
||||||
transfer::{RecvHandler, recv_uni, send_uni},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
use quinn::{
|
use quinn::{
|
||||||
ClientConfig, Connection, Endpoint, IdleTimeout, TransportConfig,
|
ClientConfig, Connection, Endpoint, IdleTimeout, TransportConfig,
|
||||||
@@ -1,13 +1,11 @@
|
|||||||
use iris::prelude::*;
|
use iris::prelude::*;
|
||||||
use len_fns::*;
|
use len_fns::*;
|
||||||
|
use openworm::net::{ClientMsg, Msg};
|
||||||
use winit::dpi::{LogicalPosition, LogicalSize};
|
use winit::dpi::{LogicalPosition, LogicalSize};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
client::Client,
|
Client,
|
||||||
net::{
|
net::{ConnectInfo, NetSender, connect},
|
||||||
ClientMsg, Msg,
|
|
||||||
client::{ConnectInfo, NetSender, connect},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Eq, PartialEq, Hash, Clone)]
|
#[derive(Eq, PartialEq, Hash, Clone)]
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
use openworm::{net::install_crypto_provider, server::run_server};
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
install_crypto_provider();
|
|
||||||
run_server();
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
use crate::{
|
mod net;
|
||||||
net::{
|
|
||||||
ClientMsg, Msg, ServerMsg,
|
use net::{ClientSender, ConAccepter, listen};
|
||||||
server::{ClientSender, ConAccepter, listen},
|
use openworm::{
|
||||||
transfer::{DisconnectReason, RecvHandler},
|
net::{ClientMsg, DisconnectReason, Msg, RecvHandler, ServerMsg, install_crypto_provider},
|
||||||
},
|
|
||||||
rsc::DataDir,
|
rsc::DataDir,
|
||||||
};
|
};
|
||||||
use std::{
|
use std::{
|
||||||
@@ -15,6 +14,11 @@ use std::{
|
|||||||
};
|
};
|
||||||
use tokio::sync::RwLock;
|
use tokio::sync::RwLock;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
install_crypto_provider();
|
||||||
|
run_server();
|
||||||
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
pub async fn run_server() {
|
pub async fn run_server() {
|
||||||
let dir = DataDir::default();
|
let dir = DataDir::default();
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
use crate::net::{
|
use openworm::net::{
|
||||||
ClientMsg, SERVER_NAME, ServerMsg,
|
ClientMsg, RecvHandler, SERVER_NAME, SendResult, ServerMsg, recv_uni, send_uni,
|
||||||
transfer::{RecvHandler, SendResult, recv_uni, send_uni},
|
|
||||||
};
|
};
|
||||||
use quinn::{
|
use quinn::{
|
||||||
Connection, Endpoint, ServerConfig,
|
Connection, Endpoint, ServerConfig,
|
||||||
@@ -1,4 +1,2 @@
|
|||||||
pub mod client;
|
|
||||||
pub mod net;
|
pub mod net;
|
||||||
pub mod server;
|
|
||||||
pub mod rsc;
|
pub mod rsc;
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
use bincode::config::Configuration;
|
use bincode::config::Configuration;
|
||||||
|
|
||||||
pub mod client;
|
|
||||||
mod no_cert;
|
mod no_cert;
|
||||||
pub mod server;
|
mod transfer;
|
||||||
pub mod transfer;
|
|
||||||
|
pub use no_cert::*;
|
||||||
|
pub use transfer::*;
|
||||||
|
|
||||||
pub const SERVER_NAME: &str = "openworm";
|
pub const SERVER_NAME: &str = "openworm";
|
||||||
pub const BINCODE_CONFIG: Configuration = bincode::config::standard();
|
pub const BINCODE_CONFIG: Configuration = bincode::config::standard();
|
||||||
|
|||||||
Reference in New Issue
Block a user