Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!, Google

Members: 0
Guests: 20
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » Saveall Command.
Forum Rules | Mark all | Recent Posts

Saveall Command.
< Newer Topic :: Older Topic > Problems with installing SAVEALL Sn

Pages:<< prev 1 next >>
Post is unread #1 Jan 25, 2003, 5:56 pm
Go to the top of the page
Go to the bottom of the page

Merlin

GroupMembers
Posts5
JoinedJun 17, 2002

As I have found out the current version of AFKMud does not have a command which saves everything. Lucky my dear friend at Lands Of Pabulum, Paradigm, has let me have a copy of his save all snippet. The only problem is that I cannot install it. Well I can, but I am getting a few bugs. Plus I am not too sure if I am adding it correctly.

Below you will find the code for the save all command. :unsure:

/*************************************************************
* Lands of Pabulum Mud                                      *
* http://pabulum.rmud.net                                   *
*                       *
* by Kristopher Powell (Paradigm)                           *
* klpowell@rmud.net                                         *
* 4-22-02                                                    *
*************************************************************
* What is this snippet? *
* This snippets saves pretty much everything in the *
*  in the mud such as helpfiles, players, classes,          *
*  builder's areas, and many more little things.  I know    *
*  there are many versions of this snippet out there but    *
*  this is my version.                                      *
*************************************************************
* Rules for Use.                                            *
* 1. Please leave my header at the top.                     *
* 2. Send me an email so i know that people are using my    *
*    stuff. That way i may be inclined to release more      *
* 3. You may edit in any way you wish just keep my header   *
* 4. If you find any bugs send email them to me             *
*************************************************************
* Install Notes                                             *
* 1. Add the proper DECLARE_DO_FUN( do_saveall       );     *
* to the right place.                                  *
* 2. Added the declaration to tables.c remember there are   *
*   two places to add them.                              *
* 3. Make clean and compile thats it :)                     *
*   *
* Note: this is my first snippet so take it easy on me and  *
* if you find any errors please send them to me at     *
* klpowell@rmud.net Thanks Paradigm *
*************************************************************
* Save All Function *
*   Version 1.2 *
*         7-05-02                             *
*************************************************************/
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include "mud.h"
#ifdef WIN32
  #include <io.h>
  #define F_OK 0
#endif

char buf[MSL];
void do_saveall( CHAR_DATA *ch, char *argument )
{
   CHAR_DATA   *pfs;
   AREA_DATA   *barea;
   char         filename[256];

set_pager_color( AT_YELLOW, ch );
send_to_char( "Save all in process this may take a few moments\n\r", ch );
send_to_char( "depending on the amount of players that are on.\n\r", ch );
/* Save The Help Files.because I hate losing helpfiles */
do_hset( ch, "save" );

/* Save all the areas in the Building Directory that are loaded */
  set_pager_color( AT_PLAIN, ch );
  send_to_char( "Saving Builders Areas....\n\r", ch );
  for ( barea = first_build; barea; barea = barea->next )
   {
      if ( !IS_SET(barea->status, AREA_LOADED ) )
      {
         continue;
      }
      sprintf( filename, "%s%s", BUILD_DIR, barea->filename );
      fold_area( barea, filename, FALSE );
   }


/* Save all characters now */
  set_pager_color( AT_PLAIN, ch );
  send_to_char( "Saving all online players.\n\r", ch );
  for ( pfs = first_char; pfs; pfs = pfs->next )
   {
       if ( !IS_NPC( pfs ) )
       {
          save_char_obj( pfs );
          set_pager_color( AT_RED, ch );
          pager_printf( ch, "Now Saving %-s...\n\r", pfs->name);

       }
   }


sprintf (buf, "\n\rYou have been saved by your friendly immortal: %s ...\n\r", ch->name);
do_echo( ch, buf );
/* Time to save the Easier Stuff */


/* Lets Save Classes */
save_classes();
set_pager_color( AT_PLAIN, ch );
send_to_char( "Classes Saved.\n\r", ch );


/* Save the commands table just incase */
save_commands();
set_pager_color( AT_PLAIN, ch );
send_to_char( "Commands Tables Saved.\n\r", ch );


/* Save the Socials table */
save_socials();
set_pager_color( AT_PLAIN, ch );
send_to_char( "Socials Table Saved.\n\r", ch );

/* save the skills table */
save_skill_table();
set_pager_color( AT_PLAIN, ch );
send_to_char( "Skill Table Saved.\n\r", ch );

/* Save the herb table */
save_herb_table();
set_pager_color( AT_PLAIN, ch );
send_to_char( "Herb Table Saved.\n\r", ch );

/* Save the hometowns */

/* Everything is saved so lets tell the immortal that */

send_to_char( "\n\r", ch );
set_pager_color( AT_PLAIN, ch );
send_to_char( "All Game Data is Now Saved!!.\n\r", ch );
send_to_char( "You May Now Reboot the Mud!!..\n\r", ch );
}

/* End of Paradigm's Save all Snippet */


That errors below on compile are shown below:-

The way I added this was simply did "cedit saveall create do_saveall" in the mud, and then added the saveall.c to the make file and the errors i got was..... :blink:

cc1: warnings being treated as errors
saveall.c: In function `do_saveall':
saveall.c:62: warning: implicit declaration of function `do_hset'
saveall.c:94: warning: implicit declaration of function `do_echo'
saveall.c:105: warning: implicit declaration of function `save_commands'
saveall.c:111: warning: implicit declaration of function `save_socials'
make[2]: *** [o/saveall.o] Error 1
make[2]: Leaving directory `/home/shadowx/codebases/afkmud/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/shadowx/codebases/afkmud/src'
make: *** [clean] Error 2



But the funny thing is they refer to the AFKMud correctly. (If that makes any sense).


Sorry if it looks a little messy up at the top. Anyways that's the save all command (saveall.c) even.

I will be very very greatfull if anyone would be able to help me install this correctly on AFKMud.

Thanks Merlin.
       
Post is unread #2 Jan 25, 2003, 7:16 pm
Go to the top of the page
Go to the bottom of the page

Orion
Master Member
GroupMembers
Posts35
JoinedNov 12, 2002

I'm going to assume you know how to declare a function for use in a file. Since the files you have already included in your saveall snippet, apparently, do not contain the functions being called, you need to declare them.

If you don't know how to declare them, look through some of the other *.c files for local and global declarations, as that will show you how to declare the functions you need in saveall.
       
Post is unread #3 Jan 26, 2003, 3:12 am
Go to the top of the page
Go to the bottom of the page

Merlin

GroupMembers
Posts5
JoinedJun 17, 2002

Thank you. Sorry if it sounded rather stupid to you.

Melin.
       
Post is unread #4 Jan 26, 2003, 6:07 am
Go to the top of the page
Go to the bottom of the page

Orion
Master Member
GroupMembers
Posts35
JoinedNov 12, 2002

Nah, not dumb. Just new. :)
       
Pages:<< prev 1 next >>