Home

[Package Index | Mudlib Index | Effect Index]

Includes

This class includes the following files /include/refresh.h, /d/am/include/amcw.h, /include/player_handler.h and /include/login_handler.h

Class Index

Method index

  • add_crime(string, int, string, string)
    Adds a crime to the criminal's record.
  • add_temporary_crime(string, int, string, string)
    Adds a temporary crime to a criminal's record.
  • banish_person(string, int)
    This function adds a player as banished.
  • banish_person_suspend(string)
    This function supends (removes) a player's banishment (to be used when the case is appealed).
  • clear_crimes(string)
    Wipes the entire "permanent" criminal record of a player or NPC.
  • clear_temporary_crimes(string)
    Clears all the temporary crimes for a player or NPC.
  • is_banished(string)
  • player_delete(string, int)
    This is the function called by the login-handler when a player is deleted so that a potential criminal-record can be erased as well.
  • player_login(string, string)
    This is the function called by the login-handler when a player logs in so that a potential criminal-record can be loaded.
  • player_netdead(string, string)
  • player_reconnect(string, string)
  • player_refresh(object, int)
    This is the function called by the login-handler when a player refreshes so that a potential criminal-record can be cleared.
  • query_all_criminals()
    This returns all the criminals that are currently being sought.
  • query_banished()
    This function returns the names of all banished players and also deletes banishments which are over from the handler.
  • query_banished_time(string)
  • query_city_gate(string)
  • query_crimes(string, int)
    Returns all the crimes a player or NPC is guilty of or those that have been recorded before a given time, if the last_update-parameter is specified.
  • query_crimes_long(string)
    Returns an array with the elaborate descriptions of all crimes a player or NPC is known to have committed.
  • query_criminal(string, int)
    Checks whether the specified player (or NPC) is a known criminal.
  • query_criminals()
    This function returns the names of all online criminals with permanent records.
  • query_prison_for(string)
    Queries the prison for a watch-district.
  • query_prisons()
    This function returns the prisons registerd with the handler.
  • query_registered_watchmen()
    This function returns the registered watchmen-objects.
  • query_temp_criminals()
    This function returns the names of all online criminals with temporary records.
  • query_total_severity(string)
    Returns the severity-rating of all the crimes a criminal committed.
  • register_watchman(object)
    This function is used to register a watchman-object for reinforcement issues.
  • remove_temporary_crime(string, string)
    Removes a temporary crime from a criminal's record.
  • save_crimes()
    Saves the entire contents of the _criminals-mapping to the respective files.
  • save_this_criminal(string)
    Function that saves a criminal's record and removes him from the mapping (can for instance be used if the player logs off).
  • set_gate_for(string, string)
  • set_prison_for(string, string)
    This function is used to assign a prison to a given zone.
  • unregister_watchman(object)
    This function is used to unregister a watchman-object when it dies.

Public Functions

These are functions that everyone can access.

