[TASK] Added function for clients, so they're able to send initial data right after connecting to a server.

[TASK] Restructured parts of the core to support sending data right after connecting.
[TASK] Adapted core part for automatic reconnect to support sending initial data, too.
This commit is contained in:
Jan Philipp Timme
2011-06-25 22:13:53 +00:00
parent 4c9f5ba7f3
commit 2c5e520c9f
11 changed files with 159 additions and 66 deletions
+10 -5
View File
@@ -6,15 +6,20 @@
*/
class Protocol_IrcProtocolHandler extends Protocol_AbstractProtocolHandler {
/**
* @var string
*/
protected $linebreak;
/**
* Is called by the constructor.
* Shall create the two buffers and set them up.
* @return void
*/
public function createBuffers() {
$linebreak = "\r\n";
$this->buffer_incoming = new Misc_Buffer($linebreak);
$this->buffer_outgoing = new Misc_Buffer($linebreak);
$this->linebreak = "\n";
$this->buffer_incoming = new Misc_Buffer($this->linebreak);
$this->buffer_outgoing = new Misc_Buffer($this->linebreak);
}
/**
@@ -153,7 +158,7 @@ class Protocol_IrcProtocolHandler extends Protocol_AbstractProtocolHandler {
//break;
//tell when stuff is not implemented
default:
echo "N.i.y.: " . $command . " [".$data."]\r\n";
//echo "N.i.y.: " . $command . " [".$data."]\r\n";
break;
}
@@ -182,7 +187,7 @@ class Protocol_IrcProtocolHandler extends Protocol_AbstractProtocolHandler {
* @return void
*/
public function sendRaw($data) {
$this->buffer_outgoing->addData($data);
$this->buffer_outgoing->addData($data . $this->linebreak);
}
/**