mirror of
https://github.com/redstrate/Kawari.git
synced 2025-05-13 07:07:45 +00:00
Remove some dead, unused code
This commit is contained in:
parent
95fb6a149f
commit
dba4edc32d
2 changed files with 9 additions and 33 deletions
|
@ -4,7 +4,7 @@ use std::sync::{Arc, Mutex};
|
|||
|
||||
use kawari::RECEIVE_BUFFER_SIZE;
|
||||
use kawari::common::Position;
|
||||
use kawari::common::{GameData, ObjectId, timestamp_secs};
|
||||
use kawari::common::{GameData, timestamp_secs};
|
||||
use kawari::config::get_config;
|
||||
use kawari::inventory::Item;
|
||||
use kawari::ipc::chat::{ServerChatIpcData, ServerChatIpcSegment};
|
||||
|
@ -21,11 +21,11 @@ use kawari::packet::oodle::OodleNetwork;
|
|||
use kawari::packet::{
|
||||
ConnectionType, PacketSegment, PacketState, SegmentData, SegmentType, send_keep_alive,
|
||||
};
|
||||
use kawari::world::{ChatHandler, Zone, ZoneConnection};
|
||||
use kawari::world::{
|
||||
Actor, ClientHandle, EffectsBuilder, Event, FromServer, LuaPlayer, PlayerData, ServerHandle,
|
||||
ClientHandle, EffectsBuilder, Event, FromServer, LuaPlayer, PlayerData, ServerHandle,
|
||||
StatusEffects, ToServer, WorldDatabase, handle_custom_ipc, server_main_loop,
|
||||
};
|
||||
use kawari::world::{ChatHandler, Zone, ZoneConnection};
|
||||
|
||||
use mlua::{Function, Lua};
|
||||
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
||||
|
@ -64,8 +64,6 @@ fn spawn_main_loop() -> (ServerHandle, JoinHandle<()>) {
|
|||
}
|
||||
|
||||
struct ClientData {
|
||||
//id: ClientId,
|
||||
// handle: ServerHandle,
|
||||
/// Socket for data recieved from the global server
|
||||
recv: Receiver<FromServer>,
|
||||
connection: ZoneConnection,
|
||||
|
@ -78,12 +76,7 @@ pub fn spawn_client(connection: ZoneConnection) {
|
|||
let id = &connection.id.clone();
|
||||
let ip = &connection.ip.clone();
|
||||
|
||||
let data = ClientData {
|
||||
//id: connection.id,
|
||||
//handle: connection.handle.clone(),
|
||||
recv,
|
||||
connection,
|
||||
};
|
||||
let data = ClientData { recv, connection };
|
||||
|
||||
// Spawn a new client task
|
||||
let (my_send, my_recv) = oneshot::channel();
|
||||
|
@ -96,7 +89,6 @@ pub fn spawn_client(connection: ZoneConnection) {
|
|||
channel: send,
|
||||
actor_id: 0,
|
||||
common: CommonSpawn::default(),
|
||||
//kill,
|
||||
};
|
||||
let _ = my_send.send(handle);
|
||||
}
|
||||
|
|
|
@ -376,43 +376,27 @@ impl ZoneConnection {
|
|||
pub async fn change_zone(&mut self, new_zone_id: u16) {
|
||||
// tell everyone we're gone
|
||||
// the connection already checks to see if the actor already exists, so it's seems harmless if we do
|
||||
if self.zone.is_some() {
|
||||
if let Some(zone) = &self.zone {
|
||||
self.handle
|
||||
.send(ToServer::LeftZone(
|
||||
self.id,
|
||||
self.player_data.actor_id,
|
||||
self.zone.as_ref().unwrap().id,
|
||||
zone.id,
|
||||
))
|
||||
.await;
|
||||
}
|
||||
|
||||
// load the new zone now
|
||||
{
|
||||
let mut game_data = self.gamedata.lock().unwrap();
|
||||
self.zone = Some(Zone::load(&mut game_data.game_data, new_zone_id));
|
||||
}
|
||||
|
||||
self.player_data.zone_id = new_zone_id;
|
||||
|
||||
// Player Class Info
|
||||
self.update_class_info().await;
|
||||
|
||||
// link shell information
|
||||
/*{
|
||||
let ipc = ServerZoneIpcSegment {
|
||||
op_code: ServerZoneIpcType::LinkShellInformation,
|
||||
timestamp: timestamp_secs(),
|
||||
data: ServerZoneIpcData::LinkShellInformation { unk: [0; 456] },
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
self.send_segment(PacketSegment {
|
||||
source_actor: self.player_data.actor_id,
|
||||
target_actor: self.player_data.actor_id,
|
||||
segment_type: SegmentType::Ipc { data: ipc },
|
||||
})
|
||||
.await;
|
||||
}*/
|
||||
|
||||
// TODO: send unk16?
|
||||
|
||||
// Init Zone
|
||||
{
|
||||
let config = get_config();
|
||||
|
|
Loading…
Add table
Reference in a new issue