Password protected IRC

zwjohn

Active Member
Hi Amadeus,
I was wondering how do I connect to a password protected IRC server by using ISXIRC? It seems there is no such parameter in the function?

Thanks
 

Amadeus

The Maestro
Staff member
Password orotected servers are not part of the standard IRC protocol, so I did not have any information on how to impliment it.

Show me a server where I can get an account and test it, and I'll see about putting it in.
 

zwjohn

Active Member
Thanks Amadeus, I have setup an IRC server with password, please check your PM for login info. If you use mIRC you will have password as an option field when connecting to a server. Bad Password message returns when no password or wrong password provided. Hopeful you can figure out soon, thanks for your great works!
:)
John
 

Amadeus

The Maestro
Staff member
Ok, I updated the isxIRC release to include functionality for password protected servers (http://www.isxgames.com/forums/showthread.php?t=150).

Your server is custom code and doesn't follow the RFC:1549 IRC Protocol "to the letter", so while I think that most things will work just fine, if you notice weirdness, that's probably what it is.

I did notice though that your server will not process anything until the 'auth' process has finished. It doesn't REQUIRE an auth, so we're ok since isxIRC doesn't do auth yet; however, if you try connecting without a password..you'll notice that it takes about 5-10 seconds before it kicks you off.

Anyway, you should be golden now!

Code:
October 30, 2006 -- By Amadeus
[ISXIRC-20061030.exe]
* Added new option for connecting to a server with a password:
  - IRC:Connect[Server,Nick,Port#,Password]
  (Note:  You must enter the port# when using a password.  If you're not
          sure what port# to use, use 6667.)
* Added New EVENT:
  1. IRC_UserDisconnected(string User, string Reason, string OptionalServerResponse)
 

zwjohn

Active Member
Hi Amadeus,
Thanks for such quick release and update!
I have just tried new extension, but I am getting some errors. It may not be the extension problem, but it could be my script problem.
I simplely tried to use the samples1.iss script and connect to my server then join a channel after connected, but I got following errors, these are echos I put in IRC_JOINErrorResponse event.


IRC_JOINErrorResponse=Test3_NOTICE_AUTH_*** Looking up your hostname

IRC_JOINErrorResponse=Test3_NOTICE_AUTH_*** Found your hostname, cached

IRC_JOINErrorResponse=Test3_MUST_BE_REGISTERED_#isxeq2_Register first.

[Test3] Received a message that we were not identified/registered.
[Test3] Identifying with Nickserv now.
IRC_JOINErrorResponse=Test3_MUST_BE_REGISTERED_#isxeq2_Register first.


CRITICAL IRC ERROR: Closing Link: Test3[CPE001020d32016-CM000039ac905c...


I can use mIRC to connect to my server and join a channel no problem.

It seems IRCUser[${MyUserName}]:pM[Nickserv,"identify Test1Password"] does not register a user in my irc server and I was wondering if you can provide a simple sample code on how to connect to my server and join a channel?

Thanks for your time!
 

Amadeus

The Maestro
Staff member
Well, I suppose I would need a link to where you downloaded your server so I can see how it works.

You might want to try getting something a little more generic, perhaps like what Lax uses on irc.lavishsoft.com (I forget exactly what it is).
 

zwjohn

Active Member
Sure,
http://ircd.bircd.org/

I thought this server is popular and simple, and with password protection, that was why I picked this one. It should be IRC standard server.

It looks like there is problem registering with the server, i tried to change IRCUser[${MyUserName}]:pM[NickServ@ssn.play4cool.com,"identify passwrd"] and got
"Sorry, Test13 must register with Nickserv before joining '#isxeq2'."
I have no idea how should I register with the server, however mIRC connects the server without problem.

Thanks again for your time
 

Amadeus

The Maestro
Staff member
Well, I was going to test some more, but your server was down....or the IP address changed...
 

zwjohn

Active Member
Hi Amadeus,
I am also using my java application to connect to my server without problem, here is the java code that I use to connect to server. As you can notice there is USER command for registering a user on the server at the beginning of the connection. I am not sure if you have implementation on that or not. PASS, NICK and USER commands are sent to server when establishing a connection. In ISXIRC, I am not sure if the registration process is included in connect function or not.
From all my testings, isxirc's errors were same (user must register first), so I would think that step is somehow missing or the command used was incompatible with the server.

Thanks !

/**
* Registers the connection with the IRC server.<br />
* In fact, it sends a password (if set, else nothing), the nickname and the
* user, the realname and the host which we're connecting to.<br />
* The action synchronizes <code>code> so that no important messages
* (like the first PING) come in before this registration is finished.<br />
* The <code>USER</code> command's format is:<br /><code>
* &lt;username&gt; &lt;localhost&gt; &lt;irchost&gt; &lt;realname&gt;
* </code>
*/
private void register() {
if (pass != null)
send("PASS "+ pass);
send("NICK "+ nick);
send("USER "+ username +" "+ socket.getLocalAddress() +" "+ host
+" :"+ realname);
}


/**
* Sends a String to the server.
* You should use this method only, if you must do it. For most purposes,
* there are <code>do*</code> methods (like <code>doJoin</code>). A carriage
* return line feed (<code>\r\n</code>) is appended automatically.
* @param line The line which should be send to the server without the
* trailing carriage return line feed (<code>\r\n</code>).
*/
public void send(String line) {
try {
out.write(line +"\r\n");
out.flush();
if (level == 1) { // not registered
IRCParser p = new IRCParser(line);
if (p.getCommand().equalsIgnoreCase("NICK"))
nick = p.getParameter(1).trim();
}
} catch (Exception exc) {
// nothing
}
}
 

Amadeus

The Maestro
Staff member
send("PASS "+ pass);
This told me the information that I needed. I was using PASSWORD instead of PASS.

I'll release a version tonight when I get home that should work for you without a problem. I just tested using this, and was able to connect and join a channel without a problem:

Code:
IRC:Connect[ServerIP#,Amadeus,6667,password]
IRCUser[Amadeus]:Join[#isxeq2]
So, just watch for the next version coming out tonight...then download that and things should work much better. You might find a few other weird things about this server code base, but just let me know if something doesn't work or else if you need functionality added.
 

zwjohn

Active Member
Hi Amadeus,
I have tested the new release and it is now working very well as expected. I will write more scripts to test isxirc's functionalities and let you know if there is question. Again, thanks for your time and efforts!!

John
 

zwjohn

Active Member
Hi Amadeus,
I have been testing new release of ISXIRC in past few days and it worked as a champ, very smooth, it is way far better than ISXAIM (no offense to isxaim).
So far only one problem I found, the port parameter in connect function is not being used by connection. Whatever port number I put isxirc still tries to connect to 6667. Please check that out.

Thanks very much!
 

Amadeus

The Maestro
Staff member
Yes, you're right. It's working properly with Connect[Name,Server,Port] ..but it's not working properly with Connect[Name,Server,Port,Password].

Fixing it right now and will release a new version shortly.
 
Top Bottom