using System;
using System.Collections.Generic;
using System.Text;
namespace csharpirc
{
public static class Commands
{
public static void msg_sending(string sending)
{
char[] splitter = { ' ' };
string[] commandLine = new string[1024];
string nickname = "";
string message = "";
commandLine = sending.Split(splitter);
if (sending.Contains("/msg"))
{
int count = 2;
while (count != commandLine.Length)
{
nickname = commandLine[1];
//message = "";
message += commandLine[count] + " ";
count++;
}
Networking.writer.WriteLine("PRIVMSG " + nickname + " : " + message);
Networking.writer.Flush();
}
else if (sending.Contains("/voice"))
{
nickname = commandLine[1];
message = "";
//int count = 2;
Networking.writer.WriteLine("MODE " + SetupClass.Channel + " +v " + nickname);
Networking.writer.Flush();
}
else if (sending.Contains("/quit"))
{
Networking.writer.WriteLine("QUIT ");
Networking.writer.Flush();
}
else if (sending.Contains("/names"))
{
Networking.writer.WriteLine("NAMES " + SetupClass.Channel);
Networking.writer.Flush();
}
else if (sending.Contains("/topic"))
{
Networking.writer.WriteLine("TOPIC " + SetupClass.Channel);
Networking.writer.Flush();
}
else
{
Networking.writer.WriteLine("PRIVMSG " + SetupClass.Channel + " : " + sending);
Networking.writer.Flush();
}
}
}
}