diff --git a/blastmud_game/src/db.rs b/blastmud_game/src/db.rs
index febf2961..bff5b2f2 100644
--- a/blastmud_game/src/db.rs
+++ b/blastmud_game/src/db.rs
@@ -8,10 +8,11 @@ use uuid::Uuid;
use tokio_postgres::NoTls;
use crate::message_handler::ListenerSession;
use crate::DResult;
+use crate::message_handler::user_commands::parsing::parse_offset;
use crate::models::{session::Session, user::User, item::Item};
use tokio_postgres::types::ToSql;
use std::collections::BTreeSet;
-
+use std::sync::Arc;
use serde_json::{self, Value};
use futures::FutureExt;
@@ -175,6 +176,29 @@ impl DBPool {
}
}
+#[derive(Clone, Debug)]
+pub struct ItemSearchParams<'l> {
+ pub from_item: &'l Item,
+ pub query: &'l str,
+ pub include_contents: bool,
+ pub include_loc_contents: bool,
+ pub include_active_players: bool,
+ pub include_all_players: bool
+}
+
+impl ItemSearchParams<'_> {
+ pub fn base<'l>(from_item: &'l Item, query: &'l str) -> ItemSearchParams<'l> {
+ ItemSearchParams {
+ from_item, query,
+ include_contents: false,
+ include_loc_contents: false,
+ include_active_players: false,
+ include_all_players: false
+ }
+ }
+}
+
+
impl DBTrans {
pub async fn queue_for_session(self: &Self,
session: &ListenerSession,
@@ -238,7 +262,7 @@ impl DBTrans {
// Only copy more permanent fields, others are supposed to change over time and shouldn't
// be reset on restart.
for to_copy in ["display", "display_less_explicit", "details", "details_less_explicit",
- "total_xp", "total_stats", "total_skills"] {
+ "total_xp", "total_stats", "total_skills", "pronouns"] {
det_ex = format!("jsonb_set({}, '{{{}}}', ${})", det_ex, to_copy, var_id);
params.push(obj_map.get(to_copy).unwrap_or(&Value::Null));
var_id += 1;
@@ -314,61 +338,74 @@ impl DBTrans {
}
pub async fn find_item_by_type_code(self: &Self, item_type: &str, item_code: &str) ->
- DResult