예제 #1
0
 /**
  * Process the character login request
  */
 public function loginCharacter($info = array())
 {
     if (isset($this->characters[$info['slotchoosen']])) {
         $this->player = new Player($this->client, $this->characters[$info['slotchoosen']]['uid']);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "sendClientLocaleBody"), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "updateCursorColor", "args" => 0), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "enableMapDiffs"), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "playMusic", "args" => 29), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "setWeather", "args" => 16), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "setSeasonal", "args" => 1), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "setLight", "args" => 0), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "updateCursorColor", "args" => 0), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "drawChar"), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "updateStatusBar"), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "drawPlayer"), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "setLight", "args" => 0), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "setWeather", "args" => 16), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "mountSpeed"), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "statusBarInfo"), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "extendedStats"), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "drawPlayer"), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "setWarMode", "args" => 0), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "confirmLogin"), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "setTime"), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "setSeasonal", "args" => 1), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "setLight", "args" => 0), 0.0, true);
         Sockets::addEvent($this->client, array("option" => "player", "method" => "finalPacket"), 0.0, true, true);
     } else {
         $this->disconnect(4);
     }
 }
예제 #2
0
 /**
  * Send to the client the features from server
  */
 public static function packet_0x91($data, $client, $redirected = false)
 {
     $command = $data[0];
     $keyUsed = hexdec($data[1]) . hexdec($data[2]) . hexdec($data[3]) . hexdec($data[4]);
     $account = Functions::hexToChr($data, 5, 34, true);
     $password = Functions::hexToChr($data, 35, 64, true);
     $login = false;
     UltimaPHP::$socketClients[$client]['account'] = new Account($account, md5($password), $client);
     if (true === UltimaPHP::$socketClients[$client]['account']->isValid) {
         UltimaPHP::log("Account {$account} logged from " . UltimaPHP::$socketClients[$client]['ip']);
         // Set the flag on the connection to send next packets compressed
         UltimaPHP::$socketClients[$client]['compressed'] = true;
         Sockets::addEvent($client, array("option" => "account", "method" => "enableLockedFeatures"), 0.0, true);
         Sockets::addEvent($client, array("option" => "account", "method" => "sendCharacterList"), 0.0, true, true);
     } else {
         UltimaPHP::$socketClients[$client]['account']->disconnect(3);
     }
 }