From e0187bd2c89e4512b62557fd9f912847ee3ce898 Mon Sep 17 00:00:00 2001 From: Condorra Date: Mon, 13 Mar 2023 17:21:53 +1100 Subject: [PATCH] Add documentation on allow. --- .../message_handler/user_commands/allow.rs | 6 +- .../src/message_handler/user_commands/help.rs | 61 ++++++++++++++++++- 2 files changed, 62 insertions(+), 5 deletions(-) diff --git a/blastmud_game/src/message_handler/user_commands/allow.rs b/blastmud_game/src/message_handler/user_commands/allow.rs index f734167..e9cd7be 100644 --- a/blastmud_game/src/message_handler/user_commands/allow.rs +++ b/blastmud_game/src/message_handler/user_commands/allow.rs @@ -658,8 +658,10 @@ async fn handle_user_consent(ctx: &mut VerbContext<'_>, source_player: &Item, Some(msg) => { match ctx.trans.find_session_for_player(&to_user_item.item_code).await? { None => {}, - Some((session, _)) => - ctx.trans.queue_for_session(&session, Some(&(msg + "\n"))).await? + Some((session, session_dat)) => + if cmd.consent_type != ConsentType::Sex || !session_dat.less_explicit_mode { + ctx.trans.queue_for_session(&session, Some(&(msg + "\n"))).await?; + } } } } diff --git a/blastmud_game/src/message_handler/user_commands/help.rs b/blastmud_game/src/message_handler/user_commands/help.rs index 43ecdf5..ff7e5a2 100644 --- a/blastmud_game/src/message_handler/user_commands/help.rs +++ b/blastmud_game/src/message_handler/user_commands/help.rs @@ -115,13 +115,68 @@ static REGISTERED_HELP_PAGES: phf::Map<&'static str, &'static str> = phf_map! { Hint: get and drop support an item name, but you can also prefix it \ with a number - e.g. get 2 whip. Instead of a number, you can \ use all. You can also omit the item name to match any \ - possession, e.g. drop all will drop everything you have.") + possession, e.g. drop all will drop everything you have."), + "allow" => + ansi!("allow is the corner-stone of Blastmud's consent system. Consents in \ + Blastmud let you choose how you want to play with other players (it only affects players, \ + not NPCs). There are 4 types of consent: fight (for hostile actions like \ + attack or pick), medicine (for medical actions, including those that might \ + crit fail and do harm), gifts (lets them give you things), and \ + visit (lets them on to a tile owned by you legally).\n\ + \n\ + To allow, an individual, use the syntax allow type from player options\n\ + Options can be blank to use defaults, or can be one or more of the following, separated by spaces:\n\ + \tuntil n minutes - replace n with a number. You can use hours, days, or weeks instead of minutes. This makes the consent expire. Fight expires after a week if you don't give a shorter period, and all other consent types have no expiry unless you specify one.\n\ + \tuntil death - makes the consent valid only until you next die.\n\ + \tallow private - makes the consent valid even in privately owned places. This is the default for anything except fight.\n\ + \tdisallow private - the opposite of allow private.\n\ + \tin place - limits where fighting can happen to selected public places. You can use \ + here, or if you know the code, a place name. You can use this option more than once to allow \ + any place, and if you don't use the option, it means anywhere (subject to allow private).\n\ + \tallow pick - fight only - include picking in your consent.\n\ + \tallow revoke - fight only - allows the player to revoke any time with disallow.\n\ + \n\ + Consents for anything except fight take effect immediately to let the other player do the action.\n\ + Consents for fight take effect when the other player executes a reciprocal allow command.\n\ + Consents for anything except than fight can be revoked instantly with:\n\ + \tdisallow action from player\n\ + Consent for fight can be revoked similarly if the consent used the allow revoke option. \ + Otherwise, attempting to revoke informs the other player, and it is revoked when they also issue a \ + disallow command.") }; static EXPLICIT_HELP_PAGES: phf::Map<&'static str, &'static str> = phf_map! { "fuck" => ansi!("Type fuck name> to fuck someone. It only works if \ - they have consented.") + they have consented."), + "allow" => + ansi!("allow is the corner-stone of Blastmud's consent system. Consents in \ + Blastmud let you choose how you want to play with other players (it only affects players, \ + not NPCs). There are 5 types of consent: fight (for hostile actions like \ + attack or pick), medicine (for medical actions, including those that might \ + crit fail and do harm), gifts (lets them give you things), \ + visit (lets them on to a tile owned by you legally), and fuck \ + (lets them do fun but dirty things to you).\n\ + \n\ + To allow, an individual, use the syntax allow type from player options\n\ + Options can be blank to use defaults, or can be one or more of the following, separated by spaces:\n\ + \tuntil n minutes - replace n with a number. You can use hours, days, or weeks instead of minutes. This makes the consent expire. Fight expires after a week if you don't give a shorter period, and all other consent types have no expiry unless you specify one.\n\ + \tuntil death - makes the consent valid only until you next die.\n\ + \tallow private - makes the consent valid even in privately owned places. This is the default for anything except fight.\n\ + \tdisallow private - the opposite of allow private.\n\ + \tin place - limits where fighting can happen to selected public places. You can use \ + here, or if you know the code, a place name. You can use this option more than once to allow \ + any place, and if you don't use the option, it means anywhere (subject to allow private).\n\ + \tallow pick - fight only - include picking in your consent.\n\ + \tallow revoke - fight only - allows the player to revoke any time with disallow.\n\ + \n\ + Consents for anything except fight take effect immediately to let the other player do the action.\n\ + Consents for fight take effect when the other player executes a reciprocal allow command.\n\ + Consents for anything except than fight can be revoked instantly with:\n\ + \tdisallow action from player\n\ + Consent for fight can be revoked similarly if the consent used the allow revoke option. \ + Otherwise, attempting to revoke informs the other player, and it is revoked when they also issue a \ + disallow command.") }; pub struct Verb; @@ -138,7 +193,7 @@ impl UserVerb for Verb { } else { help = help.or_else(|| REGISTERED_HELP_PAGES.get(remaining)); if !ctx.session_dat.less_explicit_mode { - help = help.or_else(|| EXPLICIT_HELP_PAGES.get(remaining)) + help = EXPLICIT_HELP_PAGES.get(remaining).or(help); } } help = help.or_else(|| ALWAYS_HELP_PAGES.get(remaining));