本文整理汇总了C#中Meebey.SmartIrc4net.IrcMessageData类的典型用法代码示例。如果您正苦于以下问题:C# IrcMessageData类的具体用法?C# IrcMessageData怎么用?C# IrcMessageData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IrcMessageData类属于Meebey.SmartIrc4net命名空间,在下文中一共展示了IrcMessageData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public override void Execute(IrcMessageData data)
{
int start = data.Message.IndexOf(Name, StringComparison.CurrentCultureIgnoreCase) + Name.Length + 1;
if (data.Message.Length <= start)
{
plugin.Host.Reply(data, SendType.Message, "No such command");
return;
}
int end = data.Message.IndexOf(' ', start);
if (end <= start)
{
end = data.Message.Length;
if (end <= start)
{
plugin.Host.Reply(data, SendType.Message, "No account specified");
return;
}
}
string account = data.Message.Substring(start, end - start);
plugin.RemoveAccount(account);
plugin.Host.Reply(data, SendType.Message, "Account deleted");
}
示例2: Execute
public override void Execute(IrcMessageData data)
{
int start = data.Message.IndexOf(Name, StringComparison.CurrentCultureIgnoreCase) + Name.Length + 1;
if (data.Message.Length <= start)
{
plugin.Host.Reply(data, SendType.Message, "No such command");
return;
}
int end = data.Message.IndexOf(' ', start);
if (end <= start)
{
end = data.Message.Length;
if (end <= start)
{
plugin.Host.Reply(data, SendType.Message, "No account group specified");
return;
}
}
string group = data.Message.Substring(start, end - start);
var members = plugin.GetAccountMembers(group);
StringBuilder msg = new StringBuilder("Members: ");
for (int i = 0; i < members.Length; i++)
{
msg.Append(members[i]);
if (i + 1 < members.Length)
msg.Append(", ");
}
plugin.Host.Reply(data, SendType.Message, msg.ToString());
}
示例3: Execute
public override void Execute(IrcMessageData data)
{
int start = data.Message.IndexOf(Name, StringComparison.CurrentCultureIgnoreCase) + 2;
if (data.Message.Length <= start)
{
plugin.Host.Reply(data, SendType.Message, "No such command");
return;
}
int end = data.Message.IndexOf(' ');
if (end <= start)
{
end = data.Message.Length;
if (end <= start)
{
plugin.Host.Reply(data, SendType.Message, "No such command");
return;
}
}
string command = data.Message.Substring(start, end - start).ToLower();
Type[] types = System.Reflection.Assembly.GetExecutingAssembly().GetTypes();
//grab and add given command
}
示例4: AddPlayer
private string AddPlayer(IrcMessageData msg)
{
string res;
string sender = RealName(msg.From).ToLower();
if (sender == "voodoohood")
{
if(msg.MessageArray.Length >= 2)
{
string userToAdd = msg.MessageArray[1].ToLower();
bool playerAlreadyRegistered = _database.isUserRegistered(userToAdd);
if (!playerAlreadyRegistered)
{
_database.addPlayerToCraftWar(userToAdd);
res = "User " + userToAdd + " added to the registered players .";
DumberLogger.Log(" CraftWarComp: Added user" + userToAdd + " to database, is registered " + _database.isUserRegistered(userToAdd));
}
else
{
res = "User " + userToAdd + " is already registered";
}
}
else
{
res = null;
DumberLogger.Log(" CraftWarComp: Format of the message wasnt correct");
}
}
else
{
res = null;
DumberLogger.Log(" CraftWarComp: User other than voodoohood tryed to add a user");
}
return res;
}
示例5: Execute
public override void Execute(IrcMessageData data)
{
int start = data.Message.IndexOf(Name, StringComparison.CurrentCultureIgnoreCase) + Name.Length + 1;
if (data.Message.Length <= start)
{
plugin.Host.Reply(data, SendType.Message, "No such command");
return;
}
int end = data.Message.IndexOf(' ', start);
if (end <= start)
{
end = data.Message.Length;
if (end <= start)
{
plugin.Host.Reply(data, SendType.Message, "No such command");
return;
}
}
string group = data.Message.Substring(start, end - start);
if (plugin.GetCommandsAtGroup(group) == null)
{
plugin.Host.Reply(data, SendType.Message, "No account group '" + group + "' exists");
return;
}
plugin.RemoveAccountGroup(group);
plugin.Host.Reply(data, SendType.Message, "Account group " + group + " deleted");
}
示例6: OnReadLine
public bool OnReadLine(IrcMessageData data)
{
if ((data.Type != ReceiveType.ChannelMessage) && (data.Type != ReceiveType.QueryMessage))
return true;
if ((data.MessageArray.Length > 1) && ((data.MessageArray[0].ToLower() == "!nick") || (data.MessageArray[0].ToLower() == "!name"))) {
_irc.RfcNick(data.MessageArray[1]);
return true;
}
if ((data.Type == ReceiveType.ChannelMessage) && (data.MessageArray[0] == "!help")) {
DisplayHelp(data);
return true;
}
if (data.Type != ReceiveType.QueryMessage)
return true;
if (data.MessageArray.Length > 0) {
_irc.SendMessage(SendType.Message, Admin._channel, data.Message);
Console.WriteLine(data.Nick + " " + data.Message);
}
return true;
}
示例7: Parse
public static BanInfo Parse(IrcMessageData data)
{
BanInfo info = new BanInfo();
// :magnet.oftc.net 367 meebey #smuxi [email protected] [email protected] 1216309801..
info.f_Channel = data.RawMessageArray[3];
info.f_Mask= data.RawMessageArray[4];
return info;
}
示例8: Check
public override bool Check(IrcMessageData msg)
{
Boolean res = false;
string com = msg.MessageArray[0];
for (int i = 0; i < commands.Length; i++)
{
if (com == commands[i]) res = true;
}
return res;
}
示例9: ParseForLink
private void ParseForLink(IrcMessageData data)
{
CheckLinkDate();
_links.AddRange(data.MessageArray.Where(word =>
(!_links.Contains(word)) &&
(Uri.IsWellFormedUriString(word, UriKind.Absolute)) &&
((word.StartsWith("http")) ||
(word.StartsWith("www")))
));
}
示例10: Disconnect
private string Disconnect(IrcMessageData msg)
{
string sender = RealName(msg.From).ToLower();
bool isSenderDev = sender == "voodoohood" || sender == "n1ghtsh0ck";
if (isSenderDev)
{
Environment.Exit(0);
}
return null;
}
示例11: CreateCtcpEventArgs
protected IrcEventArgs CreateCtcpEventArgs(string aChannel, string aBot, string aMessage, ReceiveType aType, string aCtcpCommand)
{
IrcMessageData data = new IrcMessageData(null, "", aBot, "", "", aChannel, aMessage, aMessage, aType, ReplyCode.Null);
CtcpEventArgs args = (CtcpEventArgs)System.Runtime.Serialization.FormatterServices.GetUninitializedObject(typeof(CtcpEventArgs));
FieldInfo[] EventFields = typeof(IrcEventArgs).GetFields(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly);
EventFields[0].SetValue(args, data);
FieldInfo[] EventFields2 = typeof(CtcpEventArgs).GetFields(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly);
EventFields2[0].SetValue(args, aCtcpCommand);
return args;
}
示例12: Execute
public override void Execute(IrcMessageData data)
{
var groups = plugin.GetAccountGroups();
StringBuilder msg = new StringBuilder("Existing groups: ");
for (int i = 0; i < groups.Length; i++)
{
msg.Append(groups[i]);
if (i + 1 < groups.Length)
msg.Append(", ");
}
plugin.Host.Reply(data, SendType.Message, msg.ToString());
}
示例13: Handle
public override string Handle(IrcMessageData msg)
{
string res = null;
string com = msg.MessageArray[0];
switch (com)
{
case "#gamba":
res = Gamba(msg);
break;
}
return res;
}
示例14: Handle
public override string Handle(IrcMessageData msg)
{
string res = null;
string com = msg.MessageArray[0];
switch (com)
{
case "#disconnect":
Disconnect(msg);
break;
default:
break;
}
return res;
}
示例15: StartRoulette
private string StartRoulette(IrcMessageData msg)
{
string res = null;
string sender = RealName(msg.From).ToLower();
if(sender == "voodoohood")
{
_rouletteActive = true;
res = "Roulette started place your bets , you have 1 minute time. Use #placebet <0-36> <1-10000> to place a bet";
Thread rouletteThread = new Thread(RouletteThreadTask);
_bets = new List<bet>();
rouletteThread.Start();
}
return res;
}