From 7b3f5a75e7bba8bd536cd0cbbaa595113765a15e Mon Sep 17 00:00:00 2001 From: pk910 Date: Tue, 26 Jul 2011 07:08:32 +0200 Subject: [PATCH] added Server PING -> PONG --- Uplink/P10Formatter.class.php | 4 +++- Uplink/Uplink.class.php | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Uplink/P10Formatter.class.php b/Uplink/P10Formatter.class.php index 66bf379..73d620d 100644 --- a/Uplink/P10Formatter.class.php +++ b/Uplink/P10Formatter.class.php @@ -37,7 +37,9 @@ class P10Formatter { private static $commands = array( "PASS" => "PASS :%s", "SERVER" => "SERVER %s 1 %s %s J10 %s]]] +s6 :%s", - "ERROR" => "ERROR :%s" + "ERROR" => "ERROR :%s", + "Z" => "{num} Z %s", + null => null ); public static function formatCMD($numeric, $command, $args) { diff --git a/Uplink/Uplink.class.php b/Uplink/Uplink.class.php index 0dd6df9..2dee4da 100644 --- a/Uplink/Uplink.class.php +++ b/Uplink/Uplink.class.php @@ -179,6 +179,13 @@ class Uplink { $this->recv_error($from, $arguments); break; //P10 Session + case "S": + $this->recv_server($from, $arguments); + break; + case "G": + $this->recv_ping($from, $arguments); + break; + //default default: //unknown cmd break; @@ -240,6 +247,10 @@ class Uplink { } } + private function recv_ping($from, $args) { + $this->send("Z", $args[0]); //simply PONG + } + } ?> \ No newline at end of file -- 2.20.1