[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:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user