18 Dec, 2010, phobos wrote in the 1st comment:
Votes: 0
Hello I previously posted trying to exchange my building for coding and got the suggestion that I should get a source and learn more hands on. So I'm here to basicly see how to start this…I've read tons of books and web-tutorials but they just arn't cutting it.

I'm mostly into SWR muds so i downloaded swfote2.1 and Dev-C++ but i'm not sure if i need anything else….If I don't need anything else how do i start compile so see if theres bugs?

if ( "$1" != "" ) set port="$1"

cd ../area

nohup
nice
limit stack 1024k
unlimit core
if ( -e shutdown.txt ) rm -f shutdown.txt

while ( 1 )
set index = 1000
while ( 1 )
set logfile = ../log/$index.log
if ( ! -e $logfile ) break
@ index++
end

date > $logfile
date > ../area/boot.txt

# Run SWR.
# Check if already running
set matches = `netstat -an | grep ":$port " | grep -c LISTEN`
if ( $matches >= 1 ) then
# Already running
echo Port $port is already in use.
exit 0
endif
../bin/swr $port >&! $logfile

if ( -e shutdown.txt ) then
rm -f shutdown.txt
exit 0
endif
sleep 10

end
18 Dec, 2010, drifton wrote in the 2nd comment:
Votes: 0
i would recommend a few things, the code you posted is a startup script for a unix-like enviroment, if you are on windows you are going to need something like cygwin installed in order to run that script

as for compiling the code you can install a compiler with cygwin and to compile it there will be instructions
common steps are to run ./configure then make

for a more direct windows method i would recommend the mingw gcc compiler port
Mingw Gcc Compiler this is the base compiler with Dev-c++
if you like dev-c++ as an ide you should look at wxdesign it is a more upto date version

alternatives are codeblocks just an ide that will work with both mingw and cygwin or even the microsoft compilers
microsoft visual c++ express - compiler and ide

issues you are going to have are going to be related to how out of date the code is its over 4 years old
so it may be difficualt to compile on newer compilers
18 Dec, 2010, phobos wrote in the 3rd comment:
Votes: 0
Thank you much got compiler and working on debugging!

Ok twenty minutes and and was doin good got almost done but i dont know how to make the startup end….Here is the startup

if /bin/csh -f

set port = 1530
if "$1" != "" set port="$1"

cd ../area

nohup
nice
limit stack 1024k
unlimit core
if -e shutdown.txt rm -f shutdown.txt

while 1
set index = 1000
while 1
set logfile = ../log/$index.log
if ! -e $logfile break
@ index++
end

date > $logfile
date > ../area/boot.txt

# Run SWR.
# Check if already running
set matches = `netstat -an | grep ":$port " | grep -c LISTEN`
if $matches >= 1 then
# Already running
echo Port $port is already in use.
exit 0
endif
../bin/swr $port >&! $logfile

if -e shutdown.txt then
rm -f shutdown.txt
exit 0
endif
sleep 10

end
19 Dec, 2010, drifton wrote in the 4th comment:
Votes: 0
how are you running the makefile, in the source directory try just typing make in the 'src' directory, and see if it will compile for your, on ubuntu i was able to get it to compile just fine, fired off several warnings but pretty much just compiled with out me having to fix anything, I'll see if i can get it to compile on windows and cygwin.

aditionally when you installed cygwin you'll need to make sure you installed the csh package i can't remember what installs by default, its been years since i've used cygwin.
19 Dec, 2010, phobos wrote in the 5th comment:
Votes: 0
If im in src and just type make it cant find command…

./makefile is what i have been typing and when i do that it shoots off

