ROM server with cygnus

Posted by Translucent Hate on Tue 13 Mar 2001 09:50 AM — 28 posts, 100,929 views.

USA #0
this is what i have when i do a make on the rom server

$ make
gcc -c -Wall -O -g db.c
db.c:54: conflicting types for `random'
/usr/lib/gcc-lib/i686-pc-cygwin/2.95.2-5/../../../../include/stdlib.h:117:
previous declaration of `random'
db.c:56: conflicting types for `srandom'
/usr/lib/gcc-lib/i686-pc-cygwin/2.95.2-5/../../../../include/stdlib.h:118:
previous declaration of `srandom'
make: *** [db.o] Error 1

not real sure where to look from there, but i have
had this error before, at it appears to relate to
cygnus itself...

any ideas?
Australia Forum Administrator #1
You need to amend the file "Makefile" slightly to change a couple of defines. Change the first four lines to look like this:


CC = gcc
PROF = -O -g
NOCRYPT = -DNOCRYPT
C_FLAGS = -Wall $(PROF) $(NOCRYPT) -DOLD_RAND


Specifically you are adding "-DNOCRYPT" to the end of line 3 and "-DOLD_RAND" to the end of line 4.

It is probably wise to start again, so do this then:


rm *.o
make


USA #2
that one worked perfectly... now all i need
is one with colors.. ;)

i'm trying out a MudOS too, but i don't know
what knowledge you have on that... but i'm
trying some simple things first.
Australia Forum Administrator #3
I haven't tried MudOS.
USA #4
this may not be covered but i haven't found anywhere
that has given me answers as quickly as you so here
goes... obviously i want to put color into the ROM
since text without ansi is dull... but when i use
the color code patch it doesn't seem to work, and
i think i might be doing the command wrong...

patch < patch_rom2.4_colour

if you know of the correct way to patch or this is
the right way and i may be doing something else
wrong or know of a rom24b6 thats got the color in
it, please let me know... i've been trying to figure
this patch deal out for a while because there are
lots of add-ons already created that i'd like to
patch, but if i'm doing the patch wrong, they'll
never work... thanks again.
Australia Forum Administrator #5
Where did you get the patch from (URL?) - I will try it myself and let you know.

One problem might be that you need to patch the exact version - depending on the way the patches are made. If it is a "context diff" it is not critical, but a different sort (which is by line number) is.

USA #6
its at http://www.inetsolve.com/~snip/snippets/colour_V2_0_tar.tar

also i am planning on adding OLC to the code as well and
make come across the same problem as the color in some way
of course i cant find the page for that but oh well
Australia Forum Administrator #7
I've got the file: romolc10.tar.gz

but I don't remember where it came from.
Australia Forum Administrator #8
It appears to work with 2.4b2 but not 2.4b6.

In other words, you want to have this version of ROM:


Rom24b2.tar.gz


The same remarks apply to the OLC code.

I did a 'diff' on b2 compared to b6, and there certainly seem to be substantial changes in b6, eg. adding the "follow" command, from what I can see.

Probably what I would do is:

a) Unpack both b2 and b6 into different directories.

b) Do a "context diff" to find out the differences, eg.


diff -c rom24b2/Rom24/src rom24b6/Rom24/src > patch_rom_b2_to_b6


This creates a file "patch_rom_b2_to_b6" that you can later use to patch the b2 version to bring it up to the b6 version. The "context diff" (indicated by -c) is more resilient to lines moving around.

c) Add OLC

d) Add colour

e) Apply the patch file obtained above, eg. something like:

patch < patch_rom_b2_to_b6

I can't guarantee this will work, but I think it is the right general approach. For example, maybe OLC and colour will be mutually incompatible, maybe more context diffs are needed. However I think it is worth trying.




USA #9
actually i got the olc file from the same site i got
the patch from... but i got the rom24olc171.tar.gz
one... pretty much the same but a newer version?
i'm guessing the same rules apply to this version as
to how to patch it in...
USA #10
ok, what i've ended up doing is what you said with
the rom24b2 and rom24b6 doing the diff and whatnot,
but when add the patch for color, it goes in fine,
but when i do a make i get this error...

