tile-mmo/server/src/main.rs

51 lines
1.5 KiB
Rust

use std::net::{SocketAddr, SocketAddrV4};
use quinn::{Connection, ConnectionError};
pub mod data;
bitflags::bitflags! {
/// This likely won't be relevant until much later, but feel free to add any ideas for
/// capabilities in the meantime.
#[allow(dead_code)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct RegionCapabilities: u32 {
/// Support 8x8 pixel tiles
const EightByEightTiles = 0x00000001;
/// Support 16x16 pixel tiles
const SixteenBySixteenTiles = 0x00000002;
/// Support 32x32 pixel tiles
const ThirtyTwoByThirtyTwoTiles = 0x00000004;
/// Support arbitrarily large tiles (but still square and consistent within zones/chunks)
const ArbitrarilyLargeTiles = 0x00000008;
/// Support tiles with rectangular dimensions
const NonSquareTiles = 0x00000010;
/// Support layers with different tile sizes on the same zone/chunk
const NonMatchingTileSizes = 0x00000010;
}
}
#[tokio::main]
async fn main() {
let endpoint = quinn::Endpoint::server(
quinn::ServerConfig::default(),
SocketAddr::V4(SocketAddrV4::new("0.0.0.0".parse().unwrap(), 8888))
).unwrap();
loop {
if let Some(connecting) = endpoint.accept().await {
match connecting.await {
Ok(conn) => {
}
Err(e) => {
}
}
}
}
}