Guest User

Untitled

a guest
Jul 20th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. public function send_MUS($command,$data)
  2. {
  3.     if($this->mus_Enabled())
  4.     {
  5.         $data       = $command . chr(1) . $data;
  6.         $sock = socket_create(AF_INET, SOCK_STREAM, getprotobyname('tcp'));
  7.             socket_connect($sock, parent::system_Settings('client_ip'), parent::system_Settings('client_mus_port'));
  8.         if(!is_resource($sock))
  9.         {
  10.             socket_close($sock);
  11.             die(parent::error_Handler('MUS Packet','HabbluxCMS was unable to send packets the server. Usually this happens when the server is down or the CMS is configured incorrectly.'));
  12.             return false;
  13.         }
  14.             else
  15.         {
  16.             socket_send($sock, $data, strlen($data), MSG_DONTROUTE);
  17.             socket_close($sock);
  18.             return true;
  19.         }
  20.     }
  21. }
Add Comment
Please, Sign In to add comment