mirror of
https://github.com/evennia/evennia.git
synced 2026-04-04 23:17:17 +02:00
Made search(*playername) commands correctly return a Player typeclass and not a character. Initial startup/character creation: Default permissions are now assigned on player level rather than character level (this gives more safety to @puppet operations). Made @puppet command work only on Character objects.
This commit is contained in:
parent
c9861e06de
commit
547eb53b32
8 changed files with 61 additions and 39 deletions
|
|
@ -93,7 +93,7 @@ def import_cmdset(python_path, cmdsetobj, emit_to_obj=None, no_logging=False):
|
|||
cmdsetclass = CACHED_CMDSETS.get(wanted_cache_key, None)
|
||||
errstring = ""
|
||||
if not cmdsetclass:
|
||||
print "cmdset %s not in cache. Reloading." % wanted_cache_key
|
||||
#print "cmdset %s not in cache. Reloading." % wanted_cache_key
|
||||
# Not in cache. Reload from disk.
|
||||
modulepath, classname = python_path.rsplit('.', 1)
|
||||
module = __import__(modulepath, fromlist=[True])
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ class ObjectManager(TypedObjectManager):
|
|||
A player<->user is a one-to-relationship, so this always
|
||||
returns just one result or None.
|
||||
|
||||
user - mayb be a user object or user id.
|
||||
user - may be a user object or user id.
|
||||
"""
|
||||
try:
|
||||
uid = int(user)
|
||||
|
|
@ -281,7 +281,7 @@ class ObjectManager(TypedObjectManager):
|
|||
player_string = ostring.lstrip("*")
|
||||
player_match = self.get_object_with_player(player_string)
|
||||
if player_match is not None:
|
||||
return [player_match]
|
||||
return [player_match.player]
|
||||
|
||||
# find suitable objects
|
||||
|
||||
|
|
|
|||
|
|
@ -414,6 +414,8 @@ class ObjectDB(TypedObject):
|
|||
ostring: (str) The string to match object names against.
|
||||
Obs - To find a player, append * to the
|
||||
start of ostring.
|
||||
global_search: Search all objects, not just the current
|
||||
location/inventory
|
||||
attribute_name: (string) Which attribute to match
|
||||
(if None, uses default 'name')
|
||||
use_nicks : Use nickname replace (off by default)
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ PERMS = [
|
|||
'examine',
|
||||
'typeclass',
|
||||
'debug',
|
||||
'puppet',
|
||||
|
||||
'batchcommands',
|
||||
'batchcodes',
|
||||
|
|
@ -89,6 +90,7 @@ GROUPS = {
|
|||
'perm',
|
||||
'batchcommands',
|
||||
'batchcodes',
|
||||
'puppet',
|
||||
|
||||
'wall',
|
||||
'boot',
|
||||
|
|
|
|||
|
|
@ -434,6 +434,6 @@ def create_player(name, email, password,
|
|||
new_character = create_object(typeclass, name,
|
||||
location, home,
|
||||
player=new_player)
|
||||
set_perm(new_character, permissions)
|
||||
#set_perm(new_character, permissions)
|
||||
return new_character
|
||||
return new_player
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ def validate_email_address(emailaddress):
|
|||
|
||||
def inherits_from(obj, parent):
|
||||
"""
|
||||
Takes an object and tries to determine if it inherits
|
||||
Takes an object and tries to determine if it inherits at any distance
|
||||
from parent. What differs this function from e.g. isinstance()
|
||||
is that obj may be both an instance and a class, and parent
|
||||
may be an instance, a class, or the python path to a class (counting
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue