forum-msg-id-132212-edit
Original date:2018-03-14 17:14:02 Edited by: ghaberek Subject: Re: Adding a GUI
Next, Kat's program has a hard-coded server name (one of several available, which you could change by editing code).
It's a worse situation than that. What if the user needs to add/delete servers?
And then there's the protocol issue of connecting. See the line " addr_ips = addrinfo[3] for irc.freenode.net, this could be a dozen ips to choose from " ( I didn't choose this idiot markup language )
When you connect to any network at "irc.networkname.ext", they reply with one or more server names. You are expected to parse the list and run thru the list until you connect to one. I removed that intelligence from the client to make irc.e. Ideally, those names should be used to auto-populate the menu of servers which client can connect to, for the case where people prefer to be on the same server (lan parties, for instance), and that's a client-gui thing. So anyhow, i hardcoded a server name to prove the code connects, and the user of irc.e is expected to override with their own list of networks and/or servers.
Strictly speaking, per what i have been told over and over on this forum, the whole procedure at_connected() should be removed, as well as the abbreviated handling of raw numeric 376 (the end of MOTD), because all that is not the connection, it's the protocol of using the connection, and should be in the client. But it's part of the slippery slope of handling the keep-alive and PING-PONG. It's extremely frustrating trying to make the code do less.
Not Categorized, Please Help
|