07 Aug, 2007, Vorlin wrote in the 1st comment:
Votes: 0
First, I apologize if it makes me look like all I'm trying to do is leech off the knowledge of those here but I promise I've got something pretty good to donate in the end! I'm just at my wits end on this one when my woman (who's helping with the area building and such) noticed it and informed me.

Socials no longer work. At all. Like none. All one would get is 'Huh?' which is the default when a social can't be found via check_social(). I haven't changed anything in social.are to cause it to fail. Social.are loads fine, apparently…but nothing happens except the 'Huh?' I've gotten so used to seeing now. Nothing I've done in code (all I'm doing is putting in my own version of ignore which is in a file by itself and I've removed it by rename and all occurrences of do_ignore and is_ignoring from the other files and that still didn't do anything).

I've re-downloaded Quickmud, put it in a directory by itself and compared all the files via diff to see where social loaded and went through line by line and accounted for everything that I might've changed or whatnot. Nothing touched load_socials or check_social so now I'm completely lost. Am I missing something here? Any help would be greatly appreciated. Thanks in advance.
07 Aug, 2007, Zeno wrote in the 2nd comment:
Votes: 0
Try using gdb to step through and see what the problem is.
http://www.gammon.com.au/forum/bbshowpos...
07 Aug, 2007, Conner wrote in the 3rd comment:
Votes: 0
You might double check how your change to do_ignore & is_ignoring impacted your socials since they are probably set by default to check whether the person is ignored.
07 Aug, 2007, Kayle wrote in the 4th comment:
Votes: 0
But I thought he said that he hadn't made any code changes to socials, wouldn't adding do_ignore to them be a code change? perhaps I misunderstood, hell I'm not even sure which forum this is in. >.> pain meds ftw!
07 Aug, 2007, Exodus wrote in the 5th comment:
Votes: 0
I'm not intimately familiar with quickmud, but in most ignore functions that I've seen, there is some sort of check_ignore function that checks to see if one character is ignoring the other. Generally, if found to be true, it effectively gags the output of channels and socials (to prevent spam and such) I'd say compare your ignore function to the original and see if your function is mistakingly gagging socials. If that's not the case, then you're down to finding the section where the social message is sent to the character. From there, work backwards through each section that cause socials to fail and examine those checks to see what might be causing it.
bool check_social( CHAR_DATA *ch, CHAR_DATA *victim )
{
if( is_ignoring(ch, victim) ) <– What causes this to occur?
return FALSE;

if( something() ) <– What causes this to occur?
return FALSE;

return TRUE;
}
08 Aug, 2007, Conner wrote in the 6th comment:
Votes: 0
Sorry Kayle, you're right, I had the wrong function in mind, but Exodus caught the intent I had in mind. :smile:
09 Aug, 2007, Guest wrote in the 7th comment:
Votes: 0
Vorlin,

Even though you say you haven't touched check_social, could you post the function here so we can look through it?
09 Aug, 2007, Vorlin wrote in the 8th comment:
Votes: 0
Sure thing…here it is, in all it's glory, hehe… I do appreciate everyone's help!

bool check_social (CHAR_DATA * ch, char *command, char *argument)
{
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
int cmd;
bool found;

found = FALSE;
for (cmd = 0; social_table[cmd].name[0] != '\0'; cmd++)
{
if (command[0] == social_table[cmd].name[0]
&& !str_prefix (command, social_table[cmd].name))
found = TRUE;
break;
}

if (!found)
return FALSE;

if (!IS_NPC (ch) && IS_SET (ch->comm, COMM_NOEMOTE))
send_to_char ("You are anti-social!\n\r", ch);
return TRUE;

switch (ch->position)
{
case POS_DEAD:
send_to_char ("Lie still; you are DEAD.\n\r", ch);
return TRUE;

case POS_INCAP:
case POS_MORTAL:
send_to_char ("You are hurt far too bad for that.\n\r", ch);
return TRUE;

case POS_STUNNED:
send_to_char ("You are too stunned to do that.\n\r", ch);
return TRUE;

case POS_SLEEPING:
/*
* I just know this is the path to a 12" 'if' statement. :(
* But two players asked for it already! – Furey
*/
if (!str_cmp (social_table[cmd].name, "snore"))
break;
send_to_char ("In your dreams, or what?\n\r", ch);
return TRUE;
}
}


I even downloaded the original Quickmud and opened two windows and got to the function at the same spot and alt-tabbed back and forth and nothing changed visibly.
10 Aug, 2007, Davion wrote in the 9th comment:
Votes: 0
Not sure if this is it, but one thing I noticed is

if (!IS_NPC (ch) && IS_SET (ch->comm, COMM_NOEMOTE))
send_to_char ("You are anti-social!\n\r", ch);
return TRUE;


There's is only one statement in the scope of the if. It'll return true every time (unless it doesn't find the social). You probably want
if (!IS_NPC (ch) && IS_SET (ch->comm, COMM_NOEMOTE))
{ send_to_char ("You are anti-social!\n\r", ch);
return TRUE;
}


Also show us your interpret() function in interp.c. It probably has more to do with the problem than check_social
10 Aug, 2007, Vorlin wrote in the 10th comment:
Votes: 0
Right on, I changed the code to reflect the { }s in check_social.

Here's my interp() in interp.c:

/*
* The main entry point for executing commands.
* Can be recursively called from 'at', 'order', 'force'.
*/
void interpret (CHAR_DATA * ch, char *argument)
{
char command[MAX_INPUT_LENGTH];
char logline[MAX_INPUT_LENGTH];
int cmd;
int trust;
bool found;

/*
* Strip leading spaces.
*/
while (isspace (*argument))
argument++;
if (argument[0] == '\0')
return;

/*
* No hiding.
*/
REMOVE_BIT (ch->affected_by, AFF_HIDE);

/*
* Implement freeze command.
*/
if (!IS_NPC (ch) && IS_SET (ch->act, PLR_FREEZE))
{
send_to_char ("You're totally frozen!\n\r", ch);
return;
}

/*
* Grab the command word.
* Special parsing so ' can be a command,
* also no spaces needed after punctuation.
*/
strcpy (logline, argument);
if (!isalpha (argument[0]) && !isdigit (argument[0]))
{
command[0] = argument[0];
command[1] = '\0';
argument++;
while (isspace (*argument))
argument++;
}
else
{
argument = one_argument (argument, command);
}

/*
* Look for command in command table.
*/
found = FALSE;
trust = get_trust (ch);
for (cmd = 0; cmd_table[cmd].name[0] != '\0'; cmd++)
{
if (command[0] == cmd_table[cmd].name[0]
&& !str_prefix (command, cmd_table[cmd].name)
&& cmd_table[cmd].level <= trust)
{
found = TRUE;
break;
}
}

/*
* Log and snoop.
*/
smash_dollar(logline);

if (cmd_table[cmd].log == LOG_NEVER)
strcpy (logline, "");

/* Replaced original block of code with fix from Edwin
* to prevent crashes due to dollar signs in logstrings.
* I threw in the above call to smash_dollar() just for
* the sake of overkill :) JR – 10/15/00
*/
if ( ( !IS_NPC(ch) && IS_SET(ch->act, PLR_LOG) )
|| fLogAll
|| cmd_table[cmd].log == LOG_ALWAYS )
{
char s[2*MAX_INPUT_LENGTH],*ps;
int i;

ps=s;
sprintf( log_buf, "Log %s: %s", ch->name, logline );
/* Make sure that was is displayed is what is typed */
for (i=0;log_buf[i];i++)
{
*ps++=log_buf[i];
if (log_buf[i]=='$')
*ps++='$';
if (log_buf[i]=='{')
*ps++='{';
}
*ps=0;
wiznet(s,ch,NULL,WIZ_SECURE,0,get_trust(ch));
log_string( log_buf );
}

if (ch->desc != NULL && ch->desc->snoop_by != NULL)
{
write_to_buffer (ch->desc->snoop_by, "% ", 2);
write_to_buffer (ch->desc->snoop_by, logline, 0);
write_to_buffer (ch->desc->snoop_by, "\n\r", 2);
}

if (!found)
{
/*
* Look for command in socials table.
*/
if (!check_social (ch, command, argument))
send_to_char ("Huh?\n\r", ch);
return;
}

/*
* Character not in position for command?
*/
if (ch->position < cmd_table[cmd].position)
{
switch (ch->position)
{
case POS_DEAD:
send_to_char ("Lie still; you are DEAD.\n\r", ch);
break;

case POS_MORTAL:
case POS_INCAP:
send_to_char ("You are hurt far too bad for that.\n\r", ch);
break;

case POS_STUNNED:
send_to_char ("You are too stunned to do that.\n\r", ch);
break;

case POS_SLEEPING:
send_to_char ("In your dreams, or what?\n\r", ch);
break;

case POS_RESTING:
send_to_char ("Nah… You feel too relaxed…\n\r", ch);
break;

case POS_SITTING:
send_to_char ("Better stand up first.\n\r", ch);
break;

case POS_FIGHTING:
send_to_char ("No way! You are still fighting!\n\r", ch);
break;

}
return;
}

/*
* Dispatch the command.
*/
(*cmd_table[cmd].do_fun) (ch, argument);

tail_chain ();
return;
}
10 Aug, 2007, Vorlin wrote in the 11th comment:
Votes: 0
Mother *&^*^(: I found the problem… I did a diff on Quickmud's interp.c and my interp.c and found this:

Quickmud:
{
found = TRUE;
break;
}


Mine:
found = TRUE;
break;


I went in and found the two instances where there's a 'found = TRUE;'. One was the same as the other but in check_social, I had removed the two { }s in the if statement. Soon as I put them back in and did a copyover, socials worked. Chalk one up for experience, yay! Thanks for all the help, though…I got lucky in that I did the diff on the two files…
10 Aug, 2007, Conner wrote in the 12th comment:
Votes: 0
Amazing what a pair of braces (or parenthesis in some cases), or lack thereof, will do to you, isn't it?
0.0/12