[go: up one dir, main page]

Menu

[r1]: / csharpirc / Commands.cs  Maximize  Restore  History

Download this file

64 lines (58 with data), 2.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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();
}
}
}
}