IRC SERVER
The goal of this project is to make you write your own IRC server.
|
Go to the documentation of this file.
5 #include "../Command.hpp"
13 _description =
"Send message to a set of users/channels";
14 _usage =
"notice <receptor|channel>{,<receptor|channel>} :<texto>";
16 _example[1] =
"notice alfred,manolo hello";
17 _example[2] =
"notice #uruguay :hola, buenas tardes";
18 _example[3] =
"notice #uruguay,#peru :hola, buenas tardes";
34 else if (p[0].at(0) ==
'#')
36 std::vector<std::string> _ch_params =
split(p[0],
",");
37 for (
size_t i = 1; i < _ch_params.size(); i++)
50 std::vector<std::string> _cl_params =
split(p[0],
",");
51 for (
size_t i = 0; i < _cl_params.size(); i++)
66 std::string msg = std::string(p[1] +
"\n").c_str();
67 if (p[0].at(0) ==
'#')
69 std::vector<std::string> _ch_params =
split(p[0],
",");
70 for (
size_t i = 0; i < _ch_params.size(); i++)
72 std::string name = _ch_params[i].substr(1).c_str();
74 std::vector<Client *> clients = channel->
getClients();
75 for (
size_t j = 0; j < clients.size(); j++)
79 clients[j]->message(std::string(
":" +
_sender->
_nick +
" NOTICE #" +
80 channel->
getName() +
" :" + msg +
"\n")
88 std::vector<std::string> _cl_params =
split(p[0],
",");
89 for (
size_t i = 0; i < _cl_params.size(); i++)
Definition: Channel.hpp:26
std::string & getName(void)
Definition: Channel.hpp:82
bool isOpe(Client *client)
Definition: Channel.hpp:195
std::string _description
Definition: Command.hpp:12
Notice()
Definition: Notice.hpp:10
bool validate(void)
Definition: Notice.hpp:27
const std::string getNick(void) const
Definition: Client.hpp:142
std::string _name
Definition: Command.hpp:11
Definition: Command.hpp:7
void message(char const *message)
Definition: client.cpp:15
void execute()
Definition: Notice.hpp:63
Message * _message
Definition: Command.hpp:21
std::vector< std::string > split(const std::string &str, const std::string &delimiters)
Definition: functions.cpp:37
std::map< size_t, std::string > _example
Definition: Command.hpp:16
Client * getClient(std::string const &name)
Definition: Server.hpp:140
std::vector< Client * > getClients(void) const
Definition: Channel.hpp:172
bool joined(Client *client)
Definition: Channel.hpp:183
std::map< size_t, std::string > getParams(void) const
Definition: message.cpp:79
Channel * getChannel(std::string &name)
Definition: Server.hpp:202
Definition: Client.hpp:22
std::string _usage
Definition: Command.hpp:13
Client * _sender
Definition: Command.hpp:19
std::string _nick
Definition: Client.hpp:26
bool isModerated(void)
Definition: Channel.hpp:393
Server * _server
Definition: Command.hpp:20