server from db working
This commit is contained in:
13
src/main.rs
13
src/main.rs
@ -6,7 +6,7 @@
|
||||
/* By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/05/29 21:22:17 by tomoron #+# #+# */
|
||||
/* Updated: 2026/05/29 21:31:39 by tomoron ### ########.fr */
|
||||
/* Updated: 2026/05/31 15:02:01 by tomoron ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -41,10 +41,13 @@ use diesel::{prelude::*, r2d2::{ConnectionManager, Pool}};
|
||||
|
||||
use std::env;
|
||||
|
||||
//pub mod status;
|
||||
pub mod schema;
|
||||
pub mod models;
|
||||
|
||||
//use status::ServerStatus;
|
||||
//
|
||||
pub mod status;
|
||||
|
||||
use status::ServerStatus;
|
||||
use crate::models::Servers;
|
||||
|
||||
|
||||
pub type DbPool = Pool<ConnectionManager<PgConnection>>;
|
||||
@ -66,6 +69,8 @@ async fn main() -> io::Result<()> {
|
||||
let mc_listener = TcpListener::bind("0.0.0.0:25565").await?;
|
||||
let rpc_listener = TcpListener::bind("0.0.0.0:8080").await?;
|
||||
|
||||
// let servers = schema::servers::table.select(Servers::as_select()).load(conn).unwrap();
|
||||
|
||||
loop {
|
||||
tokio::select! {
|
||||
Ok((socket, _)) = mc_listener.accept() => {
|
||||
|
||||
Reference in New Issue
Block a user