meebey / smartirc4net Goto Github PK
View Code? Open in Web Editor NEWIRC C# Library
Home Page: http://www.meebey.net/projects/smartirc4net/
License: Other
IRC C# Library
Home Page: http://www.meebey.net/projects/smartirc4net/
License: Other
SmartIrc4net ---------------- What is this? SmartIrc4net is a C# class for communication with IRC networks, which conforms to the RFC 2812 (IRC Protocol). It's orignally a port of SmartIRC (written in PHP), but it's much more now (I will backport it to PHP5 some day). SmartIrc4net an API that handles all IRC protocol messages and is designed for creating IRC bots or even GUI clients. Please report bugs to: https://github.com/meebey/SmartIrc4net/issues Project Homepage: https://www.meebey.net/projects/smartirc4net/ files included in SmartIrc4net -------------------------- FEATURES A full list of features that SmartIrc4net includes CHANGELOG Listing of changes between all versions. README This file LICENSE The license of SmartIrc4net. CREDITS Creditlist with people that work/help on SmartIrc4net. src/*.cs The SmartIrc4net sourcecode examples/ Some examples how SmartIrc4net can be used. docs/ Documentation of SmartIrc4net. CSharpBuilder/ Project files for Borlands C# Builder. MonoDevelop/ Project files for MonoDevelop.
Meebey... come on !
I want to change my User name to Unicode.
2Chainz№Homo
IRC is unable to portray my swag how can i prove im not a fag
I understand that is still works just fine, but getting rid of deprecating things is desired.
IrcClient\IrcClient.cs(102,102): Warning CS0618: 'System.Collections.CaseInsensitiveHashCodeProvider' is obsolete: 'Please use StringComparer instead.' (CS0618)
IrcClient\IrcClient.cs(84,84): Warning CS0618: 'System.Collections.Hashtable.Hashtable(System.Collections.IHashCodeProvider, System.Collections.IComparer)' is obsolete: 'Please use Hashtable(IEqualityComparer) instead.' (CS0618)
IrcFeatures\DccConnection.cs(26,26): Warning CS0618: 'System.Net.IPAddress.Address' is obsolete: 'This property has been deprecated. It is address family dependent. Please use IPAddress.Equals method to perform comparisons. http://go.microsoft.com/fwlink/?linkid=14202' (CS0618)
I'm using a bouncer that automatically joins channels, and whenever it reconnects to the IRC server, smartirc4net crashes.
System.ArgumentException: Key duplication when adding: #channelname
at System.Collections.Hashtable.PutImpl (System.Object key, System.Object value, Boolean overwrite) [0x00000] in <filename unknown>:0
at System.Collections.Hashtable.Add (System.Object key, System.Object value) [0x00000] in <filename unknown>:0
at System.Collections.Hashtable+SyncHashtable.Add (System.Object key, System.Object value) [0x00000] in <filename unknown>:0
at Meebey.SmartIrc4net.IrcClient._Event_JOIN (Meebey.SmartIrc4net.IrcMessageData ircdata) [0x00000] in <filename unknown>:0
at Meebey.SmartIrc4net.IrcClient._HandleEvents (Meebey.SmartIrc4net.IrcMessageData ircdata) [0x00000] in <filename unknown>:0
at Meebey.SmartIrc4net.IrcClient._Worker (System.Object sender, Meebey.SmartIrc4net.ReadLineEventArgs e) [0x00000] in <filename unknown>:0
at (wrapper delegate-invoke) <Module>:invoke_void__this___object_ReadLineEventArgs (object,Meebey.SmartIrc4net.ReadLineEventArgs)
at Meebey.SmartIrc4net.IrcConnection.ReadLine (Boolean blocking) [0x00000] in <filename unknown>:0
at Meebey.SmartIrc4net.IrcConnection.Listen (Boolean blocking) [0x00000] in <filename unknown>:0
at Meebey.SmartIrc4net.IrcConnection.Listen () [0x00000] in <filename unknown>:0
When I call client.Disconnect the program hangs for over 30 seconds and fails to disconnect.
I've tried with using Listen and ListenOnce with a flag (triggered by command sent).
I am using smartirc4net-0.4.5.1 and the IrcClient class.
Today the IrcConnection somehow went into some kind of queue loop, writing two lines over and over into my log:
...
03-09-2013 20:23:29,427 WARN [WriteThread (irc.worldwideirc.net:6667)] 0:SOCKET.sending data failed, connection lost
03-09-2013 20:23:29,427 WARN [WriteThread (irc.worldwideirc.net:6667)] 0:QUEUE.Sending data was not sucessful, data is requeued!
03-09-2013 20:23:29,627 WARN [WriteThread (irc.worldwideirc.net:6667)] 0:SOCKET.sending data failed, connection lost
03-09-2013 20:23:29,628 WARN [WriteThread (irc.worldwideirc.net:6667)] 0:QUEUE.Sending data was not sucessful, data is requeued!
03-09-2013 20:23:29,828 WARN [WriteThread (irc.worldwideirc.net:6667)] 0:SOCKET.sending data failed, connection lost
03-09-2013 20:23:29,829 WARN [WriteThread (irc.worldwideirc.net:6667)] 0:QUEUE.Sending data was not sucessful, data is requeued!
03-09-2013 20:23:30,029 WARN [WriteThread (irc.worldwideirc.net:6667)] 0:SOCKET.sending data failed, connection lost
03-09-2013 20:23:30,030 WARN [WriteThread (irc.worldwideirc.net:6667)] 0:QUEUE.Sending data was not sucessful, data is requeued!
03-09-2013 20:23:30,230 WARN [WriteThread (irc.worldwideirc.net:6667)] 0:SOCKET.sending data failed, connection lost
03-09-2013 20:23:30,230 WARN [WriteThread (irc.worldwideirc.net:6667)] 0:QUEUE.Sending data was not sucessful, data is requeued!
03-09-2013 20:23:30,431 WARN [WriteThread (irc.worldwideirc.net:6667)] 0:SOCKET.sending data failed, connection lost
03-09-2013 20:23:30,431 WARN [WriteThread (irc.worldwideirc.net:6667)] 0:QUEUE.Sending data was not sucessful, data is requeued!
03-09-2013 20:23:30,632 WARN [WriteThread (irc.worldwideirc.net:6667)] 0:SOCKET.sending data failed, connection lost
03-09-2013 20:23:30,632 WARN [WriteThread (irc.worldwideirc.net:6667)] 0:QUEUE.Sending data was not sucessful, data is requeued!
...
This is the code I use
WebClient c = new WebClient();
string data = "";
data = c.DownloadString("website");
irc.SendMessage(SendType.Message, "#channel", "Message: " + data);
When it sends the message it just says Message:
If I have it read a float then it can send it in the message but if I have it send data from a string it doesn't work.
Hi,
when I use Listen() overload it works fine, but as soon as I set blocking to false, no events are being fired, is that a bug?
Thanks in advance
I haven't checked this, but if I'm reading the code in IrcConnection.cs properly, is there not potential for an IndexOutOfBoundsException under the following circumstances:
_NextAddress() is never called / _CurrentAddress is never reset to 0 at the beginning of a new connection attempt, I think? Could someone confirm this?
try
{
while (_Connection.IsConnected &&
((data = _Connection._Reader.ReadLine()) != null))
{
_Queue.Enqueue(data);
QueuedEvent.Set();
}
}
I'm having some problems with this portion of the code. When I am telling the IRC bot to Disconnect(), it is hanging at _Thread.Join() until the ReadLine() goes through the loop (when it receives another message in a channel or anything that causes ReadLine() to have data), at which time it catches the Abort() call.
This is causing me problems with the bot hanging after I tell it to disconnect, it won't actually disconnect until something is first received.
Am I doing something wrong here?
Hi, I'm a bit new to C# Development and I'm building an IRC Client. When searching for documentation, I found this link on the website: https://www.aspfree.com/c/a/.NET/Using-SmartIrc4net/
It was written in 2006 and so I'm just curious whether it's still relevant/up-to-date. I'm a bit new to C# Development and so I've had a bit of trouble trying to wrap my head around how to use this library. The website lists the API and examples, but I have a hard time making any sense of them: http://www.meebey.net/projects/smartirc4net/#index5h2
Exception: Could not connect to: kornbluth.freenode.net:8000 Connection refused
at Meebey.SmartIrc4net.IrcConnection.Connect (System.String[] addresslist, Int32 port) [0x00000] in <filename unknown>:0
at Meebey.SmartIrc4net.IrcClient.Connect (System.String[] addresslist, Int32 port) [0x00000] in <filename unknown>:0
This happened, and it never connected to any other server in the list.
Right now SmartIrc4net only supports bare TCP sockets to connect to IRC servers but some IRCd implementations support WebSockets and thus SmartIrc4net should provide internally an abstraction that can cope with this. This was already troublesome when proxy support was added, it had to be glued into the connection handling itself, instead of being "stackable".
Really Meebey?
This Needs Fixed ASAP. I Can't send Message over 500 chars to my friends of long url describing very important rap lyric.
Who think smart to limit char to 500 message in 2014? LOL my bruh im not Lil Wayne I rap for real i Need mor than 500 chars to drop my bars
https://www.meebey.net/projects/smartirc4net/
The "API Documentation" link tells me "You don't have permission to access this resource." which makes development a bit trickier
The "DeveloperLand Article" link cannot be reached
The "ASP Free Article" can not be reached
As a developer searching for a simple to use IRC library it's not making a good first impression.
I'm trying to build a bot that keeps a list of logged in user nicks. I'd like to create an initial list when the room is first entered, then keep the list up to date anytime a new user joins. I tried OnChannelActiveSynced and OnChannelPassiveSynced, but when I call GetChannel, only the bot shows up in the "users" property.
I noticed that sometimes when the bot joins, OnJoin will be called for each currently logged in user so I wrote the below code to build the "useList" one nick at a time. Other times though, OnJoin is only called once for the bot and isn't called for each logged in user. Why would the behavior change?
Is it possible the channel I'm connecting to has different sync rules/settings? Maybe my bot is rejoining too quickly so it's not actually resyncing the room correctly?
I can't think of what else might be causing this unreliable behavior.
Please let me know if there is a better place to post and thanks for any help!
irc.OnJoin += new JoinEventHandler(OnJoin);
private void OnJoin(object sender, IrcEventArgs e)
{
if (!irc.IsMe(e.Data.Nick))
{
if (!userList.Contains(e.Data.Nick))
{
userList.Add(e.Data.Nick);
}
}
}
this client is exposing my windows username somehow, tried to find where in the code it gets it from, couldn´t find it
Hello,
I use SmartIrc4net in a library I develop for communicating with Twitch and the chat system (IRC-based). There's been an issue where after a random amount of time (sometimes several hours, sometimes several days) the the SmartIrc4net implementation hangs up and times out. @Danatobob and I have been working to figure out if it's an issue with TwitchLib or SmartIrc4net, and we're fairly confident it is with SmartIrc4net.
Since neither of us are super fluent with the SmartIrc4net, we were hoping you might be able to shed some light on the possible issue.
Here is the link to the issue: TwitchLib Issue #81
Using the built in logger in SmartIrc4net, @Danatobob was able to get a pretty good dump of events in IrcConnection object as seen starting at this comment and below: Comment with Debug
Extracted from his post, we get correct activity which would read something like this:
2016-11-28 00:21:38,899 [IdleWorkerThread (irc.chat.twitch.tv:6667)] DEBUG SOCKET - sent: "PING irc.chat.twitch.tv"
2016-11-28 00:21:39,112 [ReadThread (irc.chat.twitch.tv:6667)] DEBUG SOCKET - received: ":tmi.twitch.tv PONG tmi.twitch.tv :irc.chat.twitch.tv"
2016-11-28 00:21:39,112 [14] DEBUG QUEUE - read: ":tmi.twitch.tv PONG tmi.twitch.tv :irc.chat.twitch.tv"
however, after some time (not easy to consistently identify when/why the bad behavior starts), this will occur:
2016-11-28 00:25:38,901 [IdleWorkerThread (irc.chat.twitch.tv:6667)] DEBUG SOCKET - sent: "PING irc.chat.twitch.tv"
2016-11-28 00:25:39,113 [ReadThread (irc.chat.twitch.tv:6667)] DEBUG SOCKET - received: ":tmi.twitch.tv PONG tmi.twitch.tv :irc.chat.twitch.tv"
2016-11-28 00:28:03,216 [ReadThread (irc.chat.twitch.tv:6667)] DEBUG SOCKET - received: "PING :tmi.twitch.tv"
2016-11-28 00:31:38,903 [IdleWorkerThread (irc.chat.twitch.tv:6667)] WARN SOCKET - ping timeout, connection lost
Importantly, as noted by @Danatobob, DEBUG QUEUE doesn't react to PONG.
He goes on to provide further error logs I have provided one here: danatobob_irc_errorlog_full.txt that will likely prove useful in determing the source of the error. The issue starts shortly before the repeated sending data failed, connection lost
We would be very grateful for any insight on this issue.
Thanks
Is SSL possible with this library? When browsing the code it seems it should be, but I can't seem to work out how to enable it.
Based on a user's experience in #smuxi-devel and my own experience when first using SmartIrc4net.
I propose removing StarkSoft proxy's source code from the tree, and adding NuGet package config references for log4net and StarkSoft's updated proxy code StarkSoft.Aspen.Proxy, then changing the namespaces in our code from StarkSoft.Net.Proxy.
This will allow users to just clone the repo, double-click the .sln and compile without any reference or assembly errors as NuGet will restore the missing dependencies automatically.
The unoffical https://www.nuget.org/packages/SmartIrc4net/ even comes with typos in the DLL name:
Can't really take it serious. Please provide an official one also for additional trust.
Many of these date back from Ye Olden Days of .NET 1.1.
git log
.A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.