From 8a9713b5e1b0d531b457dbaa846a5f052757da34 Mon Sep 17 00:00:00 2001 From: Condorra Date: Mon, 11 Mar 2024 21:09:17 +1100 Subject: [PATCH] Don't idlepark from certain special public locations --- blastmud_game/src/models/item.rs | 1 + blastmud_game/src/services/idlepark.rs | 4 +++- .../src/static_content/room/repro_xv.rs | 3 ++- .../src/static_content/room/special.yaml | 24 +++++++++++++++++++ schema/schema.sql | 1 + 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/blastmud_game/src/models/item.rs b/blastmud_game/src/models/item.rs index c7f1cfd1..da916974 100644 --- a/blastmud_game/src/models/item.rs +++ b/blastmud_game/src/models/item.rs @@ -341,6 +341,7 @@ pub enum ItemFlag { DontListInLook, AllowShare, Invincible, + NoIdlePark, } #[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] diff --git a/blastmud_game/src/services/idlepark.rs b/blastmud_game/src/services/idlepark.rs index 23fe159d..9b248d78 100644 --- a/blastmud_game/src/services/idlepark.rs +++ b/blastmud_game/src/services/idlepark.rs @@ -26,7 +26,9 @@ impl TaskHandler for IdleparkTaskHandler { { if let Some((loc_type, loc_code)) = player_item.location.split_once("/") { if let Some(loc) = ctx.trans.find_item_by_type_code(loc_type, loc_code).await? { - if !loc.flags.contains(&ItemFlag::PrivatePlace) { + if !loc.flags.contains(&ItemFlag::PrivatePlace) + && !loc.flags.contains(&ItemFlag::NoIdlePark) + { let mut player_item = (*player_item).clone(); broadcast_to_room(&ctx.trans, &player_item.location, None, &format!( diff --git a/blastmud_game/src/static_content/room/repro_xv.rs b/blastmud_game/src/static_content/room/repro_xv.rs index 1bf25595..8c27160c 100644 --- a/blastmud_game/src/static_content/room/repro_xv.rs +++ b/blastmud_game/src/static_content/room/repro_xv.rs @@ -28,7 +28,7 @@ pub fn room_list() -> Vec { exit_type: ExitType::Blocked(Box::new(npc::statbot::ChoiceRoomBlocker)), ..Default::default() }), - item_flags: vec![ItemFlag::NoUrgesHere], + item_flags: vec![ItemFlag::NoUrgesHere, ItemFlag::NoIdlePark], should_caption: true, ..Default::default() }, @@ -68,6 +68,7 @@ pub fn room_list() -> Vec { ..Default::default() }), should_caption: true, + item_flags: vec![ItemFlag::NoIdlePark, ItemFlag::NoSay, ItemFlag::NoSeeContents], ..Default::default() }, Room { diff --git a/blastmud_game/src/static_content/room/special.yaml b/blastmud_game/src/static_content/room/special.yaml index 4412327a..f7e75fd1 100644 --- a/blastmud_game/src/static_content/room/special.yaml +++ b/blastmud_game/src/static_content/room/special.yaml @@ -18,6 +18,8 @@ z: -1 description: 'The inside of a small pen or cage, with thick steel bars, suitable for holding an animal - or a person - securely, with no chance of escape. It is dimly lit and smells like urine, and is very cramped and indignifying. It looks like the only way out would be with the help of whoever locked you in here. [OOC: consider emailing staff@blastmud.org to discuss your situation]' exits: [] + flags: + - !NoIdlePark - zone: special code: holding1 name: 'Holding Pen #1' @@ -28,6 +30,8 @@ z: -1 description: 'The inside of a small pen or cage, with thick steel bars, suitable for holding an animal - or a person - securely, with no chance of escape. It is dimly lit and smells like urine, and is very cramped and indignifying. It looks like the only way out would be with the help of whoever locked you in here. [OOC: consider emailing staff@blastmud.org to discuss your situation]' exits: [] + flags: + - !NoIdlePark - zone: special code: holding2 name: 'Holding Pen #2' @@ -38,6 +42,8 @@ z: -1 description: 'The inside of a small pen or cage, with thick steel bars, suitable for holding an animal - or a person - securely, with no chance of escape. It is dimly lit and smells like urine, and is very cramped and indignifying. It looks like the only way out would be with the help of whoever locked you in here. [OOC: consider emailing staff@blastmud.org to discuss your situation]' exits: [] + flags: + - !NoIdlePark - zone: special code: holding3 name: 'Holding Pen #3' @@ -48,6 +54,8 @@ z: -1 description: 'The inside of a small pen or cage, with thick steel bars, suitable for holding an animal - or a person - securely, with no chance of escape. It is dimly lit and smells like urine, and is very cramped and indignifying. It looks like the only way out would be with the help of whoever locked you in here. [OOC: consider emailing staff@blastmud.org to discuss your situation]' exits: [] + flags: + - !NoIdlePark - zone: special code: holding4 name: 'Holding Pen #4' @@ -58,6 +66,8 @@ z: -1 description: 'The inside of a small pen or cage, with thick steel bars, suitable for holding an animal - or a person - securely, with no chance of escape. It is dimly lit and smells like urine, and is very cramped and indignifying. It looks like the only way out would be with the help of whoever locked you in here. [OOC: consider emailing staff@blastmud.org to discuss your situation]' exits: [] + flags: + - !NoIdlePark - zone: special code: holding5 name: 'Holding Pen #5' @@ -68,6 +78,8 @@ z: -1 description: 'The inside of a small pen or cage, with thick steel bars, suitable for holding an animal - or a person - securely, with no chance of escape. It is dimly lit and smells like urine, and is very cramped and indignifying. It looks like the only way out would be with the help of whoever locked you in here. [OOC: consider emailing staff@blastmud.org to discuss your situation]' exits: [] + flags: + - !NoIdlePark - zone: special code: holding6 name: 'Holding Pen #6' @@ -78,6 +90,8 @@ z: -1 description: 'The inside of a small pen or cage, with thick steel bars, suitable for holding an animal - or a person - securely, with no chance of escape. It is dimly lit and smells like urine, and is very cramped and indignifying. It looks like the only way out would be with the help of whoever locked you in here. [OOC: consider emailing staff@blastmud.org to discuss your situation]' exits: [] + flags: + - !NoIdlePark - zone: special code: holding7 name: 'Holding Pen #7' @@ -88,6 +102,8 @@ z: -1 description: 'The inside of a small pen or cage, with thick steel bars, suitable for holding an animal - or a person - securely, with no chance of escape. It is dimly lit and smells like urine, and is very cramped and indignifying. It looks like the only way out would be with the help of whoever locked you in here. [OOC: consider emailing staff@blastmud.org to discuss your situation]' exits: [] + flags: + - !NoIdlePark - zone: special code: holding8 name: 'Holding Pen #8' @@ -98,6 +114,8 @@ z: -1 description: 'The inside of a small pen or cage, with thick steel bars, suitable for holding an animal - or a person - securely, with no chance of escape. It is dimly lit and smells like urine, and is very cramped and indignifying. It looks like the only way out would be with the help of whoever locked you in here. [OOC: consider emailing staff@blastmud.org to discuss your situation]' exits: [] + flags: + - !NoIdlePark - zone: special code: holding9 name: 'Holding Pen #9' @@ -108,6 +126,8 @@ z: -1 description: 'The inside of a small pen or cage, with thick steel bars, suitable for holding an animal - or a person - securely, with no chance of escape. It is dimly lit and smells like urine, and is very cramped and indignifying. It looks like the only way out would be with the help of whoever locked you in here. [OOC: consider emailing staff@blastmud.org to discuss your situation]' exits: [] + flags: + - !NoIdlePark - zone: special code: holdinga name: Holding Pen A @@ -118,6 +138,8 @@ z: -1 description: 'The inside of a small pen or cage, with thick steel bars, suitable for holding an animal - or a person - securely, with no chance of escape. It is dimly lit and smells like urine, and is very cramped and indignifying. It looks like the only way out would be with the help of whoever locked you in here. [OOC: consider emailing staff@blastmud.org to discuss your situation]' exits: [] + flags: + - !NoIdlePark - zone: special code: holdingb name: Holding Pen B @@ -128,3 +150,5 @@ z: -1 description: 'The inside of a small pen or cage, with thick steel bars, suitable for holding an animal - or a person - securely, with no chance of escape. It is dimly lit and smells like urine, and is very cramped and indignifying. It looks like the only way out would be with the help of whoever locked you in here. [OOC: consider emailing staff@blastmud.org to discuss your situation]' exits: [] + flags: + - !NoIdlePark diff --git a/schema/schema.sql b/schema/schema.sql index c9e9eaf6..df0eb560 100644 --- a/schema/schema.sql +++ b/schema/schema.sql @@ -44,6 +44,7 @@ CREATE TABLE users ( ); CREATE INDEX user_by_listener ON users(current_listener); CREATE INDEX user_by_session ON users(current_session); +CREATE INDEX user_by_idlepark ON users(idle_park_time); CREATE UNLOGGED TABLE sendqueue ( item BIGSERIAL NOT NULL PRIMARY KEY,