kill_counters #109

Closed
andy wants to merge 80 commits from kill_counters into master
5 changed files with 3 additions and 21 deletions
Showing only changes of commit 7ac68d13bb - Show all commits

View File

@ -157,17 +157,6 @@ pub trait EntityGateway: Send + Sync {
async fn create_trade(&mut self, _char_id1: &CharacterEntityId, _char_id2: &CharacterEntityId) -> Result<TradeEntity, GatewayError> {
unimplemented!();
}
async fn increment_kill_counter(&mut self, _item_entity_id: &ItemEntityId) -> Result<(), GatewayError> {
unimplemented!();
}
async fn get_kill_counter() {
unimplemented!();
}
async fn set_kill_counter() {
unimplemented!();
}
}

View File

@ -78,6 +78,7 @@ pub struct InMemoryGateway {
weapon_modifiers: Arc<Mutex<BTreeMap<ItemEntityId, Vec<weapon::WeaponModifier>>>>,
unit_modifiers: Arc<Mutex<BTreeMap<ItemEntityId, Vec<unit::UnitModifier>>>>,
trades: Arc<Mutex<Vec<TradeEntity>>>,
unit_modifiers: Arc<Mutex<BTreeMap<ItemEntityId, Vec<unit::UnitModifier>>>>,
}
impl Default for InMemoryGateway {
@ -96,6 +97,7 @@ impl Default for InMemoryGateway {
weapon_modifiers: Arc::new(Mutex::new(BTreeMap::new())),
unit_modifiers: Arc::new(Mutex::new(BTreeMap::new())),
trades: Arc::new(Mutex::new(Vec::new())),
unit_modifiers: Arc::new(Mutex::new(BTreeMap::new())),
}
}
}

View File

@ -1684,10 +1684,4 @@ impl Weapon {
| WeaponType::Scepter
)
}
pub fn increment_kill_counter(&mut self) {
if let Some(kills) = self.kills {
self.kills = Some(kills + 1);
}
}
}

View File

@ -411,7 +411,7 @@ where
}
pub async fn player_killed_monster<EG>( id: ClientId,
_pkt: &KillMonster, // use this later for turbo logging?
pkt: &KillMonster,
entity_gateway: &mut EG,
client_location: &ClientLocation,
clients: &Clients,

View File

@ -1,7 +1,4 @@
/* TODO:
1. test to check if sjs/lame/limiter drop with Some() kill counter enabled
2. test to make sure other items drop with None kill counter
3. test kill counters get incremented per kill
4. test unsealing item:
- client item id does not change
- unsealed item no longer has kill counter