This is a annotated log of me intalling Rot under Cygwin.
I had never seen Rot before. But I will be going under the assumption that a Diku is Diku no matter how many times they rename it. You've seen one you've seen them all. Now what packages did I need beyond the basic cygwin install. This command lists all the installed packages.
The above was editted down to the ones you need that I don't believe are installed by default but have to be selected by running the setup program again. To check for each package you can also do cygcheck -c packagename BTW the Pico editor comes with Pine mail program. Nano has more features though. There are also Vim, Xemacs, and a bunch of other editors. DO NOT use a Windows editor to edit your source code or makefiles unless it preserves Unix style line endings and in the case of makefiles tab characters. Ultraedit, Multiedit and Textpad are Windows editors that can read and write unix text files without munging them up. Don't use Windows Notepad on anything, not even files on windows. :-P If you really must Wordpad will get you through most files with messing them up. Onward First let's unpack the distribution somewhere.
Note: If you use Winzip there are some empty directories that won't be created. (i.e. bin, log, player, gods) Let's find the install doc. Haha. None at all. Just the old Merc files. I wasn't really planning on reading the instructions anyway. Good thing there ain't any. :-P Let's find a configure or makefile somewhere. There's a makefile in the src directory. Let's run make then.
The warnings above may cause problems later on. We'll just ignore them for now and looks at the errors. db.c:60: error: conflicting types for `random' /usr/include/stdlib.h:163: error: previous declaration of `random' db.c:61: error: conflicting types for `srandom' /usr/include/stdlib.h:164: error: previous declaration of `srandom' Let's look at these lines 60-61 in db.c
Poor programming practices. Don't prototype system functions. This code will cause errors on many other unixes too.
This effectively makes this code invisible for our CYGWIN version, while not affecting our compiling on other machines. __CYGWIN__ is a macro automatically defined by our gcc configuration when we our compiling under cygwin. Aside: One thing to check. Issue this command in your cygwin shell.
You should get the above output. I will assume you did. Anyway let's save the makefile (CTL-X in nano) and try make again.
We got much further. Everything has compiled successfully. However we are unable to link together our object modules into an executable. It appears the linker cannot find a system function know as crypt. (The leading underscore can be ignored as it's C's way of mangling function names). Many systems don't come with the crypt library installed and/or don't include it in the linker's default list of libraries.
Yep I have it. So we need to update the Makefile to include it manually.
The -l flag will tell the linker to include the library when linking. Note the naming convention differences from how the file is named and how one includes it. Let's see what happens:
What?! Still can't find it. Why? The linker searches libraries from left to right and only for those functions called by an object file. So we need to place our -lcrypt after the object files (.o files) otherwise it'll never be searched for anything. The is probably where your typical newbie gives up and says cygwin just doesn't plain work with crypt. Let's edit the makefile again
Now save and try again...
Voila! We've successfully compiled and linked Rot on cygwin.
There it is. On to the script.
Note the very first line of the script. It contains the sharp-bang (or bangline) which is used to to indicate what program or shell will be used to run the this script. This script was written for csh or the c-shell. Looks like this mud will run by default on ports 4000 and 4001 (webserver?). There are a couple of potential problems here, so we'll edit it.
How odd. Looks like the script assumes the Rot executable is in the bin directory. It ain't friggin' there. I guess we'll copy it there manually for now.
Note: The script above apparently can be run from anywhere as the statement, cd $areapath, guarantees all the relative paths will be from the area directory. So let's run it.
The & parameter causes the script to run in the background. If you didn't use it, your console session would be locked up until the mud shutdown.
Looks like it's running.
I went ahead and created a character and quit. So how do I make myself a god? Shrug no friggin' documentation at all. Well knowing a little about ROM I expect I'll have to edit the player file.
Let's make the changes above, save, telnet back in and try a few commands.
Looks like I'm an IMP.
Oooo looks like I move and fight like I have super ninja mojo powers too. I can't wait to do that to my first player!. :-P Now let's check out the web page. Let's bring up IE and use the URL http://127.0.0.1:4001 Hmmm something happened. I got kicked off and the mud apparently crashed and burned.
But it looks like the script was able to restart it as you see above. So what happened? Let's check the log!
Apparently the web interface crashes the mud when it can't find a file. That's real slick. Let's look a the new log our script started.
Apparently Rot is NOT ready to rock on port 4001! How to fix that? That's best left as an exercise for you, the Rot monkey. HTH |
This is a annotated log of me intalling Rot under Cygwin. I had never seen Rot before. But I will be going under the assumption that a Diku is Diku no matter how many times they rename it. You've seen one, you've seen them all. Now what packages did I need beyond the basic cygwin install. This command lists all the installed packages.
The above was editted down to the ones you need that I don't believe are installed by default but have to be selected by running the setup program again. To check for each package you can also do cygcheck -c packagename BTW the Pico editor comes with Pine mail program. Nano has more features though. There are also Vim, Xemacs, and a bunch of other editors. DO NOT use a Windows editor to edit your source code or makefiles unless it preserves Unix style line endings and in the case of makefiles tab characters. Ultraedit, Multiedit and Textpad are Windows editors that can read and write unix text files without munging them up. Don't use Windows Notepad on anything, not even files on windows. If you really must Wordpad will get you through most files without messing them up. Onward First let's unpack the distribution somewhere.
Note: If you use Winzip there are some empty directories that won't be created. (i.e. bin, log, player, gods) Let's find the install doc. Haha. None at all. Just the old Merc files. I wasn't really planning on reading the instructions anyway. Good thing there ain't any. :-P Let's find a configure or makefile somewhere. There's a makefile in the src directory. Let's run make then.
The warnings above may cause problems later on. We'll just ignore them for now and look at the errors. db.c:60: error: conflicting types for `random' /usr/include/stdlib.h:163: error: previous declaration of `random' db.c:61: error: conflicting types for `srandom' /usr/include/stdlib.h:164: error: previous declaration of `srandom' Let's look at these lines 60-61 in db.c
Poor programming practices. Don't prototype system functions. This code will cause errors on many other unixes too.
This effectively makes this code invisible for our CYGWIN version, while not affecting our compiling on other machines. __CYGWIN__ is a macro automatically defined by our gcc configuration when we our compiling under cygwin. Aside: One thing to check. Issue this command in your cygwin shell.
You should get the above output. I will assume you did. Anyway let's save the makefile (CTL-X in nano) and try make again.
We got much further. Everything has compiled successfully. However we are unable to link together our object modules into an executable. It appears the linker cannot find a system function know as crypt. (The leading underscore can be ignored as it's C's way of mangling function names). Many systems don't come with the crypt library installed and/or don't include it in the linker's default list of libraries.
Yep I have it. So we need to update the Makefile to include it manually.
The -l flag will tell the linker to include the library when linking. Note the naming convention differences from how the file is named and how one includes it. Let's see what happens:
What?! Still can't find it. Why? The linker searches libraries from left to right and only for those functions called by an object file. So we need to place our -lcrypt after the object files (.o files) otherwise it'll never be searched for anything. The is probably where your typical newbie gives up and says cygwin just doesn't plain work with crypt. Let's edit the makefile again...
Now save and try again...
Voila! We've successfully compiled and linked Rot on cygwin.
There it is. On to the script.
Note the very first line of the script. It contains the sharp-bang (or bangline) which is used to to indicate what program or shell will be used to run the this script. This script was written for csh or the c-shell. Looks like this mud will run by default on ports 4000 and 4001 (webserver?). There are a couple of potential problems here, so we'll edit it.
How odd. Looks like the script assumes the Rot executable is in the bin directory. It ain't friggin' there. I guess we'll copy it there manually for now.
Note: The script above apparently can be run from anywhere as the statement, cd $areapath, guarantees all the relative paths will be from the area directory. So let's run it.
The & parameter causes the script to run in the background. If you didn't use it, your console session would be locked up until the mud shutdown.
Looks like it's running.
I went ahead and created a character and quit. So how do I make myself a god? Shrug no friggin' documentation at all. Well knowing a little about ROM I expect I'll have to edit the player file.
Let's make the changes above, save, telnet back in and try a few commands.
Looks like I'm an IMP.
Oooo looks like I move and fight like I have super ninja mojo powers too. I can't wait to do that to my first player!. :-P Now let's check out the web page. Let's bring up IE and use the URL http://127.0.0.1:4001 Hmmm something happened. I got kicked off and the mud apparently crashed and burned.
But it looks like the script was able to restart it as you see above. So what happened? Let's check the log!
Apparently the web interface crashes the mud when it can't find a file. That's real slick. Let's look a the new log our script started.
Apparently Rot is NOT ready to rock on port 4001! How to fix that? That's best left as an exercise for you, the Rot monkey. HTH |