wicked-waifus-rs/wicked-waifus-game-server/src/logic/handler/inventory.rs
xavo95 4d6b79aa29 2.4.1 (#9)
Review this, includes:

- Unlocks for weapons
    - All weapons unlock
    - Max level weapons
    - Max resonance weapons
- Fixed unlocks for roles, now max level, breakthrought and resonance come from bindata
- Unlocks for all skin types(flight, wing, role, skin)
- Weapon inventory implemented
- Change role skin implemented
- Change weapon skin implmented
- Change flight skin implemented
- Change wing skin implemented
- Change weapon implemented(basic, no attributes, no switch)
- Created SequenceGenerator to emulate sql sequences with reusable ids

Known bugs:

- In prod only one projection can be equipped simulataneously, we dont care :xdskull:
- Change skin will plot with invalid Rotation so a change of character is required, investigate this

Reviewed-on: WutheringSlaves/wicked-waifus-rs#9
Reviewed-by: RabbyDevs <rabbydevs@gmail.com>
2025-05-23 01:33:05 +00:00

45 lines
1.6 KiB
Rust

use wicked_waifus_protocol::{ItemExchangeInfo, ItemExchangeInfoRequest, ItemExchangeInfoResponse, NormalItemRequest, NormalItemResponse, PhantomItemRequest, PhantomItemResponse, WeaponItemRequest, WeaponItemResponse};
use crate::logic::player::Player;
pub fn on_normal_item_request(
player: &mut Player,
_: NormalItemRequest,
response: &mut NormalItemResponse,
) {
tracing::debug!("Received NormalItemRequest, returning player inventory");
response.normal_item_list = player.inventory.to_normal_item_list();
}
pub fn on_weapon_item_request(
player: &mut Player,
_: WeaponItemRequest,
response: &mut WeaponItemResponse,
) {
response.weapon_item_list = player.inventory.to_weapon_item_list();
}
pub fn on_phantom_item_request(
_player: &mut Player,
_: PhantomItemRequest,
_response: &mut PhantomItemResponse,
) {
// TODO: Implement this
tracing::warn!("Unhandled PhantomItemRequest");
}
pub fn on_item_exchange_info_request(
_player: &mut Player,
_: ItemExchangeInfoRequest,
response: &mut ItemExchangeInfoResponse,
) {
response.item_exchange_infos = wicked_waifus_data::item_exchange_content_data::iter()
.map(|item_exchange_content_data| ItemExchangeInfo {
item_id: item_exchange_content_data.item_id,
today_times: 0, // TODO: For stats only, not used for PS so far
total_times: 0, // TODO: For stats only, not used for PS so far
daily_limit: 0, // At the time of writing there is no limits
total_limit: 0, // At the time of writing there is no limits
})
.collect();
}