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
➜ SMAUG coding
➜ Problems with copyover function
Problems with copyover function
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1 2
Posted by
| Aqueus
USA (47 posts) Bio
|
Date
| Mon 15 Jan 2007 03:58 AM (UTC) |
Message
| So I've run aground while trying to implement the copyover snippet, specifically Erwin's.
After all is said and done I get the following errors:
comm.c: In function `init_descriptor':
comm.c:757: structure has no member named `user'
It's caused by this line:
dnew->user = STRALLOC("unknown");
But when I comment that line out, I get the FOLLOWING errors:
comm.o(.text+0xfd4): In function `new_descriptor':
/home/mirage21/smaug/src/comm.c:874: undefined reference to `set_auth'
db.o(.text+0xf82): In function `boot_db':
/home/mirage21/smaug/src/db.c:685: undefined reference to `copyover_recover'
tables.o(.text+0x1292): In function `skill_function':
/home/mirage21/smaug/src/tables.c:231: undefined reference to `do_copyover'
tables.o(.text+0x4d33): In function `skill_name':
/home/mirage21/smaug/src/tables.c:871: undefined reference to `do_copyover'
collect2: ld returned 1 exit status
distcc[319] ERROR: compile (null) on localhost failed
And... well... my problem is that I have NO clue where to even approach these bugs. The .o files are the compiled files, right? How do I fix errors there.
Any help is welcome, I'm a newbie coder, though, so try and make any pointers idiot-proof. =)
| Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #1 on Mon 15 Jan 2007 04:10 AM (UTC) |
Message
| Any reason you're not using SmaugFUSS? I'd recommend it, plus it comes with hotboot.
Are you using stock Smaug? |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Aqueus
USA (47 posts) Bio
|
Date
| Reply #2 on Mon 15 Jan 2007 04:19 AM (UTC) |
Message
| I'm not using stock SMAUG. =( I think I might convert to SMAUGFUSS, but I'm not the lead coder, so I'd need to discuss it with him first.
It's SMAUG, with a few tweaks. Nothing major, just things like skills, etc. | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #3 on Mon 15 Jan 2007 04:35 AM (UTC) |
Message
| Assuming that dnew is of type DESCRIPTOR_DATA, then something is wrong. Stock Smaug has the 'user' member in that struct. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Aqueus
USA (47 posts) Bio
|
Date
| Reply #4 on Mon 15 Jan 2007 04:44 AM (UTC) |
Message
| *sigh* No offense, but I KNOW something's wrong. I just don't know how to fix it. =(
Are the error logs not useful enough? Is there any other data I could collect to help you guys help me? | Top |
|
Posted by
| Aqueus
USA (47 posts) Bio
|
Date
| Reply #5 on Mon 15 Jan 2007 04:51 AM (UTC) |
Message
| Ah, here, I hope this helps:
The problem-function is this:
void init_descriptor( DESCRIPTOR_DATA *dnew, int desc)
{
dnew->next = NULL;
dnew->descriptor = desc;
dnew->connected = CON_GET_NAME;
dnew->outsize = 2000;
dnew->idle = 0;
dnew->lines = 0;
dnew->scrlen = 24;
dnew->user = STRALLOC("unknown");
dnew->newstate = 0;
dnew->prevcolor = 0x07;
CREATE( dnew->outbuf, char, dnew->outsize );
}
So yeah, dnew is a DESCRIPTOR_DATA type. Where could I find where DESCRIPTOR_DATA is enumerated?
| Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #6 on Mon 15 Jan 2007 04:56 AM (UTC) |
Message
| The line isn't that important, but I'd like to see why you're missing user. The struct can be found in mud.h. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #7 on Mon 15 Jan 2007 04:58 AM (UTC) |
Message
| Zeno's point is that something bigger is wrong than what you're seeing. If your SMAUG code is significantly different from stock SMAUG, then trying a stock SMAUG copyover snippet won't be a copy-paste affair.
I think the structure you're looking for is defined in mud.h.
One thing you could try would be to comment out the line referring to user. But, you might want to figure out what version of SMAUG your code is based on, what version of SMAUG the snippet is for, and why your code does not have the user field. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Aqueus
USA (47 posts) Bio
|
Date
| Reply #8 on Mon 15 Jan 2007 04:59 AM (UTC) |
Message
| How disappointing. A little investigation shows that I AM missing the user part of that structure. What type of variable is it? char? | Top |
|
Posted by
| Aqueus
USA (47 posts) Bio
|
Date
| Reply #9 on Mon 15 Jan 2007 05:02 AM (UTC) |
Message
| Alright, I added the line:
char * user;
Fixed the first error, but the others still came right after:
comm.o(.text+0xfd4): In function `new_descriptor':
/home/mirage21/smaug/src/comm.c:874: undefined reference to `set_auth'
db.o(.text+0xf82): In function `boot_db':
/home/mirage21/smaug/src/db.c:685: undefined reference to `copyover_recover'
tables.o(.text+0x1292): In function `skill_function':
/home/mirage21/smaug/src/tables.c:231: undefined reference to `do_copyover'
tables.o(.text+0x4d33): In function `skill_name':
/home/mirage21/smaug/src/tables.c:871: undefined reference to `do_copyover'
collect2: ld returned 1 exit status
distcc[3206] ERROR: compile (null) on localhost failed
Any clues how I'd go about fixing them?
If you want I'll post the offending lines themselves... | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #10 on Mon 15 Jan 2007 05:03 AM (UTC) |
Message
| Did you remember to include the copyover definitions (do_copyover etc) in mud.h?
You could just look at how the FUSS code is done as well. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #11 on Mon 15 Jan 2007 05:28 AM (UTC) |
Message
| Those are linker errors, not compiler errors. You might have forgotten to add a .o file to the Makefile.
Still, I'd strongly suggest looking into the differences between your SMAUG code and whatever code this snippet is expecting. Simply adding the user field as you did without understanding what exactly is going on is asking for trouble. (The memory leak you have created might be the least of your worries.) |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Aqueus
USA (47 posts) Bio
|
Date
| Reply #12 on Mon 15 Jan 2007 05:28 AM (UTC) |
Message
| I'm looking over everything once more, from the beginning. The snippet is for SMAUG1.4, which is what our SMAUG is ORIGINALLY based off of, like I said, the only real difference is changing skills, etc, y'know, things that make a MUD 'unique'...
Aaaand... Away I go - looking for fixes... | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #13 on Mon 15 Jan 2007 05:53 AM (UTC) |
Message
| Well from what you've said, I don't see any reason the user field would be removed. It also means you removed all references to it in the code, and not just the data member.
Here's the original struct:
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;
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;
};
|
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #14 on Mon 15 Jan 2007 04:57 PM (UTC) |
Message
| Yeah. Clearly something more has changed than what you think, or it's based off of a different SMAUG version, or something else very strange is going on. I don't know what to tell you. Zeno's right, there's no reason for this field to be simply missing. Have you talked to the head coder about any of this? |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | 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.
60,470 views.
This is page 1, subject is 2 pages long: 1 2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top