$ ./makefile
./makefile: line 2: PROF: command not found
./makefile: line 3: NOCRYPT: command not found
./makefile: line 6: NEED_DL: command not found
./makefile: line 12: EXPORT_SYMBOLS: command not found
./makefile: line 14: EXPORT_SYMBOLS: command not found
./makefile: line 14: CYGWIN_FLAG: command not found
./makefile: line 14: PROF: command not found
./makefile: line 14: NOCRYPT: command not found
./makefile: line 14: DBUGFLG: command not found
./makefile: line 14: EXPORT_SYMBOLS: command not found
./makefile: line 14: C_FLAGS: command not found
./makefile: line 15: PROF: command not found
./makefile: line 15: EXPORT_SYMBOLS: command not found
./makefile: line 15: CYGWIN_FLAG: command not found
./makefile: line 15: NEED_DL: command not found
./makefile: line 15: L_FLAGS: command not found
./makefile: line 18: USECARGO: command not found
./makefile: line 20: ifdef: command not found
./makefile: line 21: C_FLAGS: command not found
./makefile: line 21: C_FLAGS: command not found
./makefile: line 22: endif: command not found
./makefile: line 25: C_FILES: command not found
./makefile: line 35: C_FILES: command not found
./makefile: line 35: patsubst: command not found
./makefile: line 35: O_FILES: command not found
./makefile: line 37: wildcard: command not found
./makefile: line 37: H_FILES: command not found
./makefile: line 39: SWR: command not found
./makefile: line 40: SWR_OLD: command not found
./makefile: line 41: COPYFILE: command not found
./makefile: line 43: all:: command not found
./makefile: line 44: MAKE: command not found
./makefile: line 44: -s: command not found
./makefile: line 47: ifdef: command not found
./makefile: line 48: -include: command not found
./makefile: line 49: endif: command not found
./makefile: line 51: O_FILES: command not found
./makefile: line 51: swr:: command not found
./makefile: line 52: SWR: command not found
./makefile: line 53: ifdef: command not found
Generating dependency file …
./makefile: line 55: CC: command not found
./makefile: line 55: C_FLAGS: command not found
./makefile: line 55: C_FILES: command not found
./makefile: line 55: -MM: command not found
./makefile: line 56: perl: command not found
./makefile: line 57: syntax error near unexpected token `else'
./makefile: line 57: `else'


The only packages i see having anything to do with csh is tcsh and scsh both of which i now have with no difference.
19 Dec, 2010, drifton wrote in the 6th comment:
Votes: 0
yeah just type 'make' after you navigate to the it should then compile the sourcecode
19 Dec, 2010, phobos wrote in the 7th comment:
Votes: 0
It tells me command not found
19 Dec, 2010, Cratylus wrote in the 8th comment:
Votes: 0
phobos said:
It tells me command not found


So maybe you need to install "make"?
19 Dec, 2010, phobos wrote in the 9th comment:
Votes: 0
Yeah i was missing some lib files for cygwin…ok have make now.

These errors spam when i make


warning: array subscript has type `char'
the address of `arg1' will always evaluate as `true'
the address of `arg2' will always evaluate as `true'


If i try to make more then once this is the only error that comes up after the initial make

$ make
make -s swr
/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld: warning: –
export-dynamic is not supported for PE targets, did you mean –export-all-symbol
s?

Done compiling mud.

After the make stops running it says compile done. Though I can't use ./startup now….its says limit command not found and unlimit command not found
19 Dec, 2010, drifton wrote in the 10th comment:
Votes: 0
the warnings are fine, it should of produced swr.exe with in the source directory

edit:

found that you also need to install the zlib-devel packaged also
19 Dec, 2010, Tyche wrote in the 11th comment:
Votes: 0
phobos said:
After the make stops running it says compile done. Though I can't use ./startup now….its says limit command not found and unlimit command not found


Delete the lines. You don't need the limit and unlimit on cygwin.
19 Dec, 2010, phobos wrote in the 12th comment:
Votes: 0
Ok deleted the lines from startup but now when i use ./startup cygwin freezes up also after i compile i could find no .exe file
19 Dec, 2010, Tyche wrote in the 13th comment:
Votes: 0
phobos said:
Ok deleted the lines from startup but now when i use ./startup cygwin freezes up also after i compile i could find no .exe file


Well the startup script should run forever, until you log into the mud and shut it down, or issue a CTL-C from the console.

If you start it with './startup &', it will run in the background.

See man jobs, bg, fg, ps commands for more info on bash task control.