.

    add_crime
    varargs int add_crime(string criminal,
                          int severity,
                          string short,
                          string long)
    

    Adds a crime to the criminal's record. The time is recorded automatically.
    • Parameters:
      criminal - the name of the criminal
      severity - the severity of the crime (1 to 5, 5 being the highest)
      short - a short description of the crime
      long - a longer description of the crime, if desired
    • Returns:
      1 on success, 0 on failure
    add_temporary_crime
    varargs int add_temporary_crime(string criminal,
                                    int severity,
                                    string short,
                                    string long)
    

    Adds a temporary crime to a criminal's record.
    • Parameters:
      criminal - the name of the criminal
      severity - the severity of the crime (1 to 5, 5 being the highest)
      short - a short description of the crime
      long - a longer description of the crime, if desired
    • Returns:
      1 on success or 0 on failure
        banish_person
        void banish_person(string name,
                           int days)
        

        This function adds a player as banished.
        • Parameters:
          name - The player's name
          days - The number of days
            banish_person_suspend
            void banish_person_suspend(string name)
            

            This function supends (removes) a player's banishment (to be used when the case is appealed).
            • Parameters:
              name - The player's name
                clear_crimes
                int clear_crimes(string criminal)
                

                Wipes the entire "permanent" criminal record of a player or NPC.
                • Parameters:
                  criminal - the name of the criminal
                • Returns:
                  1 on success, otherwise 0
                    clear_temporary_crimes
                    int clear_temporary_crimes(string criminal)
                    

                    Clears all the temporary crimes for a player or NPC.
                    • Parameters:
                      criminal - the name of the criminal
                    • Returns:
                      1 on success, 0 on failure
                        is_banished
                        int is_banished(string name)
                        
                          player_delete
                          void player_delete(string name,
                                             int type)
                          

                          This is the function called by the login-handler when a player is deleted so that a potential criminal-record can be erased as well.
                          • Parameters:
                            name - The player's name
                            type - The type of the event.
                              player_login
                              void player_login(string name,
                                                string type)
                              

                              This is the function called by the login-handler when a player logs in so that a potential criminal-record can be loaded.
                              • Parameters:
                                name - The player's name
                                type - The type of the event.
                                  player_netdead
                                  void player_netdead(string player,
                                                      string watchman)
                                  
                                    player_reconnect
                                    void player_reconnect(string player,
                                                          string event_type)
                                    
                                      player_refresh
                                      void player_refresh(object player,
                                                          int type)
                                      

                                      This is the function called by the login-handler when a player refreshes so that a potential criminal-record can be cleared.
                                      • Parameters:
                                        name - The player's name
                                        type - The type of the event.
                                          query_all_criminals
                                          string * query_all_criminals()
                                          

                                          This returns all the criminals that are currently being sought.
                                          • Returns:
                                            the keys of the seen_criminals- and _temp_criminals-mappings
                                              query_banished
                                              string * query_banished()
                                              

                                              This function returns the names of all banished players and also deletes banishments which are over from the handler.
                                              • Returns:
                                                An array containing all the names.
                                                  query_banished_time
                                                  int query_banished_time(string name)
                                                  
                                                    query_city_gate
                                                    string query_city_gate(string zone)
                                                    
                                                      query_crimes
                                                      varargs string * query_crimes(string criminal,
                                                                                    int last_update)
                                                      

                                                      Returns all the crimes a player or NPC is guilty of or those that have been recorded before a given time, if the last_update-parameter is specified.
                                                      • Parameters:
                                                        criminal - the name of the player or NPC
                                                        last_update - the time-value before which the crime must have happened
                                                      • Returns:
                                                        an array with the crimes' shorts or an empty array
                                                          query_crimes_long
                                                          string * query_crimes_long(string criminal)
                                                          

                                                          Returns an array with the elaborate descriptions of all crimes a player or NPC is known to have committed.
                                                          • Parameters:
                                                            criminal - the name of the criminal
                                                          • Returns:
                                                            an empty array or one containing all the crimes' longs
                                                              query_criminal
                                                              varargs int query_criminal(string criminal,
                                                                                         int last_update)
                                                              

                                                              Checks whether the specified player (or NPC) is a known criminal. If the last_update-parameter is given, only crimes recorded before that time will be counted.
                                                              • Parameters:
                                                                criminal - the name of the player or NPC
                                                                last_update - the time-value before which the crime must have happened
                                                              • Returns:
                                                                1 if the person is a criminal, 0 if not
                                                                  query_criminals
                                                                  string * query_criminals()
                                                                  

                                                                  This function returns the names of all online criminals with permanent records.
                                                                  • Returns:
                                                                    an array containing all the names.
                                                                      query_prison_for
                                                                      string query_prison_for(string zone)
                                                                      

                                                                      Queries the prison for a watch-district.
                                                                      • Parameters:
                                                                        zone - the name of the district
                                                                      • Returns:
                                                                        the file for the prison
                                                                          query_prisons
                                                                          mapping query_prisons()
                                                                          

                                                                          This function returns the prisons registerd with the handler.
                                                                          • Returns:
                                                                            the mapping of prisons
                                                                              query_registered_watchmen
                                                                              object * query_registered_watchmen()
                                                                              

                                                                              This function returns the registered watchmen-objects.
                                                                              • Returns:
                                                                                The array with the watchmen-objects
                                                                                  query_temp_criminals
                                                                                  string * query_temp_criminals()
                                                                                  

                                                                                  This function returns the names of all online criminals with temporary records.
                                                                                  • Returns:
                                                                                    an array containing all the names.
                                                                                      query_total_severity
                                                                                      int query_total_severity(string criminal)
                                                                                      

                                                                                      Returns the severity-rating of all the crimes a criminal committed.
                                                                                      • Parameters:
                                                                                        criminal - the name of the criminal
                                                                                      • Returns:
                                                                                        the sum of all the severities or -1 if there are no crimes.
                                                                                          register_watchman
                                                                                          void register_watchman(object wm)
                                                                                          

                                                                                          This function is used to register a watchman-object for reinforcement issues.
                                                                                          • Parameters:
                                                                                            wm - The object to register.
                                                                                              remove_temporary_crime
                                                                                              int remove_temporary_crime(string criminal,
                                                                                                                         string short)
                                                                                              

                                                                                              Removes a temporary crime from a criminal's record.
                                                                                              • Parameters:
                                                                                                criminal - the name of the criminal
                                                                                                short - the short description of the crime to remove
                                                                                              • Returns:
                                                                                                1 on success, 0 on failure
                                                                                                  save_crimes
                                                                                                  int save_crimes()
                                                                                                  

                                                                                                  Saves the entire contents of the _criminals-mapping to the respective files.
                                                                                                  • Returns:
                                                                                                    1 if everything worked, otherwise 0
                                                                                                      save_this_criminal
                                                                                                      int save_this_criminal(string criminal)
                                                                                                      

                                                                                                      Function that saves a criminal's record and removes him from the mapping (can for instance be used if the player logs off).
                                                                                                      • Parameters:
                                                                                                        criminal - the name of the criminal
                                                                                                      • Returns:
                                                                                                        1 on success, 0 on failure
                                                                                                          set_gate_for
                                                                                                          void set_gate_for(string zone,
                                                                                                                            string file)
                                                                                                          
                                                                                                            set_prison_for
                                                                                                            void set_prison_for(string zone,
                                                                                                                                string file)
                                                                                                            

                                                                                                            This function is used to assign a prison to a given zone.
                                                                                                            • Parameters:
                                                                                                              zone - The name of the watch-zone
                                                                                                              file - The filename of the prison-object.
                                                                                                                unregister_watchman
                                                                                                                void unregister_watchman(object wm)
                                                                                                                

                                                                                                                This function is used to unregister a watchman-object when it dies.
                                                                                                                • Parameters:
                                                                                                                  wm - The object to unregister.

                                                                                                                  Classes

                                                                                                                  These are nice data types for dealing with... Data!

                                                                                                                  • crime
                                                                                                                    class crime {
                                                                                                                                  int time;
                                                                                                                                  string short;
                                                                                                                                  string long;
                                                                                                                                  int severity;
                                                                                                                    }
                                                                                                                    
                                                                                                                    
Valid HTML 4.01 Transitional
Valid CSS!
Read More