16 Aug, 2008, Pedlar wrote in the 1st comment:
Votes: 0
ok, so, Ronfar was having some issues with color codes and the default @ seperator for the IMC2 network, so i set out to find hiim a fix for his error and here it is:

add somewhere in imc.c (mines at the top.)

/* Pedlar - Fix for custom Name@Mud seperators */
#define IMC_SEPERATOR "<>"

char* fix_sender(char* string)
{
char from[SMST];
char senders[SMST];
static char buf[SMST];
char *x, *y, *z;
senders[0] = '\0';
from[0] = '\0';

y = string;

x = senders;
while(*y != '\0') {
if(*y == '@') {
*y++;
*x++ = '\0';
break;
}

*x++ = *y++;
}

z = from;
while(*y != '\0') {
*z++ = *y++;
}
*z++ = '\0';

sprintf(buf, "%s%s%s", senders, IMC_SEPERATOR, from);

return buf;
}


in then in function

Quote
PFUN( imc_recv_pbroadcast )


change
imc_display_channel( c, sender , txt, em );

to
imc_display_channel( c, fix_sender( sender ), txt, em );


and in function
Quote
PFUN( imc_recv_broadcast )


change
if( !sender || sender[0] == '\0' )
imc_display_channel( c, q->from, txt, em );
else
imc_display_channel( c, sender, txt, em );


to

if( !sender || sender[0] == '\0' )
imc_display_channel( c, fix_sender( q->from ), txt, em );
else
imc_display_channel( c, fix_sender( sender ), txt, em );


Hope this makes some people happy.

you can make the IMC_SEPERATOR whatever you want. i just did <> for testing it out.
16 Aug, 2008, MaineCoon wrote in the 2nd comment:
Votes: 0
This code has a memory leak - you are calling str_dup and returning the results of that, but his memory is never freed.

Instead, change

char buf[SMST];


to

static char buf[SMST];


and then change

return str_dup(buf);


to

return buf;


As long as nothing calls fix_sender while using the results of a call to fix_sender, you'll be fine.
16 Aug, 2008, Pedlar wrote in the 3rd comment:
Votes: 0
did already :D
16 Aug, 2008, Ronfar wrote in the 4th comment:
Votes: 0
You are truly a life saver… or at least a time saver!

I was cringing at the thought of having to change all my color codes…. can't imagine that being any fun at all.

Thanks a TON! someday when I'm a coding genius (hah.) I'll repay you :D
16 Aug, 2008, David Haley wrote in the 5th comment:
Votes: 0
Looks helpful. :smile: But it's spelled separator, not "seperator". :wink:
16 Aug, 2008, Pedlar wrote in the 6th comment:
Votes: 0
bah David, I can't spell to save my life, who cares :P
16 Aug, 2008, kiasyn wrote in the 7th comment:
Votes: 0
You'll still have to use @ for stuff like imctell, which could get confusing. Probably should convert in both directions.
16 Aug, 2008, Pedlar wrote in the 8th comment:
Votes: 0
can use same function, just put it in the imctells functions I forgot that part, since i rarely use imctell :D
16 Aug, 2008, kiasyn wrote in the 9th comment:
Votes: 0
What I'm saying is any commands requiring 'Person@MUD' should be changed to 'Person' IMC_SEPARATOR 'MUD' and then have a function that translates the separator to '@', which is what the protocol dictates.
16 Aug, 2008, Pedlar wrote in the 10th comment:
Votes: 0
ahhh, yea, that would be pretty nice, abit of work to do now knowing if anyone would ever use it though, I could possibly rewriteit so IMCSEPERATOR is apart of the imcconfig, and make it like that, and possibly upload the changed version here, so people can just download the changed version instead of patching it. when i find free time to do so.
17 Aug, 2008, David Haley wrote in the 11th comment:
Votes: 0
Well, I'm just trying to avoid more spelling mistakes getting into the source… I think that SMAUG is responsible for a whole generation of effect vs. affect mistakes. :tongue:
17 Aug, 2008, Pedlar wrote in the 12th comment:
Votes: 0
I have Finished work on it yay!

New commands:
imcconfig channsep <channel seperator> (Can be a string)
imcconfig telldelim <Tell Delimiter> (Can only be a single character)

it works i tellya!, i have my Tell Delim set to : and i can use imctell kiasyn:talon <message> and have it work ;)

I have a few more changes to make(Changing over the tells to use the channel seperator)

I will post a link to the uploaded base files, and a patch file for people who currently have imc, and wish to add thsese changes.
17 Aug, 2008, Guest wrote in the 13th comment:
Votes: 0
Just be sure you mark in very clear terms that this should only be done on codebases where there is color interference from the separation character. And for the love of God, make sure the new separator can't leak out onto the network or their communications will simply be dropped as invalid by the servers.
17 Aug, 2008, Pedlar wrote in the 14th comment:
Votes: 0
Don't worry Samson :D its all client side fixes, wont leak over to the sending packets, those are still going to use @ symbol (I made sure, ive been using the system for a day now :D) and why does it only need to be for color interference? I kinda liked the idea to be able to change the stuff as I saw fit for it :D
17 Aug, 2008, Guest wrote in the 15th comment:
Votes: 0
Color interference was the reason for the patch, yes? Otherwise there's not much of a point in doing it from what I can tell.
17 Aug, 2008, Pedlar wrote in the 16th comment:
Votes: 0
cause ya can make it look cool :D
I think the idea of it is nice, to be able to make things work like you want them to, instead of having one set thing you must have.
17 Aug, 2008, David Haley wrote in the 17th comment:
Votes: 0
Seriously though, would it be possible to fix the spelling in the patch?
17 Aug, 2008, Pedlar wrote in the 18th comment:
Votes: 0
on the release, I will fix all the spelling errors David :D you OCD Bastard you!
17 Aug, 2008, Pedlar wrote in the 19th comment:
Votes: 0
OK i finished testing and playing with it. here it is: Custom IMC2 Separator Patch

Yes, David i fixed the spelling :D
18 Aug, 2008, David Haley wrote in the 20th comment:
Votes: 0
***************
*** 2012,2021 ****
this_imcmud->localname );
for( d = first_descriptor; d; d = d->next )
{
! person = d->original ? d->original : d->character;
!
! if( !person )
! continue;

if( IMCISINVIS( person ) )
continue;
— 2083,2091 —-
this_imcmud->localname );
for( d = first_descriptor; d; d = d->next )
{
! person = d->original ? d->original : d->character;
! if(!person)
! continue;

if( IMCISINVIS( person ) )
continue;

What changed here? I think that if nothing changes, it's better to make the new version exactly match the old so that it's completely obvious what changes are actually changes.

***************
*** 7912,7918 ****
return socname;
}

! /* Revised 10/10/03 by Xorith: Recognize the need to capitalize for a new sentence. */
char *imc_act_string( const char *format, CHAR_DATA * ch, CHAR_DATA * vic )
{
static char *const he_she[] = { "it", "he", "she" };
— 8020,8027 —-
return socname;
}

! /* Revised 10/10/03 by Xorith: Recognize the need to capitalizew for a
! new�sentence. */
char *imc_act_string( const char *format, CHAR_DATA * ch, CHAR_DATA * vic )
{
static char *const he_she[] = { "it", "he", "she" };

A typo was introduced in the comment. Actually, I'm not sure why that comment changed at all.

And I'm glad to see that the spelling was fixed. :smile:
0.0/21