diff options
| author | metamuffin <metamuffin@disroot.org> | 2025-10-11 22:25:31 +0200 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2025-10-11 22:25:31 +0200 |
| commit | 516546c3d20e1715370073acf2e6b8114351f8e9 (patch) | |
| tree | 19ebabed6785372015d801adfe744be778c00a05 /server/src/lib.rs | |
| parent | cdaa8e800276e28c720f846c91e144af97227db7 (diff) | |
| download | hurrycurry-516546c3d20e1715370073acf2e6b8114351f8e9.tar hurrycurry-516546c3d20e1715370073acf2e6b8114351f8e9.tar.bz2 hurrycurry-516546c3d20e1715370073acf2e6b8114351f8e9.tar.zst | |
Improve server logging and use central player id counter (close #450)
Diffstat (limited to 'server/src/lib.rs')
| -rw-r--r-- | server/src/lib.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/server/src/lib.rs b/server/src/lib.rs index 2d3a62cc..b29de4f4 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -25,11 +25,17 @@ pub mod server; pub mod state; use hurrycurry_protocol::glam::Vec2; -use std::random::random; +use std::{fmt::Display, random::random}; #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct ConnectionID(pub i64); +impl Display for ConnectionID { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "conn({})", self.0) + } +} + pub trait InterpolateExt { fn exp_to(&mut self, target: Self, dt: f32); } |