Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
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
Users Online
CommonCrawl, Google, Bing

Members: 0
Guests: 7
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Smaug Snippets » Small do_world change
Forum Rules | Mark all | Recent Posts

Small do_world change
< Newer Topic :: Older Topic > snippet to make do_world better

Pages:<< prev 1 next >>
Post is unread #1 Jan 20, 2005, 3:04 pm   Last edited Nov 18, 2007, 4:36 pm by Samson
Go to the top of the page
Go to the bottom of the page

Zarius
Apprentice
GroupMembers
Posts69
JoinedApr 23, 2002

in your Makefile add this section

build:
    @if [ -f .build ]; then 
        expr `cat .build` + 1 > .build; 
    else 
        echo '1' > .build; 
    fi
    @if [ -f .version ]; then 
        expr `cat .version` + 1 > .version; 
    else 
        echo '10001' > .version; 
    fi
    @if [ `cat .build` -ge 51 ]; then 
        echo '1' > .build; 
    fi
    @echo '#ifndef BUILD_H' > build.h
    @echo '#define BUILD_H' >> build.h
    @echo "#define LINKCOUNT   `cat .build`" >> build.h
    @echo '#endif' >> build.h
    @echo '#ifndef VERSION_H' > version.h
    @echo '#define VERSION_H' >> version.h
    @echo "#define VERSION   `cat .version`" >> version.h
    @echo '#endif' >> version.h
    @echo "Build number `cat .build`, version `cat .version` set."


Add build to the all: section so it looks like
all: build
    $(MAKE) -s afkmud
    $(MAKE) -s resolver


in mud.h find #define COPYRIGHT and under it add
#define COMPILE_TIME "Compiled on "  " at "  ".\r\n"
#define RELEASE      "Beta"


in act_info.c add these to the top
#define "version.h"
#define "build.h"


Further down look for the do_world function and above the function add this function
/* versionToString provided by Erwin S. Andreasen */
const char *versionToString ( int version )
{
    static char buf[64];

    sprintf ( buf, "%d.%02d.%02d", version / 10000,
              ( version - ( ( 10000 * ( version / 10000 ) ) ) ) / 100,
              version % 100 );
    return buf;
}


Then in do_world, replace all lines above system time with the following
    send_to_char( "&cBase source code: Smaug 1.4a\r\n", ch );
    ch_printf( ch, "Current source revision: %s %s\r\n", CODENAME, CODEVERSION );
    ch_printf( ch, "Current Version of %s is %s %s\r\n", sysdata.mud_name, versionToString ( VERSION ), RELEASE );
    ch_printf( ch, "Build Number : %d, %s\r\n", LINKCOUNT, COMPILE_TIME );
    ch_printf( ch, "%s first came online on: Thurs Jan 20 2005\r\n", sysdata.mud_name );
    ch_printf( ch, "%s last rebooted on: %s\r\n", sysdata.mud_name, str_boot_time );


Make clean and compile. Login and type world and you should see something like this

Base source code: Smaug 1.4a
Current source revision: AFKMud 1.64
Current Version of Mindcloud is 1.00.03 Beta
Build Number : 3, Compiled on Jan 20 2005 at 22:47:23.

Mindcloud first came online on: Thurs Jan 20 2005 <- hard coded date
Mindcloud last rebooted on: Thu Jan 20, 2005 10:52:23 PM PST

Zarius
       
Post is unread #2 Jan 21, 2005, 5:25 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002


in act_info.c add these to the top
Code Sample
#define "version.h"
#define "build.h"


I'm assuming you mean #include instead of #define with these, yes? You have the same thing in the instructions for the mapper code as well.
       
Post is unread #3 Jan 21, 2005, 2:41 pm
Go to the top of the page
Go to the bottom of the page

Zarius
Apprentice
GroupMembers
Posts69
JoinedApr 23, 2002


in act_info.c add these to the top
Code Sample
#define "version.h"
#define "build.h"


I'm assuming you mean #include instead of #define with these, yes? You have the same thing in the instructions for the mapper code as well.

Doh!, yep should be include. Think I'd learn my lesson by now



       
Pages:<< prev 1 next >>