SWR

Posted by Dolph on Sat 05 Apr 2003 11:44 AM — 10 posts, 29,505 views.

#0
After much, much trying, I was able to get SWR to compile under CYGWIN, howver when I run the .exe I get:

Sat Apr 5 03:29:34 2003 :: Booting Database
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Sat Apr 5 03:29:34 2003 :: [*****] BOOT: ---------------------[
---------------
Sat Apr 5 03:29:34 2003 :: Loading commands
Sat Apr 5 03:29:34 2003 :: [*****] BUG: Cannot open commands.dat
Australia Forum Administrator #1
You should execute it from the "area" subdirectory. At the same level as the area directory should be a "system" directory. In that should be a file "commands.dat".
#2
Yay! It works perfectly now, thanks. However while running it and typing 'score' twice in a row causes it to crash :p
Australia Forum Administrator #3
It works perfectly, except you can't get your score twice? ;)

Hard to say what that is, you could try gdb to find where it crashed. Search this forum for examples of doing that. Possibly an area file that introduces something out of range. Are you using stock areas?
Amended on Sat 05 Apr 2003 09:30 PM by Nick Gammon
#4
Well I ment perfectly except for that :p Yes, I am using stock area files, however I have previously have had binary of it already and it worked just fine, in that area anyways :p

I have looked through the forum and really have only found one other post talking about it, but never said what was wrong or how to fix it.
Australia Forum Administrator #5
The code is rather sensitive to things being in range. By "things" I mean that if you previously had (say) 20 races, but the stock server has 10, then the extra 10 are likely to overwrite memory, causing a crash.

Are you using an existing character from your earlier binary release? If so, try creating a new character, and seeing if the problem goes away.
USA #6
Hmm. I'm not exactly sure how I fixed the problem in mine but I do know of something that needs to be fixed in stock SWR 1.0. In the do_score command, the line that show's the race looks like this..

ch_printf(ch, "\n\rScore for %s%s.\n\r", ch->pcdata->title);

It should be this..
ch_printf(ch, "\n\rScore for %s.\n\r", ch->pcdata->title);

I don't really know if that would crash it, but I know it needs to be changed. Anyways, good luck.
#7
Yes, the char I was using was from the other binary though making a new char didn't work.

But w00t! Taking out that extra %s fixed it, thanks!
Australia Forum Administrator #8
It would crash it, saying %s%s means it expects two string arguments, but it only gets one, so the other one will be undefined, and will eventually crash.
USA #9
Glad I could help. Now when I make a fully debugged version of SWR I know what causes the score bug, I wasnt really ever sure if that was it. If you have any other questions feel free to ask them. Thanks.