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::RECEIVE_BUFFER_SIZE;
|
||||||
use kawari::common::Position;
|
use kawari::common::Position;
|
||||||
use kawari::common::{GameData, ObjectId, timestamp_secs};
|
use kawari::common::{GameData, timestamp_secs};
|
||||||
use kawari::config::get_config;
|
use kawari::config::get_config;
|
||||||
use kawari::inventory::Item;
|
use kawari::inventory::Item;
|
||||||
use kawari::ipc::chat::{ServerChatIpcData, ServerChatIpcSegment};
|
use kawari::ipc::chat::{ServerChatIpcData, ServerChatIpcSegment};
|
||||||
|
@ -21,11 +21,11 @@ use kawari::packet::oodle::OodleNetwork;
|
||||||
use kawari::packet::{
|
use kawari::packet::{
|
||||||
ConnectionType, PacketSegment, PacketState, SegmentData, SegmentType, send_keep_alive,
|
ConnectionType, PacketSegment, PacketState, SegmentData, SegmentType, send_keep_alive,
|
||||||
};
|
};
|
||||||
|
use kawari::world::{ChatHandler, Zone, ZoneConnection};
|
||||||
use kawari::world::{
|
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,
|
StatusEffects, ToServer, WorldDatabase, handle_custom_ipc, server_main_loop,
|
||||||
};
|
};
|
||||||
use kawari::world::{ChatHandler, Zone, ZoneConnection};
|
|
||||||
|
|
||||||
use mlua::{Function, Lua};
|
use mlua::{Function, Lua};
|
||||||
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
||||||
|
@ -64,8 +64,6 @@ fn spawn_main_loop() -> (ServerHandle, JoinHandle<()>) {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ClientData {
|
struct ClientData {
|
||||||
//id: ClientId,
|
|
||||||
// handle: ServerHandle,
|
|
||||||
/// Socket for data recieved from the global server
|
/// Socket for data recieved from the global server
|
||||||
recv: Receiver<FromServer>,
|
recv: Receiver<FromServer>,
|
||||||
connection: ZoneConnection,
|
connection: ZoneConnection,
|
||||||
|
@ -78,12 +76,7 @@ pub fn spawn_client(connection: ZoneConnection) {
|
||||||
let id = &connection.id.clone();
|
let id = &connection.id.clone();
|
||||||
let ip = &connection.ip.clone();
|
let ip = &connection.ip.clone();
|
||||||
|
|
||||||
let data = ClientData {
|
let data = ClientData { recv, connection };
|
||||||
//id: connection.id,
|
|
||||||
//handle: connection.handle.clone(),
|
|
||||||
recv,
|
|
||||||
connection,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Spawn a new client task
|
// Spawn a new client task
|
||||||
let (my_send, my_recv) = oneshot::channel();
|
let (my_send, my_recv) = oneshot::channel();
|
||||||
|
@ -96,7 +89,6 @@ pub fn spawn_client(connection: ZoneConnection) {
|
||||||
channel: send,
|
channel: send,
|
||||||
actor_id: 0,
|
actor_id: 0,
|
||||||
common: CommonSpawn::default(),
|
common: CommonSpawn::default(),
|
||||||
//kill,
|
|
||||||
};
|
};
|
||||||
let _ = my_send.send(handle);
|
let _ = my_send.send(handle);
|
||||||
}
|
}
|
||||||
|
|
|
@ -376,43 +376,27 @@ impl ZoneConnection {
|
||||||
pub async fn change_zone(&mut self, new_zone_id: u16) {
|
pub async fn change_zone(&mut self, new_zone_id: u16) {
|
||||||
// tell everyone we're gone
|
// tell everyone we're gone
|
||||||
// the connection already checks to see if the actor already exists, so it's seems harmless if we do
|
// 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
|
self.handle
|
||||||
.send(ToServer::LeftZone(
|
.send(ToServer::LeftZone(
|
||||||
self.id,
|
self.id,
|
||||||
self.player_data.actor_id,
|
self.player_data.actor_id,
|
||||||
self.zone.as_ref().unwrap().id,
|
zone.id,
|
||||||
))
|
))
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// load the new zone now
|
||||||
{
|
{
|
||||||
let mut game_data = self.gamedata.lock().unwrap();
|
let mut game_data = self.gamedata.lock().unwrap();
|
||||||
self.zone = Some(Zone::load(&mut game_data.game_data, new_zone_id));
|
self.zone = Some(Zone::load(&mut game_data.game_data, new_zone_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
self.player_data.zone_id = new_zone_id;
|
self.player_data.zone_id = new_zone_id;
|
||||||
|
|
||||||
// Player Class Info
|
// Player Class Info
|
||||||
self.update_class_info().await;
|
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
|
// Init Zone
|
||||||
{
|
{
|
||||||
let config = get_config();
|
let config = get_config();
|
||||||
|
|
Loading…
Add table
Reference in a new issue