[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  Running the server
. . -> [Subject]  Smaug 1.4a win32 - don't need to run from area directory?

Smaug 1.4a win32 - don't need to run from area directory?

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Datac0re   (2 posts)  [Biography] bio
Date Sat 15 May 2004 03:04 PM (UTC)
Message
Hi everyone, I'm just getting started with Smaug, and one thing that has me scratching my head is that the readme for the win32 version of 1.4a says to just go ahead and run smaug.exe from the root smaug directory, while if I browse to the "docs" sub-directory and read the FAQ there, it mentions how I should run it from the area directory.

Examining the source shows that all of the <whatever>_DIR constants defined in mud.h are all written as "../<whatever>" leading me to believe that you should actually be starting up smaug in a subdirectory instead of the root directory.

However, if I go ahead and run Smaug from the root, the server is loading up everything just fine, including the areas, players, etc...

How on earth is this possible? Shouldn't I be getting all kinds of "directory not found" type of errors?

I even recompiled the source and plopped it into the root directory to make sure that the binary version of the win32 1.4a wasn't changed to allow for this, but lo and behold, the freshly compiled copy loads things just fine also!

Any ideas?
[Go to top] top

Posted by Nick Cash   USA  (626 posts)  [Biography] bio
Date Reply #1 on Sat 15 May 2004 05:29 PM (UTC)
Message
I'm not sure, you would probably have to ask someone who actually uses it. However, it is possible that it moves into the area directory before starting up. I boot my MUD from my src directory, however, there is a line in the startup file that reads cd ../area, so it still starts from the area directory. ::shrug:: Just a thought.

~Nick Cash
http://www.nick-cash.com
[Go to top] top

Posted by Ithildin   USA  (262 posts)  [Biography] bio
Date Reply #2 on Sat 15 May 2004 06:11 PM (UTC)
Message
the windows version is just a program that starts up once you double click on it. the actual unix, cygwin or whatever you have to start it in the directory. so when you compile you make the executable in your root directory and you just double click the program to start.
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #3 on Sat 15 May 2004 09:24 PM (UTC)
Message
It's worth noting that the documentation for SMAUG is horribly out of date.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Nick Gammon   Australia  (22,982 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Sat 15 May 2004 11:59 PM (UTC)
Message
These lines in the source account for it.

If running under the Win32 compile you execute the main function in services.c, which has this code in it (which I wrote) ...


  if (!GetModuleFileName (NULL, fullfilename, sizeof (fullfilename)))
   {
   service_error (GetLastError (), "Cannot locate full filename");
   Win32_Exit (1);
   }

// remove last part of file name to get working directory

  strcpy (directory, fullfilename);

  p = strrchr (directory, '\\');
  if (p)
    *p = 0;

  strcat (directory, "\\area");

// make sure we are running in the "area" subdirectory

  _chdir (directory);

  printf ("Working directory now %s\n", directory);


The important line is the one which changes to the area subdirectory. Can't remember offhand why I did that, there must be a reason. ;)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #5 on Sun 16 May 2004 12:50 AM (UTC)
Message
Probably because it makes more sense and it's a whole lot more convenient to run from root directory, and not have to go into area/ first. :)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Datac0re   (2 posts)  [Biography] bio
Date Reply #6 on Sun 16 May 2004 12:21 PM (UTC)
Message
Wow nothing like getting the answer directly from the author :)

Now this part also makes sense in mud.c:

#ifdef WIN32
int mainthread( int argc, char **argv )
#else
int main( int argc, char **argv )
#endif


Thanks a lot!
-Brian
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


16,905 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]