Top Mud Sites Forum

Top Mud Sites Forum (http://www.topmudsites.com/forums/index.php)
-   MUD Coding (http://www.topmudsites.com/forums/forumdisplay.php?f=9)
-   -   An age-old codebase (http://www.topmudsites.com/forums/showthread.php?t=397)

Delerak 08-17-2003 10:26 AM

Alright, I have this...what... codebase I guess. I tried compiling it with Make in mandrake linux. But I get about a thousand different errors in db.c, and I am far from a capable coder, is there anyone out there (KaVir?) that can take a look at the code and try to compile it in there system? I found this code somewhere on the net a long time ago, it's called Swordquest and I think it's all custom code, not sure, but I will upload it to my site and post a link to it if anyone replies and will help me out, thanks.

-Delerak

Yui Unifex 08-17-2003 10:28 AM

Try posting some of the errors to this forum. I'm sure someone can help ya out. An http link to the codebase is also useful.

Delerak 08-17-2003 11:14 AM

I can't recall the main error, I know it had mainly to do with db.c here is a link to the codebase, I can always go into mandrake, compile then copy/paste the errors.


Yui Unifex 08-17-2003 12:23 PM

These were the messages that I got:
[code] gcc -c -O -Wall -ggdb db.c
db.c;982;8; macro names must be identifiers
db.c; In function `load_resets';
db.c;942; warning; unused variable `pRoomIndex'
db.c;943; warning; unused variable `pexit'
db.c;932; warning; unused variable `buf'
db.c; In function `reset_area';
db.c;1525; warning; unused variable `pObjToIndex'
db.c; In function `find_string_references';
db.c;3031; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3037; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3050; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3056; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3069; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3075; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3088; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3094; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3107; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3113; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3126; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3132; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3142; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3153; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3159; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3170; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3176; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3187; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3193; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3204; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3210; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3221; warning; suggest explicit braces to avoid ambiguous `else'
db.c;3227; warning; suggest explicit braces to avoid ambiguous `else'
make; *** [db.o] Error 1[/quote]

The only thing preventing you from compiling that file is the line:
db.c:982:8: macro names must be identifiers

This line is an #ifdef 0 line that essentially removes a section of code up until the #endif. 0 is not an identifier, so you need to give it a better name with #define. At the top of the source file I added #define COMPILESECTION 0, and then I changed that line to #ifdef COMPILESECTION and it worked as advertised. There were no other errors in the compilation, except an undefined reference to crypt which is also easily remedied.

Edit: Err, and that should really be #if instead of #ifdef =).

Delerak 08-17-2003 05:35 PM

Thank you!

Delerak 08-17-2003 05:59 PM

What command did you use to boot the mud? I tried QUEST and QUESTstartup but they won't work. I think I fixed that other problem, here is what I get now.


Yui Unifex 08-17-2003 07:59 PM

In the Makefile, change the line that reads:
$(CC) $(L_FLAGS) -o $(OUT_FILE) $(O_FILES)

To:
$(CC) $(L_FLAGS) -o $(OUT_FILE) $(O_FILES) -lcrypt

And those undefined references should go away.

I did not start the mud, but that file named 'QUESTstartup' looks mighty suspicious.

Yui Unifex 08-17-2003 08:10 PM

Yeah, startup is indeed screwed up. You need to mkdir QUESTplr, QUESTlog, and QUESTrmsave. Then you need to edit the Makefile and change the line:
OUT_FILE = QUESTtest

To:
OUT_FILE = QUESTexecutable

Then edit QUESTarea/area.lst and move the areas 'ys.are' and 'food.are' above 'dcity.are'. The file should look something like this when you're done:
help.are
limbo.are
stdeq.are
food.are
ys.are
dcity.are
random.are
elfforst.are
celemir.are
outscele.are
$

Then it should work.

Delerak 08-17-2003 10:13 PM

Going to go try that now, thanks again Yui.

Delerak 08-17-2003 10:26 PM

Okay compiled worked. I'm trying to start it up now, when I do
./QUESTstartup it freezes my terminal, when I do ./QUESTexecutable is says area.1st no such file or folder. Now maybe I have to edit one of those?
*goes and gets a book on C*

-Delerak

Delerak 08-17-2003 10:28 PM

Woah, wait it minute, it's working, weird! Thanks Yui I got it!

-Delerak

Delerak 08-17-2003 10:32 PM

Man this is weird. Do I accept my own character within the shell, I can probably figure it out. I've finally found a codebase that I can work my RPI with. Praise be to alah. You are my god Unifex! Looking for an apprentice?

-Delerak

myrdred23 08-17-2003 10:55 PM

Btw, that base isn't custom like you thought, its obviously a diku/merc derivative, judging by the copyrights in the files. Either way, it doesn't mean its bad or anything, just thought you should know.

Delerak 08-18-2003 01:18 PM

Okay, I got it working, but I can't seem to get my character on. I had to create QUESTnewplr and I got the pfile, I looked over review.c but it doesn't give me much information except how to do it if I am online in the game and I can't get in the game without accepting myself, is there something I need to do to the pfile or is it a command in my shell? I've messed around for a while with it, any help? Yui come to my rescue again?

-Delerak

Yui Unifex 08-19-2003 08:07 PM

Alrighty, it's not too tough fix your playerfile. Move the unapproved pfile in QUESTnewplr to QUESTplr. Then edit the pfile and change the line that reads "Act 1604" to "Act 1600". That '4' signifies the UNAPPROVED bit for new players. With that gone, you should be able to login without problems. It looks like level 40 is also the highest immortal level (at least from looking at the command table), so you can set your level there too and login as an admin.

If you want to remove the approval process altogether, you can just comment out the line "SET_BIT( d->character->act, PLR_UNAPPROVED );" in comm.c line 1742.


All times are GMT -4. The time now is 02:41 PM.

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Top Mud Sites.com 2022