evennia/src/script_parents/basicobject.py

158 lines
5.6 KiB
Python
Raw Normal View History

"""
This is the base object type/interface that all parents are derived from by
default. Each object type sub-classes this class and over-rides methods as
needed.
NOTE: This file should NOT be directly modified. Sub-class the BasicObject
class in game/gamesrc/parents/base/basicobject.py and change the
SCRIPT_DEFAULT_OBJECT variable in settings.py to point to the new class.
"""
from src.ansi import ANSITable
class EvenniaBasicObject(object):
def __init__(self, scripted_obj, *args, **kwargs):
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
"""
Get our ducks in a row.
scripted_obj: (Object) A reference to the object being scripted (the child).
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
"""
self.scripted_obj = scripted_obj
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
def at_desc(self, pobject=None):
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
"""
Perform this action when someone uses the LOOK command on the object.
values:
* pobject: (Object) The object requesting the action.
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
"""
# Un-comment the line below for an example
#print "SCRIPT TEST: %s looked at %s." % (pobject, self.scripted_obj)
pass
def at_pre_destroy(self, pobject=None):
"""
Performed right before an object is destroyed.
values:
* pobject: (Object) The object requesting the action.
"""
# Un-comment the line below for an example
#print "SCRIPT TEST: %s looked at %s." % (pobject, self.scripted_obj)
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
pass
2007-07-10 15:34:07 +00:00
def at_get(self, pobject):
"""
Perform this action when someone uses the GET command on the object.
values:
* pobject: (Object) The object requesting the action.
"""
# Un-comment the line below for an example
#print "SCRIPT TEST: %s got %s." % (pobject, self.scripted_obj)
pass
def at_drop(self, pobject):
"""
Perform this action when someone uses the DROP command on the object.
values:
* pobject: (Object) The object requesting the action.
"""
# Un-comment the line below for an example
#print "SCRIPT TEST: %s dropped %s." % (pobject, self.scripted_obj)
pass
def return_appearance(self, pobject=None):
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
"""
Returns a string representation of an object's appearance when LOOKed at.
values:
* pobject: (Object) The object requesting the action.
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
"""
# This is the object being looked at.
target_obj = self.scripted_obj
# See if the envoker sees dbref numbers.
if pobject:
show_dbrefs = pobject.sees_dbrefs()
else:
show_dbrefs = False
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
description = target_obj.get_description()
if description is not None:
retval = "%s\r\n%s" % (
target_obj.get_name(show_dbref=show_dbrefs),
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
target_obj.get_description(),
)
else:
retval = "%s" % (
target_obj.get_name(show_dbref=show_dbrefs),
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
)
# Storage for the different object types.
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
con_players = []
con_things = []
con_exits = []
for obj in target_obj.get_contents():
if obj.is_player():
if (obj != pobject and obj.is_connected_plr()) or pobject == None:
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
con_players.append(obj)
elif obj.is_exit():
con_exits.append(obj)
else:
con_things.append(obj)
if not con_players == []:
retval += "\n\r%sPlayers:%s" % (ANSITable.ansi["hilite"],
ANSITable.ansi["normal"])
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
for player in con_players:
retval +='\n\r%s' % (player.get_name(show_dbref=show_dbrefs),)
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
if not con_things == []:
retval += "\n\r%sContents:%s" % (ANSITable.ansi["hilite"],
ANSITable.ansi["normal"])
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
for thing in con_things:
retval += '\n\r%s' % (thing.get_name(show_dbref=show_dbrefs),)
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
if not con_exits == []:
retval += "\n\r%sExits:%s" % (ANSITable.ansi["hilite"],
ANSITable.ansi["normal"])
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
for exit in con_exits:
retval += '\n\r%s' %(exit.get_name(show_dbref=show_dbrefs),)
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
return retval
def default_lock(self, pobject):
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
"""
This method returns a True or False boolean value to determine whether
the actor passes the lock. This is generally used for picking up
objects or traversing exits.
values:
* pobject: (Object) The object requesting the action.
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
"""
# Assume everyone passes the default lock by default.
return True
def use_lock(self, pobject):
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
"""
This method returns a True or False boolean value to determine whether
the actor passes the lock. This is generally used for seeing whether
a player can use an object or any of its commands.
values:
* pobject: (Object) The object requesting the action.
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
"""
# Assume everyone passes the use lock by default.
return True
def enter_lock(self, pobject):
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
"""
This method returns a True or False boolean value to determine whether
the actor passes the lock. This is generally used for seeing whether
a player can enter another object.
values:
* pobject: (Object) The object requesting the action.
basicobject.py --------------- - Checks for NULL description on objects- if Null, it doesn't print the extra line any more. - Made the checks for contents a little less ambiguous cmdhandler.py -------------- - Added new method 'parse_command' which takes a command string and tries to break it up based on common command parsing rules. Mostly complete, but could use some work on the edge cases. Check out the docstring on the function- I tried to make it fairly well documented. - Changed the check for 'non-standard characters' to just return, rather than throw an Exception. Not sure if this causes any issues, but I noticed that when you hit enter without entering a command it would trigger this code. Now it just fails silently. - The handle function now calls the parse_command function now and stores the results in parsed_input['parsed_command']. This then gets put into cdat['uinput'] at the end of handle() like before. The old data in parsed_input is still there, this is just a new field. - Added cdat['raw_input'] to pass the full, untouched command string on. This is also stored in parsed_input['parsed_command']['raw_command'] so not sure fi this is necessary any longer, probably not. cmdtable.py ------------ - Just cleaned it up a bit and straightened out the columns after changing 3-4 space indentation. apps/objects/models.py ----------------------- - set_description now sets the description attribute to 'None' (or Null in the db) when given a blank description. This is used for the change mentioned above in basicobject.py - get_description now returns None if self.description is None - used defines_global in the comparison methods like is_player functions_db.py ---------------- - Changed import defines_global as defines_global to just 'import defines_global'- wasn't sure why this was this way, if I broke something (I didn't seem to) let me know. - renamed player_search to player_name_search. Removed the use of local_and_global_search inside of it. local_and_global_search now calls it when it receives a search_string that starts with *. - alias_search now only looks at attributes with attr_name == ALIAS. It used to just look at attr_value, which could match anything, it seemed. - added 'dbref_search' - local_and_global_search changes: - Now uses dbref_search & player_search if the string starts with "#" or "*" respectively - Changed when it uses dbref_search to whenever the search_string is a dbref. It used to check that it was a dbref, and that search_contents & search_location were set, but I *believe* in most MU*'s when you supply a dbref it never fails to find the object. commands/unloggedin.py ----------------------- - removed hardcoded object type #'s and started using defines_global instead - when creating a new account, made sure that no object with an alias matching the player name requested exists. This is behavior from TinyMUSH, and I think most MUSHs follow this, but if not this is easy enough to change back. commands/general.py -------------------- - Rewrote cmd_page: - New Features - Page by dbref - Page multiple people - pose (:) and no space pose (;) pages - When someone hits page without a target or data, it now will tell the player who they last paged, or say they haven't paged anyone if they don't have a LASTPAGED - uses parse_command, made it a lot easier to work through the extra functionality added above - When there are multiple words in a page target, it first tries to find a player that matches the entire string. If that fails, then it goes through each word, assuming each is a separate target, and works out paging them. commands/objmanip.py --------------------- - I started to muck with cmd_name & cmd_page, but decided to hold off for now. Largely, if everyone is cool with the idea that names & aliases should be totally unique, then we need to go ahead and re-write these. I'll do that if everyone is cool with it.
2008-06-13 18:15:54 +00:00
"""
# Assume everyone passes the enter lock by default.
return True