1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-04-20 14:47:45 +00:00

Run Clippy auto-fix, disable large enum size warning

This commit is contained in:
Joshua Goins 2025-03-23 18:14:14 -04:00
parent 70ec1b99c9
commit c29f8ad7df
10 changed files with 34 additions and 16 deletions

View file

@ -11,16 +11,15 @@ use kawari::packet::{
send_packet,
};
use kawari::world::ipc::{
ClientZoneIpcData, CommonSpawn, ContainerInfo, ContainerType, DisplayFlag,
GameMasterCommandType, GameMasterRank, ItemInfo, ObjectKind, OnlineStatus, PlayerSubKind,
ServerZoneIpcData, ServerZoneIpcSegment, ServerZoneIpcType, SocialListRequestType,
StatusEffect,
ClientZoneIpcData, CommonSpawn, DisplayFlag, GameMasterCommandType, GameMasterRank, ObjectKind,
OnlineStatus, PlayerSubKind, ServerZoneIpcData, ServerZoneIpcSegment, ServerZoneIpcType,
SocialListRequestType, StatusEffect,
};
use kawari::world::{
ChatHandler, Inventory, Zone, ZoneConnection,
ipc::{
ActorControl, ActorControlCategory, ActorControlSelf, PlayerEntry, PlayerSetup,
PlayerSpawn, PlayerStats, SocialList,
ActorControlCategory, ActorControlSelf, PlayerEntry, PlayerSetup, PlayerSpawn, PlayerStats,
SocialList,
},
};
use kawari::world::{PlayerData, WorldDatabase};
@ -781,7 +780,7 @@ async fn main() {
"creating character from: {name} {chara_make_json}"
);
let chara_make = CharaMake::from_json(&chara_make_json);
let chara_make = CharaMake::from_json(chara_make_json);
let city_state =
get_citystate(chara_make.classjob_id as u16);

View file

@ -1,5 +1,7 @@
//! A server replacement for a certain MMO.
#![allow(clippy::large_enum_variant)]
use std::collections::HashMap;
use minijinja::Environment;

View file

@ -14,6 +14,12 @@ pub enum LoginError {
InternalError,
}
impl Default for LoginDatabase {
fn default() -> Self {
Self::new()
}
}
impl LoginDatabase {
pub fn new() -> Self {
let connection = Connection::open("login.db").expect("Failed to open database!");

View file

@ -1,6 +1,6 @@
mod packet;
use packet::PacketHeader;
pub use packet::{
mod parsing;
use parsing::PacketHeader;
pub use parsing::{
ConnectionType, PacketSegment, PacketState, SegmentType, parse_packet, send_keep_alive,
send_packet,
};

View file

@ -1,11 +1,11 @@
use crate::{
common::{CustomizeData, INVALID_OBJECT_ID, ObjectId, ObjectTypeId, Position, timestamp_secs},
common::{CustomizeData, ObjectId, ObjectTypeId, Position, timestamp_secs},
config::get_config,
packet::{PacketSegment, SegmentType},
world::ipc::{
ActorControl, ActorControlCategory, BattleNpcSubKind, CommonSpawn, DisplayFlag, NpcSpawn,
ObjectKind, PlayerSpawn, PlayerSubKind, ServerZoneIpcData, ServerZoneIpcSegment,
ServerZoneIpcType, StatusEffectList,
ServerZoneIpcType,
},
};
@ -135,7 +135,6 @@ impl ChatHandler {
warp_finish_anim: 0x0,
raise_anim: 0x0,
},
..Default::default()
}),
};

View file

@ -174,7 +174,7 @@ impl ZoneConnection {
pub async fn send_inventory(&mut self) {
// item list
{
let equipped = self.inventory.equipped.clone();
let equipped = self.inventory.equipped;
let mut send_slot = async |slot_index: u16, item: &Item| {
let ipc = ServerZoneIpcSegment {

View file

@ -21,6 +21,12 @@ pub struct CharacterData {
pub zone_id: u16,
}
impl Default for WorldDatabase {
fn default() -> Self {
Self::new()
}
}
impl WorldDatabase {
pub fn new() -> Self {
let connection = Connection::open("world.db").expect("Failed to open database!");

View file

@ -56,6 +56,12 @@ pub struct Inventory {
pub equipped: EquippedContainer,
}
impl Default for Inventory {
fn default() -> Self {
Self::new()
}
}
impl Inventory {
pub fn new() -> Self {
Self {

View file

@ -3,8 +3,8 @@ use binrw::binrw;
use bitflags::bitflags;
use crate::common::{
CHAR_NAME_MAX_LENGTH, CustomizeData, INVALID_OBJECT_ID, ObjectId, ObjectTypeId, Position,
read_string, write_string,
CHAR_NAME_MAX_LENGTH, CustomizeData, ObjectId, ObjectTypeId, Position, read_string,
write_string,
};
use super::StatusEffect;