$ make
rm -f rom
gcc -O -g -o rom act_comm.o act_enter.o act_info.o act_move.o act_obj.o act_wiz.o alias.o ban.o comm.o const.o db.o db2.o effects.o fight.o flags.o handler.o he
aler.o interp.o note.o lookup.o magic.o magic2.o music.o recycle.o save.o scan.o skills.o special.o tables.o update.o

act_info.o: In function `do_password':
/home/jmartin4/rom24b2/rom24/src/act_info.c:2714:
undefined reference to `crypt'
/home/jmartin4/rom24b2/rom24/src/act_info.c:2731:
undefined reference to `crypt'

comm.o: In function `nanny':
/home/jmartin4/rom24b2/rom24/src/comm.c:1651:
undefined reference to `crypt'
/home/jmartin4/rom24b2/rom24/src/comm.c:1763:
undefined reference to `crypt'
/home/jmartin4/rom24b2/rom24/src/comm.c:1786:
undefined reference to `crypt'

collect2: ld returned 1 exit status
make: *** [rom] Error 1

i was thinking i need to change in the makefile again,
but i had already made the changes you specified...
Australia Forum Administrator #11
The patch might have changed the makefile.

Certainly sounds like you need to add -DNOCRYPT to it again.
USA #12
nope... more like i was dumb and didn't
rm *.O ;)
heh...

all good... for now.
USA #13
it seems like OLC is a big pain to install...
the one you install manually changing the src files
isn't very helpful on where exactly in each file to
change, and the one i just copy files into the src
directory seems to give me the same problems....

basically the patch fails... possibly cause the
rom24b2 is too old to patch olc into?
Australia Forum Administrator #14
I thought I got it to work with rom24b2 however you probably have to have an unpatched version. That is, don't add colour first.

However then you may have the problem that the colour patch won't work. :)
USA #15
i think my problem with romolc10.tar.gz is that it
is a pain in the butt, because i have to go through
and change stuff, and from the instructions its kind
of detailed on how but where specifically to put them
doesn't seem to make much sense to me... i've tried
a couple other versions of the olc with the proper
source code and they seem to patch fine usually but
then lots of errors later... i'll figure it out...
then again, who needs areas? ;)
USA #16
i'm done with trying to get olc and color happy with
each other.. its pretty much hopeless regardless of
what versions i use... but i did find this source
code with olc and color already in it, and it is
rom24b6... i think i have another makefile error,
but i'm not sure... maybe you could help?

here is the makefile

CC = gcc
PROF = -O -ggdb
NOCRYPT =
C_FLAGS = -Wall $(PROF) $(NOCRYPT)
L_FLAGS = $(PROF)

O_FILES = act_comm.o act_enter.o act_info.o act_move.o act_obj.o act_wiz.o \
alias.o ban.o comm.o const.o db.o db2.o effects.o fight.o flags.o \
handler.o healer.o interp.o note.o lookup.o magic.o magic2.o \
music.o recycle.o save.o scan.o skills.o special.o tables.o \
update.o mob_cmds.o mob_prog.o olc.o olc_act.o olc_save.o bit.o \
mem.o string.o olc_mpcode.o hedit.o

rom: $(O_FILES)
rm -f rom
$(CC) $(L_FLAGS) -o rom $(O_FILES) -lcrypt

.c.o: merc.h
$(CC) -c $(C_FLAGS) $<

Both DOLD_RAND and DNOCRYPT give me errors galore...
undefined reference errors....

here is the source just in case you want to have a look
cause as of right now i'm lost in thoughts....

http://kyndig.com/cgi-bin/codes/search.cgi?query=ghost

Australia Forum Administrator #17
OK, here is what I did:

1. Copied makefilelinux to Makefile
2. Changed the third line of Makefile to:


NOCRYPT = -DNOCRYPT -DOLD_RAND


3. Changed the list of files in Makefile to:


O_FILES = act_comm.o act_enter.o act_info.o act_move.o act_obj.o act_wiz.o \
alias.o ban.o comm.o const.o db.o db2.o effects.o fight.o flags.o \
handler.o healer.o interp.o note.o lookup.o magic.o magic2.o \
music.o recycle.o save.o scan.o skills.o special.o tables.o \
update.o mob_cmds.o mob_prog.o olc.o olc_act.o olc_save.o bit.o \
mem.o string.o olc_mpcode.o hedit.o NewMagic.o act_newc.o \
remort.o bank.o


Basically this involved adding the following files to the end:


NewMagic.o act_newc.o remort.o bank.o


4. Edited the file merc.h, and at around line 2915, changed:


char * crypt (char *, char *);


to


#ifndef NOCRYPT
char * crypt (char *, char *);
#endif


Then it compiled without errors. :)

Amended on Thu 15 Mar 2001 06:15 PM by Nick Gammon
#18
I am trying to compile with cygwin. But I get the following errors:
$ make
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND const.c
const.c:433: parse error before `{'
const.c:433: warning: missing braces around initializer
const.c:433: warning: (near initialization for `pc_race_table[5].class_mult')
const.c:435: warning: initialization makes pointer from integer without a cast
const.c:435: warning: initialization makes pointer from integer without a cast
const.c:436: warning: initialization makes pointer from integer without a cast
const.c:437: parse error before `}'
make: *** [const.o] Error 1

------
Thanks for your time.

#19
Well I figured out thats problem....I was using the wrong source( I'm not the brightest buld in the pack sometimes)
now i get this:
magic.c:643: warning: suggest explicit braces to avoid ambiguous `else'
magic.c: In function `spell_earthquake':
magic.c:2203: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND magic2.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND music.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND note.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND recycle.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND save.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND scan.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND skills.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND special.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND tables.c
gcc -c -Wall -O -g -DNOCRYPT -DOLD_RAND update.c
rm -f rom
gcc -o rom act_comm.o act_enter.o act_info.o act_move.o act_obj.o act_wiz.o al
ias.o ban.o comm.o const.o db.o db2.o effects.o fight.o flags.o handler.o healer
.o interp.o lookup.o magic.o magic2.o music.o note.o recycle.o save.o scan.o ski
lls.o special.o tables.o update.o \
/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-2/../../../../i686-pc-cygwin/bin/ld: cann
ot open : Permission denied
collect2: ld returned 1 exit status
make: *** [rom] Error 1

What did I do now?

Australia Forum Administrator #20
Check out the posts about "SWR server" - the guy compiling that had similar problems (I know it is SMAUG and not ROM, but the same principles apply).
#21
I tried the things there but i still get the errors =(.
Australia Forum Administrator #22
I don't know what to suggest. Check you have a "bin" directory (above the src directory).

Check you have the latest Cygwin.
#23
I downloaded Lordroms distribution and it worked fine so thanks for the help.
#24
I am having trouble removing the stock area to free up vnums. I was leaving the usual...

help
limbo
immort
midgaard
..

but it doesnt work. Id there more hard coded vnums in this windows version than the standard dist?

if so exactly what can I remove. in the meantime I'll be digging for them in the source.

-MrJones
Amended on Wed 02 May 2001 04:26 PM by Mrjones
Australia Forum Administrator #25

Check out this forum topic:

Question about Areas

I list various vnums there (obtained from the source) which is not necessarily comprehensive.

#26
Hello, i have a few problems.... when i compile rom24 i no longer get errors just many warnings about explicit brackets. Then i get the rom.exe but when i run it all that happens is a window flashes up on the screen, then imediately it goes away. Any suggestions.



Joey
Australia Forum Administrator #27
Try opening a command window (DOS window) and running from there. At least then the window will not just pop up and then disappear.

Then, in the command window, change to the area directory. eg.


cd ../area
../src/rom


That will work a lot better.