Skip to content

Commit

Permalink
Temporary bonuses expiry
Browse files Browse the repository at this point in the history
  • Loading branch information
nmeylan committed Sep 21, 2024
1 parent 98b68ef commit 16ec6d4
Show file tree
Hide file tree
Showing 13 changed files with 997 additions and 872 deletions.
8 changes: 7 additions & 1 deletion lib/models/src/status_bonus.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::hash::Hasher;
use std::slice::Iter;
use std::slice::{Iter, IterMut};
use accessor::GettersAll;
use enum_macro::{WithMaskValueU64, WithStringValue};
use crate::enums::bonus::BonusType;
Expand Down Expand Up @@ -111,6 +111,12 @@ impl TemporaryStatusBonuses {
pub fn iter(&self) -> Iter<'_, TemporaryStatusBonus> {
self.0.iter()
}
pub fn iter_mut(&mut self) -> IterMut<'_, TemporaryStatusBonus> {
self.0.iter_mut()
}
pub fn retain(&mut self, f: impl Fn(&TemporaryStatusBonus) -> bool) {
self.0.retain(f)
}

pub fn add(&mut self, temporary_bonus: TemporaryStatusBonus) {
self.0.push(temporary_bonus)
Expand Down
84 changes: 42 additions & 42 deletions lib/packets/src/packets_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6057,8 +6057,8 @@ impl PacketZcNotifyMoveentry {
},
move_data_raw: {
let mut dst: [u8; 12] = [0u8; 12];
dst.clone_from_slice(&buffer[offset..offset + 6]);
offset += 6;
dst.clone_from_slice(&buffer[offset..offset + 12]);
offset += 12;
dst
},
x_size: {
Expand Down Expand Up @@ -53641,8 +53641,8 @@ impl PacketZcAutospelllist {
},
skid_raw: {
let mut dst: [u8; 28] = [0u8; 28];
dst.clone_from_slice(&buffer[offset..offset + 7]);
offset += 7;
dst.clone_from_slice(&buffer[offset..offset + 28]);
offset += 28;
dst
},
raw: (&buffer[..offset]).to_vec(),
Expand Down Expand Up @@ -53871,8 +53871,8 @@ impl PacketZcDevotionlist {
},
aid_raw: {
let mut dst: [u8; 20] = [0u8; 20];
dst.clone_from_slice(&buffer[offset..offset + 5]);
offset += 5;
dst.clone_from_slice(&buffer[offset..offset + 20]);
offset += 20;
dst
},
range: {
Expand Down Expand Up @@ -56608,8 +56608,8 @@ impl PacketZcNotifyMoveentry2 {
},
move_data_raw: {
let mut dst: [u8; 12] = [0u8; 12];
dst.clone_from_slice(&buffer[offset..offset + 6]);
offset += 6;
dst.clone_from_slice(&buffer[offset..offset + 12]);
offset += 12;
dst
},
x_size: {
Expand Down Expand Up @@ -66100,8 +66100,8 @@ impl PacketZcBlacksmithRank {
},
point_raw: {
let mut dst: [u8; 40] = [0u8; 40];
dst.clone_from_slice(&buffer[offset..offset + 10]);
offset += 10;
dst.clone_from_slice(&buffer[offset..offset + 40]);
offset += 40;
dst
},
raw: (&buffer[..offset]).to_vec(),
Expand Down Expand Up @@ -66244,8 +66244,8 @@ impl PacketZcAlchemistRank {
},
point_raw: {
let mut dst: [u8; 40] = [0u8; 40];
dst.clone_from_slice(&buffer[offset..offset + 10]);
offset += 10;
dst.clone_from_slice(&buffer[offset..offset + 40]);
offset += 40;
dst
},
raw: (&buffer[..offset]).to_vec(),
Expand Down Expand Up @@ -67779,8 +67779,8 @@ impl PacketZcTaekwonRank {
},
point_raw: {
let mut dst: [u8; 40] = [0u8; 40];
dst.clone_from_slice(&buffer[offset..offset + 10]);
offset += 10;
dst.clone_from_slice(&buffer[offset..offset + 40]);
offset += 40;
dst
},
raw: (&buffer[..offset]).to_vec(),
Expand Down Expand Up @@ -67907,8 +67907,8 @@ impl PacketZcGameGuard {
},
auth_data_raw: {
let mut dst: [u8; 16] = [0u8; 16];
dst.clone_from_slice(&buffer[offset..offset + 4]);
offset += 4;
dst.clone_from_slice(&buffer[offset..offset + 16]);
offset += 16;
dst
},
raw: (&buffer[..offset]).to_vec(),
Expand Down Expand Up @@ -68021,8 +68021,8 @@ impl PacketCzAckGameGuard {
},
auth_data_raw: {
let mut dst: [u8; 16] = [0u8; 16];
dst.clone_from_slice(&buffer[offset..offset + 4]);
offset += 4;
dst.clone_from_slice(&buffer[offset..offset + 16]);
offset += 16;
dst
},
raw: (&buffer[..offset]).to_vec(),
Expand Down Expand Up @@ -69811,8 +69811,8 @@ impl PacketZcNotifyMoveentry3 {
},
move_data_raw: {
let mut dst: [u8; 12] = [0u8; 12];
dst.clone_from_slice(&buffer[offset..offset + 6]);
offset += 6;
dst.clone_from_slice(&buffer[offset..offset + 12]);
offset += 12;
dst
},
x_size: {
Expand Down Expand Up @@ -81540,8 +81540,8 @@ impl PacketZcGangsiRank {
},
point_raw: {
let mut dst: [u8; 40] = [0u8; 40];
dst.clone_from_slice(&buffer[offset..offset + 10]);
offset += 10;
dst.clone_from_slice(&buffer[offset..offset + 40]);
offset += 40;
dst
},
packet_switch: {
Expand Down Expand Up @@ -82790,8 +82790,8 @@ impl PacketChSelectCharGoingtobeused {
},
ardw_selected_gid_raw: {
let mut dst: [u8; 36] = [0u8; 36];
dst.clone_from_slice(&buffer[offset..offset + 9]);
offset += 9;
dst.clone_from_slice(&buffer[offset..offset + 36]);
offset += 36;
dst
},
raw: (&buffer[..offset]).to_vec(),
Expand Down Expand Up @@ -95842,8 +95842,8 @@ impl PacketZcNotifyMoveentry4 {
},
move_data_raw: {
let mut dst: [u8; 12] = [0u8; 12];
dst.clone_from_slice(&buffer[offset..offset + 6]);
offset += 6;
dst.clone_from_slice(&buffer[offset..offset + 12]);
offset += 12;
dst
},
x_size: {
Expand Down Expand Up @@ -98456,8 +98456,8 @@ impl PacketAhcGameGuard {
},
auth_data_raw: {
let mut dst: [u8; 16] = [0u8; 16];
dst.clone_from_slice(&buffer[offset..offset + 4]);
offset += 4;
dst.clone_from_slice(&buffer[offset..offset + 16]);
offset += 16;
dst
},
raw: (&buffer[..offset]).to_vec(),
Expand Down Expand Up @@ -98570,8 +98570,8 @@ impl PacketCahAckGameGuard {
},
auth_data_raw: {
let mut dst: [u8; 16] = [0u8; 16];
dst.clone_from_slice(&buffer[offset..offset + 4]);
offset += 4;
dst.clone_from_slice(&buffer[offset..offset + 16]);
offset += 16;
dst
},
raw: (&buffer[..offset]).to_vec(),
Expand Down Expand Up @@ -99479,8 +99479,8 @@ impl PacketZcMsgStateChange2 {
},
val_raw: {
let mut dst: [u8; 12] = [0u8; 12];
dst.clone_from_slice(&buffer[offset..offset + 3]);
offset += 3;
dst.clone_from_slice(&buffer[offset..offset + 12]);
offset += 12;
dst
},
raw: (&buffer[..offset]).to_vec(),
Expand Down Expand Up @@ -106655,8 +106655,8 @@ impl PacketZcNotifyMoveentry7 {
},
move_data_raw: {
let mut dst: [u8; 12] = [0u8; 12];
dst.clone_from_slice(&buffer[offset..offset + 6]);
offset += 6;
dst.clone_from_slice(&buffer[offset..offset + 12]);
offset += 12;
dst
},
x_size: {
Expand Down Expand Up @@ -110522,8 +110522,8 @@ impl PacketCzPartyBookingReqUpdate {
},
job_raw: {
let mut dst: [u8; 12] = [0u8; 12];
dst.clone_from_slice(&buffer[offset..offset + 6]);
offset += 6;
dst.clone_from_slice(&buffer[offset..offset + 12]);
offset += 12;
dst
},
raw: (&buffer[..offset]).to_vec(),
Expand Down Expand Up @@ -117536,8 +117536,8 @@ impl PacketCzRequestMove2 {
},
dest_raw: {
let mut dst: [u8; 6] = [0u8; 6];
dst.clone_from_slice(&buffer[offset..offset + 3]);
offset += 3;
dst.clone_from_slice(&buffer[offset..offset + 6]);
offset += 6;
dst
},
raw: (&buffer[..offset]).to_vec(),
Expand Down Expand Up @@ -128993,8 +128993,8 @@ impl MakableitemInfo {
},
material_id_raw: {
let mut dst: [u8; 6] = [0u8; 6];
dst.clone_from_slice(&buffer[offset..offset + 3]);
offset += 3;
dst.clone_from_slice(&buffer[offset..offset + 6]);
offset += 6;
dst
},
raw: (&buffer[..offset]).to_vec(),
Expand Down Expand Up @@ -131930,8 +131930,8 @@ impl PartyBookingDetail {
},
job_raw: {
let mut dst: [u8; 12] = [0u8; 12];
dst.clone_from_slice(&buffer[offset..offset + 6]);
offset += 6;
dst.clone_from_slice(&buffer[offset..offset + 12]);
offset += 12;
dst
},
raw: (&buffer[..offset]).to_vec(),
Expand Down
Loading

0 comments on commit 16ec6d4

Please sign in to comment.