mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
[Server] Switched mpsc for crossbeam::channel.
This commit is contained in:
@ -25,16 +25,12 @@ use common::{
|
||||
vol::Vox,
|
||||
vol::{ReadVol, VolSize},
|
||||
};
|
||||
use crossbeam::channel;
|
||||
use hashbrown::HashSet;
|
||||
use log::debug;
|
||||
use rand::Rng;
|
||||
use specs::{join::Join, world::EntityBuilder as EcsEntityBuilder, Builder, Entity as EcsEntity};
|
||||
use std::{
|
||||
i32,
|
||||
net::SocketAddr,
|
||||
sync::{mpsc, Arc},
|
||||
time::Duration,
|
||||
};
|
||||
use std::{i32, net::SocketAddr, sync::Arc, time::Duration};
|
||||
use uvth::{ThreadPool, ThreadPoolBuilder};
|
||||
use vek::*;
|
||||
use world::{ChunkSupplement, World};
|
||||
@ -65,8 +61,8 @@ pub struct Server {
|
||||
clients: Clients,
|
||||
|
||||
thread_pool: ThreadPool,
|
||||
chunk_tx: mpsc::Sender<(Vec2<i32>, (TerrainChunk, ChunkSupplement))>,
|
||||
chunk_rx: mpsc::Receiver<(Vec2<i32>, (TerrainChunk, ChunkSupplement))>,
|
||||
chunk_tx: channel::Sender<(Vec2<i32>, (TerrainChunk, ChunkSupplement))>,
|
||||
chunk_rx: channel::Receiver<(Vec2<i32>, (TerrainChunk, ChunkSupplement))>,
|
||||
pending_chunks: HashSet<Vec2<i32>>,
|
||||
|
||||
server_settings: ServerSettings,
|
||||
@ -84,7 +80,7 @@ impl Server {
|
||||
|
||||
/// Create a new server bound to the given socket.
|
||||
pub fn bind<A: Into<SocketAddr>>(addrs: A, settings: ServerSettings) -> Result<Self, Error> {
|
||||
let (chunk_tx, chunk_rx) = mpsc::channel();
|
||||
let (chunk_tx, chunk_rx) = channel::unbounded();
|
||||
|
||||
let mut state = State::default();
|
||||
state
|
||||
|
Reference in New Issue
Block a user