Home

[Package Index | Mudlib Index | Effect Index]

File /global/cloner.c

Used for mapping deleted files to new ones when things are changed. Updated to a more tidy mechanism by Ceres 14/3/96

Usage: call add_mapping(from, to) /global/cloner

Inherits

This class inherits the following classes /std/object.c

Method index

  • add_illegal(string, string, string)
    This method is used to add objects that we don't want to be reloaded.
  • add_mapping(string, string)
    Use this function to add a new mapping of one filename to another.
  • clone(string)
    Try and clone the passed in object.
  • illegal_thing(string, string)
    Determine if a given object is illegal.
  • list_mappings(string)
    This method returns a list of all the current mappings.
  • load_file()
    Loads the current configuration.
  • other_file(string)
    This method returns the mapped name of the object.
  • query_changes()
    This method returns the list of currently moved objects.
  • query_illegal()
    List the illegal objects.
  • remove_illegal(string, string)
    Remove an item from the illegal array
  • remove_mapping(string)
    Removes a mapping from the object.
  • save_file()
    Saves the current configuration.

Public Functions

These are functions that everyone can access.

.

    add_illegal
    int add_illegal(string basename,
                    string short,
                    string replacement)
    

    This method is used to add objects that we don't want to be reloaded. This is for those objects that are clones of /std/object or /obj/armour or something but which are wrongly configured.
    • Parameters:
      basename - the base filename of the object
      short - the short name of the object
      replacement - the replacement object.
    • Returns:
      1 for success, 0 for failure
    • Example:
      add_illegal("/obj/armour", "blue robe", 
                             "/obj/armours/robe.arm);
      
    add_mapping
    int add_mapping(string from,
                    string to)
    

    Use this function to add a new mapping of one filename to another. Means that if an object of type 'from' is attempted to be cloned an object of type 'to' will be cloned instead.
    • Parameters:
      from - the old object name
      to - the new object name
    • Returns:
      1 on success, 0 on failure
    • See also:
      remove_mapping() and list_mappings()
        clone
        object clone(string word)
        

        Try and clone the passed in object. If the name exists in the changes array then the new file name is cloned instead of the old one.
        • Parameters:
          word - the name of the file to clone
        • Returns:
          the cloned object
        • See also:
          other_file() and list_mappings()
            illegal_thing
            string illegal_thing(string basename,
                                 string short)
            

            Determine if a given object is illegal.
            • Parameters:
              basename - the basename of the object.
              short - the shortname of the object.
            • Returns:
              1 for success, 0 for failure
                list_mappings
                string list_mappings(string str)
                

                This method returns a list of all the current mappings. If a pattern is given, then only files which contain that string will be returned.
                • Parameters:
                  str - the pattern to search for
                • Returns:
                  the list of mappings
                • See also:
                  add_mapping() and remove_mapping()
                    load_file
                    void load_file()
                    

                    Loads the current configuration.
                      other_file
                      string other_file(string word)
                      

                      This method returns the mapped name of the object. If no mapping exists the passed in value is returned directly.
                      • Parameters:
                        word - the object name to get a mapping for
                      • Returns:
                        the file to use
                      • See also:
                        clone() and list_mappings()
                          query_changes
                          mapping query_changes()
                          

                          This method returns the list of currently moved objects.
                            query_illegal
                            mapping query_illegal()
                            

                            List the illegal objects.
                              remove_illegal
                              int remove_illegal(string basename,
                                                 string short)
                              

                              Remove an item from the illegal array
                              • Parameters:
                                basename - the basename of the object.
                                short - the shortname of the object.
                              • Returns:
                                1 for success, 0 for failure
                                  remove_mapping
                                  int remove_mapping(string from)
                                  

                                  Removes a mapping from the object. This looks to see if an mapping exists for the object and removes it if it does.
                                  • Parameters:
                                    from - the object to remove the mapping from
                                  • Returns:
                                    1 on success and 0 on failure
                                  • See also:
                                    add_mapping() and list_mappings()
                                      save_file
                                      void save_file()
                                      

                                      Saves the current configuration.
Valid HTML 4.01 Transitional
Valid CSS!
Read More