From a8603975a11d564d78ff0e019d76f82ecaf1b9cc Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 1 Oct 2017 16:51:41 +0200 Subject: [PATCH 1/3] Merge back fixes into master --- evennia/commands/default/account.py | 2 +- evennia/commands/default/general.py | 2 +- evennia/objects/objects.py | 11 ++++++++--- evennia/typeclasses/models.py | 4 ++++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/evennia/commands/default/account.py b/evennia/commands/default/account.py index 01b7066fe3..e45e2a9347 100644 --- a/evennia/commands/default/account.py +++ b/evennia/commands/default/account.py @@ -824,7 +824,7 @@ class CmdQuell(COMMAND_DEFAULT_CLASS): """Perform the command""" account = self.account permstr = account.is_superuser and " (superuser)" or "(%s)" % (", ".join(account.permissions.all())) - if self.cmdstring == '@unquell': + if self.cmdstring in ('unquell', '@unquell'): if not account.attributes.get('_quell'): self.msg("Already using normal Account permissions %s." % permstr) else: diff --git a/evennia/commands/default/general.py b/evennia/commands/default/general.py index c5075b8744..6a30e3813c 100644 --- a/evennia/commands/default/general.py +++ b/evennia/commands/default/general.py @@ -67,7 +67,7 @@ class CmdLook(COMMAND_DEFAULT_CLASS): caller.msg("You have no location to look at!") return else: - target = caller.search(self.args, use_dbref=caller.check_permstring("Builders")) + target = caller.search(self.args) if not target: return self.msg(caller.at_look(target)) diff --git a/evennia/objects/objects.py b/evennia/objects/objects.py index 4479da8af7..f9b9510670 100644 --- a/evennia/objects/objects.py +++ b/evennia/objects/objects.py @@ -292,7 +292,7 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)): candidates=None, nofound_string=None, multimatch_string=None, - use_dbref=True): + use_dbref=None): """ Returns an Object matching a search string/condition @@ -343,8 +343,9 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)): caller's contents (inventory). nofound_string (str): optional custom string for not-found error message. multimatch_string (str): optional custom string for multimatch error header. - use_dbref (bool, optional): if False, treat a given #dbref strings as a - normal string rather than database ids. + use_dbref (bool or None, optional): if True/False, active/deactivate the use of + #dbref as valid global search arguments. If None, check against a permission + ('Builder' by default). Returns: match (Object, None or list): will return an Object/None if `quiet=False`, @@ -360,6 +361,7 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)): """ is_string = isinstance(searchdata, basestring) + if is_string: # searchdata is a string; wrap some common self-references if searchdata.lower() in ("here", ): @@ -367,6 +369,9 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)): if searchdata.lower() in ("me", "self",): return [self] if quiet else self + if use_dbref is None: + use_dbref = self.locks.check_lockstring(self, "_dummy:perm(Builder)") + if use_nicks: # do nick-replacement on search searchdata = self.nicks.nickreplace(searchdata, categories=("object", "account"), include_account=True) diff --git a/evennia/typeclasses/models.py b/evennia/typeclasses/models.py index 8a20ba9148..c156aa2ac6 100644 --- a/evennia/typeclasses/models.py +++ b/evennia/typeclasses/models.py @@ -575,6 +575,10 @@ class TypedObject(SharedMemoryModel): ppos = _PERMISSION_HIERARCHY.index(perm) return any(True for hpos, hperm in enumerate(_PERMISSION_HIERARCHY) if hperm in perms and hpos > ppos) + # we ignore pluralization (english only) + if perm.endswith("s"): + return self.check_permstring(perm[:-1]) + return False # From 957a86e0c22c9e4984842a6984c68b4bdace0cfa Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 1 Oct 2017 18:44:00 +0200 Subject: [PATCH 2/3] Create CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000..299ad5d241 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting griatch AT gmail DOT com or Griatch in the #evennia channel on irc.freenode.net. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ From 2bc76538d858edc03f5780557c3a17179bb252c3 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 1 Oct 2017 18:47:23 +0200 Subject: [PATCH 3/3] Added link to 0.7 post to Changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 921cdf4dd5..8cecd0de21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ # Sept 2017: Release of Evennia 0.7; upgrade to Django 1.11, change 'Player' to 'Account', rework the website template and a slew of other updates. +Info on what changed and how to migrat is found here: +https://groups.google.com/forum/#!msg/evennia/0JYYNGY-NfE/cDFaIwmPBAAJ ## Feb 2017: New devel branch created, to lead up to Evennia 0.7.