Home

[Package Index | Mudlib Index | Effect Index]

File /std/room/inherit/newspaper_office.c

An office from which a player run newspaper can be run.

Written by Obilix

Change history

  • Pinkfish Fri Apr 27 12:08:29 PDT 2001
    Turned into an inherit and made to use a newspaper handler for distributing the actual text.

Includes

This class includes the following files /include/board.h, /include/room/newspaper.h, /include/move_failures.h, /include/shops/bank.h, /include/housing.h, /include/nroff.h, /include/player_handler.h, /include/money.h and /include/mail.h

Class Index

Method index

Public Functions

These are functions that everyone can access.

.

    add_editor
    void add_editor(string word)
    

    This method adds a new editor to the paper.
    • Parameters:
      word - the new editor to add
    add_reporter
    void add_reporter(string word)
    

    This method adds a new reporter to the paper.
    • Parameters:
      word - the new reporter to add
        add_setter
        void add_setter(string word)
        

        This method adds a new setter to the paper.
        • Parameters:
          word - the new setter to add
            add_sponsor
            void add_sponsor(string word)
            

            This method adds a new sponsor to the paper.
            • Parameters:
              word - the new sponsor to add
                board_access_check
                int board_access_check(int type,
                                       string board,
                                       object previous,
                                       string name)
                

                This method is here to control access to a board if one is requested. It allows only reporters to be able to see or write to it and it allows editors to be able to eat messages from it.
                  delete_article
                  void delete_article(class our_article article)
                  

                  This method deletes any bitsof the article off the disk.
                  • Parameters:
                    article - the article to delete
                      do_advert_list
                      int do_advert_list()
                      
                        do_category_add
                        int do_category_add(string category)
                        
                          do_category_cost
                          int do_category_cost(string category,
                                               string cost)
                          
                            do_category_cost_per_ten_chars
                            int do_category_cost_per_ten_chars(string category,
                                                               string cost)
                            
                              do_category_list
                              int do_category_list()
                              
                                do_category_open
                                int do_category_open(string category,
                                                     string open)
                                
                                  do_category_remove
                                  int do_category_remove(string category)
                                  
                                    do_everyone_status
                                    int do_everyone_status()
                                    

                                    This is the status that everyone can see, not just the employees.
                                      do_lock
                                      int do_lock(int locked)
                                      
                                        do_submit_add
                                        int do_submit_add(string category)
                                        
                                          is_editor
                                          int is_editor(string word)
                                          

                                          This method checks to see if the specified person is an editor for the paper or not.
                                          • Parameters:
                                            word - the person to check
                                          • Returns:
                                            1 if they are a editor
                                              is_locked
                                              int is_locked(class article art)
                                              

                                              This method checks to see if the specified article is locked or not.
                                              • Parameters:
                                                art - the article to check
                                              • Returns:
                                                1 if it is locked, 0 if not
                                                  is_owner
                                                  int is_owner(string word)
                                                  

                                                  This method checks to see if the specified person is an owner of the paper or not.
                                                  • Parameters:
                                                    word - the person to check
                                                  • Returns:
                                                    1 if they are a owner
                                                      is_postponed
                                                      int is_postponed(class article art)
                                                      

                                                      This method checks to see if the specified article is postponed or not.
                                                      • Parameters:
                                                        art - the article to check
                                                      • Returns:
                                                        1 if it is postponed, 0 if not
                                                          is_reporter
                                                          int is_reporter(string word)
                                                          

                                                          This method checks to see if the specified person is an reporter for the paper or not.
                                                          • Parameters:
                                                            word - the person to check
                                                          • Returns:
                                                            1 if they are a reporter
                                                              is_setter
                                                              int is_setter(string word)
                                                              

                                                              This method checks to see if the specified person is an setter for the paper or not.
                                                              • Parameters:
                                                                word - the person to check
                                                              • Returns:
                                                                1 if they are a setter
                                                                  is_sponsor
                                                                  int is_sponsor(string word)
                                                                  

                                                                  This method checks to see if the specified person is a sponsor for the paper or not.
                                                                  • Parameters:
                                                                    word - the person to check
                                                                  • Returns:
                                                                    1 if they are a sponsor
                                                                      load_article_text
                                                                      string load_article_text(class our_article art)
                                                                      

                                                                      This method loads the text of an article.
                                                                        load_article_text_by_file
                                                                        string load_article_text_by_file(string fname)
                                                                        

                                                                        This method is used by the web, it loads the article by the file name.
                                                                          move_article
                                                                          int move_article(int index,
                                                                                           string up_down)
                                                                          

                                                                          This method moves an article up or down in the current article list.
                                                                          • Parameters:
                                                                            index - the index of the article to move
                                                                            up_down - move it up or down
                                                                              ownership_change
                                                                              void ownership_change(string old_owner,
                                                                                                    string new_owner)
                                                                              

                                                                              This method is called by the housing system when the ownership changes.
                                                                              • Parameters:
                                                                                old_owner - the old owner
                                                                                new_owner - the newowner
                                                                                  query_ads
                                                                                  class advert * query_ads()
                                                                                  
                                                                                    query_all_articles
                                                                                    class article * query_all_articles()
                                                                                    

                                                                                    This method returns the 'article' class bits of the articles.
                                                                                    • Returns:
                                                                                      all the articles.\
                                                                                        query_all_editors
                                                                                        string * query_all_editors()
                                                                                        

                                                                                        This method returns all the current editors of the magazine.
                                                                                        • Returns:
                                                                                          all the current editors
                                                                                            query_all_payees
                                                                                            mapping query_all_payees()
                                                                                            

                                                                                            This method returns all the current payees of the magazine.
                                                                                            • Returns:
                                                                                              who is to be payed and how much
                                                                                                query_all_reporters
                                                                                                string * query_all_reporters()
                                                                                                

                                                                                                This method returns all the current reporters of the magazine.
                                                                                                • Returns:
                                                                                                  all the current reporters
                                                                                                    query_all_setters
                                                                                                    string * query_all_setters()
                                                                                                    

                                                                                                    This method returns all the current setters of the magazine.
                                                                                                    • Returns:
                                                                                                      all the current setters
                                                                                                        query_all_sponsors
                                                                                                        string * query_all_sponsors()
                                                                                                        

                                                                                                        This method returns all the current sponsors of the magazine.
                                                                                                        • Returns:
                                                                                                          all the current sponsors
                                                                                                            query_article
                                                                                                            class our_article query_article(string match)
                                                                                                            

                                                                                                            This method finds an article based on a string.
                                                                                                            • Returns:
                                                                                                              the article
                                                                                                                query_article_index
                                                                                                                int query_article_index(string match)
                                                                                                                

                                                                                                                This method returns the index of the article in the article array.
                                                                                                                • Returns:
                                                                                                                  the article index
                                                                                                                    query_article_log_file_name
                                                                                                                    string query_article_log_file_name()
                                                                                                                    

                                                                                                                    The file name of the log file for article events.
                                                                                                                    • Returns:
                                                                                                                      the article log file name
                                                                                                                        query_articles
                                                                                                                        class our_article * query_articles()
                                                                                                                        
                                                                                                                          query_bank_branch
                                                                                                                          string query_bank_branch()
                                                                                                                          

                                                                                                                          This method returns the bank branch to use for depositing money for editions.
                                                                                                                          • Returns:
                                                                                                                            the bank branch to use
                                                                                                                              query_category
                                                                                                                              string query_category(string category)
                                                                                                                              

                                                                                                                              This method tries to find a category based on some fuzzy matching.
                                                                                                                              • Parameters:
                                                                                                                                category - the category to lookup
                                                                                                                              • Returns:
                                                                                                                                the fixed up category name
                                                                                                                                  query_current_edition
                                                                                                                                  int query_current_edition()
                                                                                                                                  

                                                                                                                                  This method returns the current edition of the newspaper./
                                                                                                                                  • Returns:
                                                                                                                                    the current edition of the newspaper
                                                                                                                                      query_log_file_name
                                                                                                                                      string query_log_file_name()
                                                                                                                                      

                                                                                                                                      The file name of the log file for events.
                                                                                                                                      • Returns:
                                                                                                                                        the log file name
                                                                                                                                          query_next_article_file_name
                                                                                                                                          string query_next_article_file_name()
                                                                                                                                          

                                                                                                                                          This returns the next number to use for an article.
                                                                                                                                          • Returns:
                                                                                                                                            the next article number
                                                                                                                                              query_owner
                                                                                                                                              string query_owner()
                                                                                                                                              

                                                                                                                                              This method returns the current owner of the paper.
                                                                                                                                              • Returns:
                                                                                                                                                the owner of the paper
                                                                                                                                                  query_paper_name
                                                                                                                                                  string query_paper_name()
                                                                                                                                                  

                                                                                                                                                  This method returns the name of the paper.
                                                                                                                                                  • Returns:
                                                                                                                                                    the name of the paper
                                                                                                                                                      query_proxy
                                                                                                                                                      string query_proxy()
                                                                                                                                                      

                                                                                                                                                      This method returns the proxy for this room.
                                                                                                                                                      • Returns:
                                                                                                                                                        the proxy for the room
                                                                                                                                                          query_the_paper_name
                                                                                                                                                          string query_the_paper_name()
                                                                                                                                                          

                                                                                                                                                          This method returns the name of the paper with a 'the' in front.
                                                                                                                                                          • Returns:
                                                                                                                                                            the name of the paper
                                                                                                                                                              query_total_profit
                                                                                                                                                              int query_total_profit(int num_articles)
                                                                                                                                                              

                                                                                                                                                              This method figures out the total profit from the paper.
                                                                                                                                                                remove_editor
                                                                                                                                                                void remove_editor(string word)
                                                                                                                                                                

                                                                                                                                                                This method removes a editor from the paper.
                                                                                                                                                                • Parameters:
                                                                                                                                                                  word - the editor to remove
                                                                                                                                                                    remove_reporter
                                                                                                                                                                    void remove_reporter(string word)
                                                                                                                                                                    

                                                                                                                                                                    This method removes a reporter from the paper.
                                                                                                                                                                    • Parameters:
                                                                                                                                                                      word - the reporter to remove
                                                                                                                                                                        remove_setter
                                                                                                                                                                        void remove_setter(string word)
                                                                                                                                                                        

                                                                                                                                                                        This method removes a setter from the paper.
                                                                                                                                                                        • Parameters:
                                                                                                                                                                          word - the setter to remove
                                                                                                                                                                            remove_sponsor
                                                                                                                                                                            void remove_sponsor(string word)
                                                                                                                                                                            
                                                                                                                                                                              save_article_text
                                                                                                                                                                              void save_article_text(class our_article art,
                                                                                                                                                                                                     string text)
                                                                                                                                                                              

                                                                                                                                                                              This method saves an article.
                                                                                                                                                                                save_article_text_by_file
                                                                                                                                                                                void save_article_text_by_file(string fname,
                                                                                                                                                                                                               string text)
                                                                                                                                                                                

                                                                                                                                                                                This method is used by the web, it loads the article by the file name.
                                                                                                                                                                                  set_article_title_by_file
                                                                                                                                                                                  void set_article_title_by_file(string fname,
                                                                                                                                                                                                                 string title)
                                                                                                                                                                                  

                                                                                                                                                                                  This method is used by the web, it loads the article by the file name.
                                                                                                                                                                                    set_bank_branch
                                                                                                                                                                                    void set_bank_branch(string bank)
                                                                                                                                                                                    

                                                                                                                                                                                    This method sets the bank branch to use for depositing money when editions are made.
                                                                                                                                                                                    • Parameters:
                                                                                                                                                                                      bank - the bank branch to use
                                                                                                                                                                                        set_owner
                                                                                                                                                                                        void set_owner(string person)
                                                                                                                                                                                        

                                                                                                                                                                                        This method sets the current owner of the paper.
                                                                                                                                                                                        • Parameters:
                                                                                                                                                                                          person - the new owner
                                                                                                                                                                                            set_paper_name
                                                                                                                                                                                            string set_paper_name(string name)
                                                                                                                                                                                            

                                                                                                                                                                                            This method sets the name of the paper.
                                                                                                                                                                                            • Parameters:
                                                                                                                                                                                              name - the new name of the paper
                                                                                                                                                                                                set_proxy
                                                                                                                                                                                                void set_proxy(string proxy)
                                                                                                                                                                                                

                                                                                                                                                                                                This method sets up a proxy for the room. A proxy means all the commands are mirrored to the real location, so save files do not get messed up. You set this if you have any extra rooms you want to be able to control the paper.
                                                                                                                                                                                                • Parameters:
                                                                                                                                                                                                  proxy - the proxy to set
                                                                                                                                                                                                    set_save_directory
                                                                                                                                                                                                    void set_save_directory(string dir)
                                                                                                                                                                                                    

                                                                                                                                                                                                    This method sets the directory we are to use for all the temporary files and data. The actual pubished data will be stored by the newspaper handler.
                                                                                                                                                                                                    • Parameters:
                                                                                                                                                                                                      dir - the directory to put stuff in
                                                                                                                                                                                                        update_commands
                                                                                                                                                                                                        void update_commands(string word)
                                                                                                                                                                                                        

                                                                                                                                                                                                        This method moves the player in and out of the room to fix up their commands.
                                                                                                                                                                                                        • Parameters:
                                                                                                                                                                                                          word - the player to move

                                                                                                                                                                                                          Protected Functions

                                                                                                                                                                                                          These are functions that only objects inheriting the class can access.

                                                                                                                                                                                                            load_me
                                                                                                                                                                                                            void load_me()
                                                                                                                                                                                                            

                                                                                                                                                                                                            Loads the data in the file.
                                                                                                                                                                                                              save_me
                                                                                                                                                                                                              void save_me()
                                                                                                                                                                                                              

                                                                                                                                                                                                              Saves the data in the file.

                                                                                                                                                                                                              Classes

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

                                                                                                                                                                                                              • category_data
                                                                                                                                                                                                                class category_data {
                                                                                                                                                                                                                                      int cost_per_add;
                                                                                                                                                                                                                                      int cost_per_ten_chars;
                                                                                                                                                                                                                                      int open;
                                                                                                                                                                                                                }
                                                                                                                                                                                                                
                                                                                                                                                                                                                
                                                                                                                                                                                                              • our_article
                                                                                                                                                                                                                class our_article {
                                                                                                                                                                                                                                    class article art;
                                                                                                                                                                                                                                    int flags;
                                                                                                                                                                                                                                    int length;
                                                                                                                                                                                                                                    int suggested_payment;
                                                                                                                                                                                                                }
                                                                                                                                                                                                                
                                                                                                                                                                                                                
                                                                                                                                                                                                              • payee_data
                                                                                                                                                                                                                class payee_data {
                                                                                                                                                                                                                                   int paid;
                                                                                                                                                                                                                                   string message;
                                                                                                                                                                                                                }
                                                                                                                                                                                                                
                                                                                                                                                                                                                
                                                                                                                                                                                                              • reporter
                                                                                                                                                                                                                class reporter {
                                                                                                                                                                                                                                 int date_added;
                                                                                                                                                                                                                                 int num_articles;
                                                                                                                                                                                                                                 int total_payed;
                                                                                                                                                                                                                }
                                                                                                                                                                                                                
                                                                                                                                                                                                                
Valid HTML 4.01 Transitional
Valid CSS!
Read More