View Single Post
Olly
Senior Member
Join Date: Mar 2007
Location: UK
Old 08-07-2008 , 13:59   Re: IRC Relay (v2.1.0) UPDATED!
Reply With Quote #224

Quote:
Originally Posted by Sazpaimon View Post
Looks like you have a similar problem to me. When I tried to connect to one of my networks, it would connect but not auth to nickserv and not join the channels. I deducted that the problem was the MOTD not being displayed all the way because it was very long. The IRC plugin is set to join channels and auth to nickserv when the message "End of /MOTD command." is displayed, then the plugin is set to connected, but this never happens due this bug in the socket extention. My fix was connecting it to a specific server with a much shorter MOTD and it fixed the issue. Unfortunately, if you don't have a server with either no MOTD or a short MOTD it won't fully connect.
I programmed IRC Relay according to the RFC. When the IRC server is done spewing the MOTD, it should send a numeric, which will be picked up by the relay, and join channels.

If the server is running some ircd that does'nt conform to the RFC, then problems can happen.

Quote:
Originally Posted by Sazpaimon View Post
Actually, I just checked my sp against the one in the first post, and it mine is the fixed one. Here's what's changed

Code:
    while(moreKeys)
    {
        new String:channelName[64], String:channelType[32], ChannelType:channelTypenum;
        
        KvGetSectionName(channelKV, channelName, sizeof(channelName));
        KvGetString(channelKV, "type", channelType, sizeof(channelType), "IRC_CHANNEL_PUBLIC");
        
        if(!strcmp(channelType, "IRC_CHANNEL_PUBLIC"))
            channelTypenum = IRC_CHANNEL_PUBLIC; // 1
        else if(!strcmp(channelType, "IRC_CHANNEL_PRIVATE"))
            channelTypenum = IRC_CHANNEL_PRIVATE; // 2
            
        PushArrayString(g_ChannelNames, channelName);
        PushArrayCell(g_ChannelTypes, channelTypenum);
        
        moreKeys = KvGotoNextKey(channelKV);
    }
Code:
    while(moreKeys)
    {
        new String:channelName[64], String:channelType[32], ChannelType:channelTypenum;
        
        KvGetSectionName(channelKV, channelName, sizeof(channelName));
        KvGetString(channelKV, "type", channelType, sizeof(channelType), "IRC_CHANNEL_PUBLIC");
        
        if(FindStringInArray(g_ChannelNames, channelName) != -1)
        {
            moreKeys = KvGotoNextKey(channelKV);
            continue;
        }
        
        if(!strcmp(channelType, "IRC_CHANNEL_PUBLIC"))
            channelTypenum = IRC_CHANNEL_PUBLIC; // 1
        else if(!strcmp(channelType, "IRC_CHANNEL_PRIVATE"))
            channelTypenum = IRC_CHANNEL_PRIVATE; // 2
            
        PushArrayString(g_ChannelNames, channelName);
        PushArrayCell(g_ChannelTypes, channelTypenum);
        
        moreKeys = KvGotoNextKey(channelKV);
    }
It's around line 1119 in the core sp file

What this does is check if the currently joined channel(s) are in the channel array, and doesn't re-add them if it is.
Oh - I dunno why I removed that :\ -- Thanks
__________________
Tumblr Me: http://raspberryteen.tumblr.com


// Yarrrr!
Olly is offline
Send a message via MSN to Olly