veloren_server/
presence.rs

1use hashbrown::HashSet;
2use serde::{Deserialize, Serialize};
3use specs::{Component, VecStorage};
4use vek::*;
5
6// Distance from fuzzy_chunk before snapping to current chunk
7pub const CHUNK_FUZZ: u32 = 2;
8// Distance out of the range of a region before removing it from subscriptions
9pub const REGION_FUZZ: u32 = 16;
10
11#[derive(Clone, Debug)]
12pub struct RegionSubscription {
13    pub fuzzy_chunk: Vec2<i32>,
14    pub last_entity_view_distance: u32,
15    pub regions: HashSet<Vec2<i32>>,
16}
17
18impl Component for RegionSubscription {
19    type Storage = specs::DenseVecStorage<Self>;
20}
21
22#[derive(Copy, Clone, Debug, Default, Serialize, Deserialize)]
23pub struct RepositionOnChunkLoad {
24    pub needs_ground: bool,
25}
26
27impl Component for RepositionOnChunkLoad {
28    type Storage = VecStorage<Self>;
29}