From 211b40309e5c718051b952928dc2dfd4222e3641 Mon Sep 17 00:00:00 2001 From: Chris Routh Date: Thu, 1 Sep 2022 08:02:53 -0700 Subject: [PATCH 1/7] #2840 Add tzdata to requirements.txt to prevent stack traces in container systems with no timezone set. --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index a08725076e..92c67adb14 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,6 +15,7 @@ lunr == 0.6.0 simpleeval <= 1.0 uritemplate == 4.1.1 Jinja2 < 3.1 +tzdata # try to resolve dependency issue in py3.7 attrs >= 19.2.0 From 946472be76d7eb8b0211f00116bd855dc68d321c Mon Sep 17 00:00:00 2001 From: Chris Routh Date: Mon, 5 Sep 2022 20:44:31 -0700 Subject: [PATCH 2/7] Fix missing `evennia.` in setting Fixes the CONNECTION_SCREEN_MODULE missing the evennia. before contrib. --- docs/source/Contribs/Contrib-Menu-Login.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/Contribs/Contrib-Menu-Login.md b/docs/source/Contribs/Contrib-Menu-Login.md index 9c47216b6d..927210e3cf 100644 --- a/docs/source/Contribs/Contrib-Menu-Login.md +++ b/docs/source/Contribs/Contrib-Menu-Login.md @@ -11,7 +11,7 @@ menu system `EvMenu` under the hood. To install, add this to `mygame/server/conf/settings.py`: CMDSET_UNLOGGEDIN = "evennia.contrib.base_systems.menu_login.UnloggedinCmdSet" - CONNECTION_SCREEN_MODULE = "contrib.base_systems.menu_login.connection_screens" + CONNECTION_SCREEN_MODULE = "evennia.contrib.base_systems.menu_login.connection_screens" Reload the server and reconnect to see the changes. From bdb3ef0d10f44e7078c00f703b7b310ffb4be245 Mon Sep 17 00:00:00 2001 From: Chris Routh Date: Mon, 5 Sep 2022 21:13:07 -0700 Subject: [PATCH 3/7] Fix clothing creation instructions --- docs/source/Contribs/Contrib-Clothing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/Contribs/Contrib-Clothing.md b/docs/source/Contribs/Contrib-Clothing.md index 21addd6ecb..acaa12ca39 100644 --- a/docs/source/Contribs/Contrib-Clothing.md +++ b/docs/source/Contribs/Contrib-Clothing.md @@ -51,7 +51,7 @@ class CharacterCmdSet(default_cmds.CharacterCmdSet): From here, you can use the default builder commands to create clothes with which to test the system: - create a pretty shirt : evennia.contrib.game_systems.clothing.Clothing + create a pretty shirt : evennia.contrib.game_systems.clothing.ContribClothing set shirt/clothing_type = 'top' wear shirt From 15e7653db3d7a04a8aded2ee4565addae515d38f Mon Sep 17 00:00:00 2001 From: CloudKeeper <46334817+CloudKeeper@users.noreply.github.com> Date: Fri, 9 Sep 2022 18:37:16 +1000 Subject: [PATCH 4/7] Fixed Typo --- evennia/objects/objects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evennia/objects/objects.py b/evennia/objects/objects.py index def8ba0843..11e9f5f6dd 100644 --- a/evennia/objects/objects.py +++ b/evennia/objects/objects.py @@ -534,7 +534,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase): # handle stacks, disable multimatch errors nstack = nresults if not exact: - # we re-run exact match agains one of the matches to + # we re-run exact match against one of the matches to # make sure we were not catching partial matches not belonging # to the stack nstack = len( From e193844f6f988fc98809358c36227c2a438d8518 Mon Sep 17 00:00:00 2001 From: CloudKeeper <46334817+CloudKeeper@users.noreply.github.com> Date: Sat, 10 Sep 2022 11:10:35 +1000 Subject: [PATCH 5/7] Add 'search' lock for obj.search() and --- evennia/objects/objects.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/evennia/objects/objects.py b/evennia/objects/objects.py index def8ba0843..2174bfe972 100644 --- a/evennia/objects/objects.py +++ b/evennia/objects/objects.py @@ -387,6 +387,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase): quiet=False, exact=False, candidates=None, + use_locks=True, nofound_string=None, multimatch_string=None, use_dbref=None, @@ -444,6 +445,8 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase): is given. If not set, this list will automatically be defined to include the location, the contents of location and the caller's contents (inventory). + use_locks (bool): If True (default) - removes search results which + fail the "search" lock. nofound_string (str): optional custom string for not-found error message. multimatch_string (str): optional custom string for multimatch error header. use_dbref (bool or None, optional): If `True`, allow to enter e.g. a query "#123" @@ -529,6 +532,9 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase): use_dbref=use_dbref, ) + if use_locks: + results = [x for x in list(results) if x.access(self, "search")] + nresults = len(results) if stacked > 0 and nresults > 1: # handle stacks, disable multimatch errors @@ -1797,7 +1803,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase): def get_visible_contents(self, looker, **kwargs): """ Get all contents of this object that a looker can see (whatever that means, by default it - checks the 'view' lock), grouped by type. Helper method to return_appearance. + checks the 'view' and 'search' locks), grouped by type. Helper method to return_appearance. Args: looker (Object): The entity looking. @@ -1811,7 +1817,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase): """ def filter_visible(obj_list): - return [obj for obj in obj_list if obj != looker and obj.access(looker, "view")] + return [obj for obj in obj_list if obj != looker and obj.access(looker, "view") and obj.access(looker, "search")] return { "exits": filter_visible(self.contents_get(content_type="exit")), From 30fe8070b6bc4ff0b01254410362f3a4f21988ff Mon Sep 17 00:00:00 2001 From: CloudKeeper <46334817+CloudKeeper@users.noreply.github.com> Date: Sun, 11 Sep 2022 13:25:05 +1000 Subject: [PATCH 6/7] Update objects.py --- evennia/objects/objects.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evennia/objects/objects.py b/evennia/objects/objects.py index 2174bfe972..fbdf81a01f 100644 --- a/evennia/objects/objects.py +++ b/evennia/objects/objects.py @@ -533,7 +533,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase): ) if use_locks: - results = [x for x in list(results) if x.access(self, "search")] + results = [x for x in list(results) if x.access(self, "search", default=True)] nresults = len(results) if stacked > 0 and nresults > 1: @@ -1817,7 +1817,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase): """ def filter_visible(obj_list): - return [obj for obj in obj_list if obj != looker and obj.access(looker, "view") and obj.access(looker, "search")] + return [obj for obj in obj_list if obj != looker and obj.access(looker, "view") and obj.access(looker, "search", default=True)] return { "exits": filter_visible(self.contents_get(content_type="exit")), From 01505e0d921830f9be447603fbf7ecb45afa2a56 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 11 Sep 2022 11:34:45 +0200 Subject: [PATCH 7/7] Update Locks doc/CHANGELOG with new search lock --- CHANGELOG.md | 3 ++- docs/source/Components/Locks.md | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d15be0167..479eb7aae0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -184,7 +184,8 @@ Up requirements to Django 4.0+, Twisted 22+, Python 3.9 or 3.10 - Contrib `buffs` for managing temporary and permanent RPG status buffs effects (tegiminis) - New `at_server_init()` hook called before all other startup hooks for all startup modes. Used for more generic overriding (volund) - +- New `search` lock type used to completely hide an object from being found by + the `DefaultObject.search` (`caller.search`) method. (CloudKeeper) ## Evennia 0.9.5 diff --git a/docs/source/Components/Locks.md b/docs/source/Components/Locks.md index 7bfc076db3..1981d63f80 100644 --- a/docs/source/Components/Locks.md +++ b/docs/source/Components/Locks.md @@ -105,7 +105,15 @@ something like `call:false()`. - `examine` - who may examine this object's properties. - `delete` - who may delete the object. - `edit` - who may edit properties and attributes of the object. - - `view` - if the `look` command will display/list this object + - `view` - if the `look` command will display/list this object in descriptions + and if you will be able to see its description. Note that if + you target it specifically by name, the system will still find it, just + not be able to look at it. See `search` lock to completely hide the item. + - `search` - this controls if the object can be found with the + `DefaultObject.search` method (usually referred to with `caller.search` + in Commands). This is how to create entirely 'undetectable' in-game objects. + Note that if you are aiming to make some permanently invisible game system, + using a [Script](Scripts) is a better bet. - `get`- who may pick up the object and carry it around. - `puppet` - who may "become" this object and control it as their "character". - `attrcreate` - who may create new attributes on the object (default True)