added Server PING -> PONG
authorpk910 <philipp@zoelle1.de>
Tue, 26 Jul 2011 05:08:32 +0000 (07:08 +0200)
committerpk910 <philipp@zoelle1.de>
Tue, 26 Jul 2011 05:08:32 +0000 (07:08 +0200)
Uplink/P10Formatter.class.php
Uplink/Uplink.class.php

index 66bf379a505ba162e466536f2f5bee2d89ace48d..73d620d7558b5b5797f37bf04e48783a6b9e6d38 100644 (file)
@@ -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) {
index 0dd6df9cca21dd1525ddef145f247009dea6ee24..2dee4da2f213caf4d93bc98d9c50bc7f1ba2f0d6 100644 (file)
@@ -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