diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-08 17:16:06 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-08 17:16:06 +0200 |
commit | 70bb8744cd742dc6c8a71ab174e4a1b058c7bec8 (patch) | |
tree | 78c5a190856f1c6281e8773a05408ede02a13947 /server/src/game.rs | |
parent | a1921104e13c9cf39439ee424d54f7cece67fc5b (diff) | |
download | hurrycurry-70bb8744cd742dc6c8a71ab174e4a1b058c7bec8.tar hurrycurry-70bb8744cd742dc6c8a71ab174e4a1b058c7bec8.tar.bz2 hurrycurry-70bb8744cd742dc6c8a71ab174e4a1b058c7bec8.tar.zst |
split off protocol into its own crate
Diffstat (limited to 'server/src/game.rs')
-rw-r--r-- | server/src/game.rs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/server/src/game.rs b/server/src/game.rs index 851d485c..daf08ad3 100644 --- a/server/src/game.rs +++ b/server/src/game.rs @@ -20,16 +20,16 @@ use crate::{ data::Gamedata, entity::{Entity, EntityT}, interaction::{interact, tick_slot, InteractEffect, TickEffect}, - protocol::{ - ItemIndex, ItemLocation, Message, PacketC, PacketS, PlayerID, RecipeIndex, TileIndex, - }, }; use anyhow::{anyhow, bail, Result}; use glam::{IVec2, Vec2}; +use hurrycurry_protocol::{ + ClientGamedata, ItemIndex, ItemLocation, Message, PacketC, PacketS, PlayerID, RecipeIndex, + TileIndex, +}; use log::{info, warn}; use std::{ collections::{HashMap, VecDeque}, - ops::Deref, sync::Arc, time::{Duration, Instant}, }; @@ -164,7 +164,13 @@ impl Game { pub fn prime_client(&self) -> Vec<PacketC> { let mut out = Vec::new(); out.push(PacketC::Data { - data: self.data.deref().to_owned(), + data: ClientGamedata { + item_names: self.data.item_names.clone(), + tile_names: self.data.tile_names.clone(), + tile_collide: self.data.tile_collide.clone(), + tile_interact: self.data.tile_interact.clone(), + map_names: self.data.map_names.clone(), + }, }); for (&id, player) in &self.players { out.push(PacketC::AddPlayer { |