Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ Compiling the server
➜ Source Code
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
3
4
5
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #60 on Sun 16 Dec 2001 10:38 PM (UTC) |
| Message
| There is already code that distinguishes, so I would pass a flag down.
eg.
Current code:
/* Main loop */
while ( !mud_down )
{
accept_new( control );
accept_new( control2 );
accept_new( conclient);
accept_new( conjava );
New code:
// near the top ....
#define CONNECT_CONTROL 1
#define CONNECT_CONTROL2 2
#define CONNECT_CLIENT 3
#define CONNECT_JAVA 4
// .... and later on ....
/* Main loop */
while ( !mud_down )
{
accept_new( control, CONNECT_CONTROL );
accept_new( control2, CONNECT_CONTROL2 );
accept_new( conclient, CONNECT_CLIENT );
accept_new( conjava, CONNECT_JAVA );
And then modify "accept_new" accordingly to take the extra argument, and store the "connection type" as part of the player's descriptor.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Kris
USA (198 posts) Bio
|
| Date
| Reply #61 on Wed 19 Dec 2001 03:39 AM (UTC) |
| Message
| | I got everything except the last part. How would I go about storing the connect type as part of the descriptor? | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #62 on Wed 19 Dec 2001 04:54 AM (UTC) |
| Message
| You would modify the descriptor structure, and then store the flag in it. In mud.h, this is what it currently looks like, and I would add the line in bold:
/*
* Descriptor (channel) structure.
*/
struct descriptor_data
{
DESCRIPTOR_DATA * next;
DESCRIPTOR_DATA * prev;
DESCRIPTOR_DATA * snoop_by;
CHAR_DATA * character;
CHAR_DATA * original;
char * host;
int port;
int descriptor;
sh_int connected;
sh_int idle;
sh_int lines;
sh_int scrlen;
sh_int mxp;
sh_int connect_type;
bool fcommand;
char inbuf [MAX_INBUF_SIZE];
char incomm [MAX_INPUT_LENGTH];
char inlast [MAX_INPUT_LENGTH];
int repeat;
char * outbuf;
unsigned long outsize;
int outtop;
char * pagebuf;
unsigned long pagesize;
int pagetop;
char * pagepoint;
char pagecmd;
char pagecolor;
char * user;
int newstate;
unsigned char prevcolor;
};
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Kris
USA (198 posts) Bio
|
| Date
| Reply #63 on Wed 19 Dec 2001 07:03 AM (UTC) |
| Message
| | In accept_new, how to I set the connect_type variable (as in ch->desc->connect_type) to the connect_type being passed into the function from the main loop? I.e. I'm guessing it'd be something like d->descriptor->connect_type = connect_type, but I'm not sure about that, and I'm also not sure where in accept_new to put it. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #64 on Wed 19 Dec 2001 09:26 AM (UTC) |
| Message
| First you would need to change the argument list, as you are now passing another argument, so it would look like this:
void
accept_new (int ctrl , int connect_type)
{
Then it looks like the descriptor isn't allocated there, so you need to pass it further. So near the end you would change it to:
new_descriptor (newdesc , connect_type);
Similarly in new_descriptor you would change the argument list:
void
new_descriptor (int new_desc, int connect_type))
{
And further down once the descriptor was allocated you could set that variable:
CREATE (dnew, DESCRIPTOR_DATA, 1);
dnew->next = NULL;
dnew->descriptor = desc;
dnew->connect_type = connect_type;
You probably need to change some function prototypes in .h files, and look out for other references to new_descriptor.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Kris
USA (198 posts) Bio
|
| Date
| Reply #65 on Thu 25 Apr 2002 09:44 AM (UTC) |
| Message
| I've recently been approached by someone trying to setup a smaug server. I pointed him to your site to download the win32 ported version (since he uses cygwin on a windows machine like I do). He described some problems with compiling the source, however, and I eventually had him upload the source to me. I had the same problems. I then downloaded the source from the website myself, and still the same problems.
Basically, the problem errors, which occur in several different functions, tend to run as follows: implicit declaration of function 'RENAME', implicit declaration of function 're_exec', implicit declaration of function 'crypt', (on the same line as the crypt error) assignment makes pointer from integer without a cast.
These are all warning errors, but once it tries to link together the object files, those errors come back again, this time aborting the compile. This is the same version of cygwin I've always had, and this didn't happen when I first downloaded and compiled smaug from your site back in febuary 2001. Also, I don't get any of these warning errors in my mud's source, which is the same I downloaded from your site back then, only heavily modified by me in the 14 months or so since then.
I just wanted to let ya know about that. Perhaps you may wanna try compiling the dist on your site with cygwin yourself and see if you get the same errors? It's either bugged, or cygwin has decided to play favorites for me and the person I was offering assistance to. Thanks for taking a look at this for me :) | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #66 on Thu 25 Apr 2002 09:50 PM (UTC) |
| Message
| I seem to recall going over this a few times before. Did you search for re_exec on the forum? Anyway, it will compile OK, I have it running here. Check out the "makefile" for what to comment in/out.
Failing that, the only place in the entire code re_exec is used is in this small function:
int is_profane (char *what)
{
#ifndef WIN32
int ret;
ret = re_exec(what);
if (ret==1)
return(1);
#endif
return(0);
}
It is only for checking for profanities, and in the WIN32 version I just commented out the re_exec anyway. So, to get it to compile and link just delete the lines between #ifndef and #endif. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Kris
USA (198 posts) Bio
|
| Date
| Reply #67 on Fri 26 Apr 2002 02:23 AM (UTC) |
| Message
| | I uncommented the part of makefile about the crypt thing, and commented out the ifdef part of is_profane. However, the implicit declaration of crypt error, and the implicit declaration of RENAME error are still popping up. I reviewed the forum as you suggested, and found some posts describing the same problem. However, there was a whole jumble of replies and replies to those replies; in short, I can't even figure out if anyone came up with a fix there or not. The re_exec thing is fixed, but what do I do about the crypt and RENAME thing? If I get it fixed and working, you may wanna consider putting the fixed version of the dist on the site, so other ppl using cygwin can compile it. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #68 on Fri 26 Apr 2002 02:32 AM (UTC) |
| Message
| | Exactly which SMAUG download did you compile? My notes about "compiling" which use SMAUG (with MXP) were done with Cygwin, and I did it from start to finish, without errors. Check out that page. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Kris
USA (198 posts) Bio
|
| Date
| Reply #69 on Fri 26 Apr 2002 02:43 AM (UTC) |
| Message
| | This was the source-only download without MXP. I could try the one with MXP, but it may be a good idea to be sure that the non-MXP one is compilable as well, since someone may bor whatever reason want one without it. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #70 on Fri 26 Apr 2002 03:00 AM (UTC) Amended on Fri 26 Apr 2002 03:01 AM (UTC) by Nick Gammon
|
| Message
| Try the MXP one - the only real difference, apart from the MXP stuff, is a slightly different Makefile. Or at least, copy the makefile.cgywin and use that. The difference between the old Makefile and the Cygwin one are:
17c17
< #NEED_REG = -lgnuregex
---
> NEED_REG = -lregex
20c20
< #NEED_CRYPT = -lcrypt
---
> NEED_CRYPT = -lcrypt
29c29
< L_FLAGS = $(OPT_FLAG) $(PROF) $(SOLARIS_LINK) $(NEED_CRYPT)
---
> L_FLAGS = $(OPT_FLAG) $(PROF) $(SOLARIS_LINK) $(NEED_CRYPT) $(NEED_REG)
65,66c65,66
< chmod g+w smaug
< chmod a+x smaug
---
> chmod g+w smaug.exe
> chmod a+x smaug.exe
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Kris
USA (198 posts) Bio
|
| Date
| Reply #71 on Fri 26 Apr 2002 03:31 AM (UTC) |
| Message
| | I tried making the changes you suggested, and no effect. I then tried using the makefile.cygwin file instead, and still no effect. Still having the problems with crypt and RENAME. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #72 on Fri 26 Apr 2002 08:33 AM (UTC) |
| Message
| Search the forum for posts about crypt. I think a while ago the crypt library had to be moved or something.
I don't want to get too bogged down about this. The source I posted compiles using a recent version of Cygwin. You may need to tweak makefile settings or make sure you have installed a full Cygwin, but after that, you need to do a bit of searching to work out the problem. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #73 on Fri 26 Apr 2002 08:34 AM (UTC) |
| Message
| | It might be good to start a new subject on the forum next time. This one is already 5 pages which makes it hard for people to just quickly browse it. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | 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.
196,400 views.
This is page 5, subject is 5 pages long:
1
2
3
4
5
It is now over 60 days since the last post. This thread is closed.
Refresh page
top