public function run() { $line = new ReceivedLine($this->runMessage); $line->parse(); ChannelManager::rename($this->senderNick, $this->targetNick); UserManager::rename($this->senderNick, $line->targetNick, $line->senderIdent, $line->senderHost); }
public function run() { $line = new ReceivedLine($this->runMessage); $line->parse(); $user = UserManager::get($this->senderNick); $server = Server::getInstance(); //$server->message($user->nickname, "Welcome to Persian Mafia game. This channel is logged, check this for more info : http://cyberrabbits.net/non/mafia/"); }
public function run() { $line = new ReceivedLine($this->runMessage); $line->parse(); $user = UserManager::get($this->senderNick); $db = Database::getInstance(); $stmt = $db->prepare("INSERT INTO channel_actions (type, nickname, host, ident, channel_name, message, time) VALUES (?,?,?,?,?,?,?)"); $stmt->execute(array(ReceivedLineTypes::CHANMSG, $this->senderNick, $user->host, $user->ident, $this->channel, $line->message, time())); }
public function run() { $line = new ReceivedLine($this->runMessage); $line->parse(); $game = MafiaGame::getInstance(); //ChannelManager::rename($this->senderNick, $this->targetNick); //UserManager::rename($this->senderNick, $line->targetNick, $line->senderIdent, $line->senderHost); $game->changeNick($this->senderNick, $this->targetNick); }
public function run() { $line = new ReceivedLine($this->runMessage); $line->parse(); $user = UserManager::get($this->senderNick); $user->nickname = $line->senderNick; $user->ident = $line->senderIdent; $user->host = $line->senderHost; UserManager::store($this->senderNick, $user); }
public function run() { $channel = ChannelManager::get($this->channel); $channel->addConnectedNick($this->senderNick); ChannelManager::store($this->channel, $channel); $line = new ReceivedLine($this->runMessage); $line->parse(); $user = UserManager::get($this->senderNick); $user->nickname = $line->senderNick; $user->ident = $line->senderIdent; $user->host = $line->senderHost; UserManager::store($this->senderNick, $user); }
public function run() { $channel = ChannelManager::get($this->channel); $line = new ReceivedLine($this->runMessage); $line->parse(); // We currently only process modes with targets. We can therefor skip if no targets present. if (empty($line->targetNick)) { return; } $modes = array(); if (strlen($line->message) > 2) { $split = str_split($line->message); $symbol = ""; foreach ($split as $id => $character) { if ($character == "+" || $character == "-") { $symbol = $character; } else { $modes[] = $symbol . $character; } } } else { $modes[] = $line->message; } $targetIndex = 0; foreach ($modes as $mode) { switch ($mode) { case "+v": $channel->addPrivilege($this->getTargetNick($line, $targetIndex++), "+"); break; case "+h": $channel->addPrivilege($this->getTargetNick($line, $targetIndex++), "%"); break; case "+o": $channel->addPrivilege($this->getTargetNick($line, $targetIndex++), "@"); break; case "+a": $channel->addPrivilege($this->getTargetNick($line, $targetIndex++), "&"); break; case "+q": $channel->addPrivilege($this->getTargetNick($line, $targetIndex++), "~"); break; default: if (in_array($mode, static::$modesWithTarget)) { $targetIndex++; } break; } } ChannelManager::store($this->channel, $channel); }
public function run() { $channel = ChannelManager::get($this->channel); $line = new ReceivedLine($this->runMessage); $line->parse(); $modes = array(); if (strlen($line->message) > 2) { $split = str_split($line->message); foreach ($split as $id => $character) { if ($id == 0) { $symbol = $split[0]; } else { $modes[] = $symbol . $character; } } } else { $modes[] = $line->message; } foreach ($modes as $mode) { switch ($mode) { case "+v": $channel->addPrivilege($line->targetNick, "+"); break; case "+h": $channel->addPrivilege($line->targetNick, "%"); break; case "+o": $channel->addPrivilege($line->targetNick, "@"); break; case "+a": $channel->addPrivilege($line->targetNick, "&"); break; case "+q": $channel->addPrivilege($line->targetNick, "~"); break; } } ChannelManager::store($this->channel, $channel); }
// Identify $server->identify(); sleep(1); // NickServ if (Config::$nickservPassword) { $server->identifyWithNickServ(); } // Loop through the channels in the config and join them foreach (Config::$channels as $channel) { $server->join($channel); } // Loop-edy-loop $cntUpd = 0; while ($server->connected()) { $line = $server->getNextLine(); $line = new ReceivedLine($line); $line->parse(); if ($line->isCommand()) { $command = new Command($line); $command->execute(); } if ($line->isMappedEvent()) { $event = new Event($line); $event->execute(); } if ($line->isMappedTrigger()) { $trigger = new Trigger($line); $trigger->execute(); } $cntUpd++; if ($cntUpd > 1000) {