http://info.ee.surrey.ac.uk/Teaching/Uni...
19 Dec, 2010, phobos wrote in the 14th comment:
Votes: 0
Thank you much, Its running now and im connected servering off my service provider but no commands work…after the character creation process
19 Dec, 2010, Tyche wrote in the 15th comment:
Votes: 0
Sorry, I don't know anything about how the particular mud operates.
I suppose there's some documentation somewhere on how to elevate a character to an administrator or wizard.
22 Dec, 2010, phobos wrote in the 16th comment:
Votes: 0
Thank you all for helping with all the issues. Now that its running ill start fishing around myself and if it blows up I have it backed up at the point of making and running well minus the commands part but im sure I can figer it out!
26 Dec, 2010, Ludwig wrote in the 17th comment:
Votes: 0
Here's my makefile. Using cygwin and swfote2.1.5. I have very little experience with linux and cygwin. The makefile might be wrong.
CC      = gcc
PROF =
NOCRYPT =

#Uncomment the line below if you are getting undefined references to dlsym, dlopen, and dlclose.
#Comment it out if you get errors about ldl not being found.
#NEED_DL = -ldl

#Uncomment if using CYGWIN to compile with
CYGWIN_FLAG = -DCYGWIN

#Some systems need this for dynamic linking to work.
EXPORT_SYMBOLS = -export-dynamic

C_FLAGS = -g2 -Wall $(EXPORT_SYMBOLS) $(CYGWIN_FLAG) $(PROF) $(NOCRYPT) $(DBUGFLG) $(EXPORT_SYMBOLS)
L_FLAGS = $(PROF) $(EXPORT_SYMBOLS) $(CYGWIN_FLAG) $(NEED_DL) -lz -g2

#Comment out to disable cargo
USECARGO = 1

ifdef USECARGO
C_FLAGS := $(C_FLAGS) -DUSECARGO
endif


C_FILES = 11.c act_comm.c act_info.c act_move.c act_obj.c act_wiz.c boards.c \
bounty.c build.c changes.c clans.c color.c comm.c comments.c \
const.c copyover.c db.c editor.c fight.c finfo.c force.c \
fskills.c functions.c handler.c hashstr.c hunter.c interp.c keb.c \
magic.c makeobjs.c marriage.c md5.c mccp.c misc.c mud_comm.c \
mud_prog.c newarena.c pfiles.c planets.c player.c renumber.c reset.c \
save.c ships.c shops.c skills.c slay.c slicers.c slotm.c \
space.c special.c swskills.c tables.c tech.c track.c update.c


O_FILES := $(patsubst %.c,o/%.o,$(C_FILES))

H_FILES = $(wildcard *.h)

SWR = swr.exe
SWR_OLD = ../bin/swr_old
COPYFILE = ../bin/cygwin/copyfile

all:
$(MAKE) -s swr

# pull in dependency info for *existing* .o files
ifdef CYGWIN_FLAG
-include dependencies.d
endif

swr: $(O_FILES)
rm -f $(SWR)
ifdef CYGWIN_FLAG
dlltool –export-all –output-def ../bin/cygwin/swr.def $(O_FILES)
dlltool –dllname $(SWR) –output-exp ../bin/cygwin/swr.exp –def ../bin/cygwin/swr.def
$(CC) -o $(SWR) $(O_FILES) ../bin/cygwin/swr.exp $(L_FLAGS)

endif
echo " ";
echo "Done compiling mud.";
chmod g+w $(SWR)
chmod a+x $(SWR)
chmod g+w $(O_FILES)
ifdef CYGWIN_FLAG
./$(COPYFILE)
endif
mv $(SWR) ../bin

clean:
ifdef CYGWIN_FLAG
rm -f o/*.o ../bin/other/swr.def ../bin/cygwin/swr.exp
chmod g+w $(COPYFILE)
chmod a+x $(COPYFILE)
./$(COPYFILE)
# $(MAKE) all
else
rm -f o/*.o $(SWR_OLD) ../bin/$(SWR) ../bin/${SWR}.exe ../bin/win/swr.def ../bin/cygwin/swr.exp
# $(MAKE) all
endif


purge:
ifdef CYGWIN_FLAG
rm -f o/*.o ../bin/cygwin/swr.def ../bin/cygwin/swr.exp dependencies.d
else
rm -f o/*.o $(SWR_OLD) $(SWR) ../bin/cygwin/swr.def ../bin/cygwin/swr.exp
endif


o/%.o: %.c
# echo " Compiling $@….";
echo " $@";
$(CC) -c $(C_FLAGS) $< -o $@

.c.o: mud.h
$(CC) -c $(C_FLAGS) $<
0.0/17