Resultados 1 a 1 de 1
  1. #1
    Design richard88's Avatar
    Data de Ingresso
    Sep 2015
    Posts
    106
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    2
    Thanked in
    2 Posts
    Mencionado
    24 Post(s)
    MEU HUMOR
    Drunk
    FIle ldgame.class.php From Musite V2
    Código PHP:
    <?php
    new ldLanguagestr_replace(".class."".lang."basename(__FILE__)), false );
    class 
    ldGame extends ldNetwork
    {
        public function 
    disconnectPlayer($account)
        {
            try
            {                            
                if(empty(
    $account) == true || strlen($account) > 10)
                    throw new 
    Exception(GAME_INCORRENCT_LOGIN);
                
                
    $this->openConnection();
                
                
    $this->sendPacket("\xC1\x13\xA0\x00\x00\x00\x00\x00".str_pad($account10"\x00")."\x00");

                
    $this->getResponse();
                
    $tmpResponse $this->printResponse(falsetrue);
                
    $tmpResponse hexdec(substr($tmpResponse162));
                if(
    $tmpResponse == 1)
                {
                    
    sleep(1);
                    
    $this->sendPacket("\xC1\x13\xA0\x00\x00\x00\x00\x00".str_pad($account10"\x00")."\x00");
                    
    sleep(1);
                    
    $this->sendPacket("\xC1\x13\xA0\x00\x00\x00\x00\x00".str_pad($account10"\x00")."\x00");
                    
    sleep(1);
                    
    $this->sendPacket("\xC1\x13\xA0\x00\x00\x00\x00\x00".str_pad($account10"\x00")."\x00"); 
                    throw new 
    Exception(GAME_SUCCESS_DISCONNECT." ".$account);
                }
                else
                    throw new 
    Exception(GAME_ERROR_DISCONNECT);
            } 
            catch ( 
    Exception $msg 
            {
                return 
    $msg->getMessage();
            }
        }
        
        public function 
    sendMessageToAll($message)
        {
            try
            {                            
                if(empty(
    $message) == true || strlen($message) > 60)
                    throw new 
    Exception(GAME_MSG_INVALID);
                
                
    $this->openConnection();
                                                                                                                                     
                
    $this->sendPacket("\xC1\x45\xA1\x00\x00\x00\x00\x00".str_pad($message60"\x00")."\x00");

                
    $this->getResponse();
                
    $tmpResponse $this->printResponse(truetrue);          
                
    $tmpResponse substr($tmpResponse3strlen($message)); 
                if(
    $tmpResponse == $message)
                    throw new 
    Exception(true);
            } 
            catch ( 
    Exception $msg 
            {
                return 
    $msg->getMessage();
            }
        }
        
        public function 
    sendMessage($account$message)
        {
            try
            {                            
                if(empty(
    $account) == true || strlen($account) > 10)
                    throw new 
    Exception(GAME_INCORRENCT_LOGIN);
                
                if(empty(
    $message) == true || strlen($message) > 60)
                    throw new 
    Exception(GAME_MSG_INVALID);
                
                
    $this->openConnection();
                                                                                                                                     
                
    $this->sendPacket("\xC1\x4F\xA2\x00\x00\x00\x00\x00".str_pad($message60"\x00")."".str_pad($account10"\x00")."\x00");

                
    $this->getResponse();
                
    /*$tmpResponse = $this->printResponse(false, false);          
                $tmpResponse = substr($tmpResponse, 3, strlen($message)); 
                if($tmpResponse == $message) */
                    
    throw new Exception(true); 
            } 
            catch ( 
    Exception $msg 
            {
                return 
    $msg->getMessage();
            }
        }
    }

    /*$joinserver = new joinserver("season2.mudkt.com.br", "55970"); 
    $joinserver->sendMessageToAll("Atenção: Esta mensagem de teste foi enviada pelo site!");
    echo "<br><br>";
    $joinserver->sendMessage("daldegam", "Atenção: Esta mensagem foi enviada pelo site!");
    echo "<br><br>"; 
    $joinserver->disconnectPlayer("daldegam");
     */
    ?>
    Invalid Packets edit Line:
    $this->sendPacket("\xC1\x13\xA0\x00\x00\x00\x00\x00".str _pad($account, 10, "\x00")."\x00");

    Real Packet From WebCore X-team
    Código PHP:
    <?php
    namespace Game\Protocol
    {
        require_once(
    __DIR__.'/SocketServer.php');

        class 
    JoinServer extends SocketServer
        
    {
            protected 
    $address '192.99.111.80';

            protected 
    $port 55970;
        
            public function 
    WJServerInfo($name$code$port)
            {
                return 
    $this->send([
                    
    Data::head(Head::SetB0x0055),
                    
    Data::byte(0),
                    
    Data::word($port),
                    
    Data::char($name50),
                    
    Data::word($code)
                ]);
            }

            public function 
    WJDisconnectAccount($account)
            {
                return 
    $this->send([
                    
    Data::head(Head::SetB0x3011),
                    
    Data::char($account11)
                ]);
            }
        }
    }
    Código PHP:
    <?php
        
    class SocketServer
        
    {
            private 
    $socket null;

            private 
    $state false;

            public function 
    connect()
            {
                if(
    $this->state == true)
                {
                    return 
    true;
                }

                if(!
    $this->socket socket_create(AF_INETSOCK_STREAMSOL_TCP))
                {
                    return 
    $this->state false;
                }

                if(@
    socket_connect($this->socket$this->address$this->port))
                {
                    return 
    $this->state true;
                }

                return 
    $this->state false;
            }

            public function 
    disconnect()
            {
                @
    socket_close($this->socket);

                
    $this->state false;

                
    $this->socket null;
            }

            public function 
    setInfo($address$port)
            {
                
    $this->address $address;

                
    $this->port $port;
            }

            public function 
    send($data$autoclose true)
            {
                if(!
    $this->state && !$this->connect())
                {
                    return 
    false;
                }

                
    $data $this->parse($data$type false);

                if(@
    socket_write($this->socket$datastrlen($data)))
                {
                    return 
    true;
                }

                if(
    $autoclose)
                {
                    
    $this->disconnect();
                }

                return 
    false;
            }

            public function 
    recv($autoclose true)
            {
                if(!
    $this->state && !$this->connect())
                {
                    return 
    false;
                }

                
    $buffer '';

                while(@
    socket_recv($this->socket$data1024) != 0)
                {
                    
    $buffer .= $data;
                }

                if(
    $autoclose)
                {
                    
    $this->disconnect();
                }

                return 
    $buffer;
            }

            public function 
    parse($argument)
            {
                
    $data = [];

                
    $result '';

                foreach(
    $argument as $key => $value)
                {
                    foreach(
    $value as $subkey => $subvalue)
                    {
                        
    $data[] = $subvalue;
                    }
                }

                if(
    $data[0] == 0xC2)
                {
                    
    $size count($data);
                    
    $data[1] = $size >> 8;
                    
    $data[2] = $size 0xFF;
                }
                else
                {
                    
    $data[1] = count($data);
                }

                foreach(
    $data as $key => $value)
                {
                    
    $result .= sprintf('%02X'$value);
                }

                
    $output '';

                for(
    $i=0$i<strlen($result); $i+=2)
                {
                    
    $output .= chr(hexdec(substr($result$i2)));
                }

                return 
    $output;
            }
        }

        class 
    Data
        
    {
            public static function 
    head($type$head$subhead 0)
            {
                switch(
    $type)
                {
                    case 
    Head::SetB:
                        
    $result = [0xC10$head];
                        break;
                    case 
    Head::SetBE:
                        
    $result = [0xC30$head];
                        break;
                    case 
    Head::SetSubB:
                        
    $result = [0xC10$head$subhead];
                        break;
                    case 
    Head::SetSubBE:
                        
    $result = [0xC30$head$subhead];
                        break;
                    case 
    Head::SetW:
                        
    $result = [0xC200$head];
                        break;
                    case 
    Head::SetSubW:
                        
    $result = [0xC200$head$subhead];
                        break;
                }

                return 
    $result;
            }

            public static function 
    char($input$length)
            {
                
    $result = [];

                for(
    $i=0$i<strlen($input); $i++)
                { 
                    
    $result[] = ord($input[$i]);
                }

                for(
    $i=strlen($input); $i<$length$i++)
                { 
                    
    $result[] = 0x00;
                }

                return 
    $result;
            }

            public static function 
    byte($input)
            {
                
    $input pack('C'$input);

                
    $input unpack('C'$input);

                return [
    sprintf('%02X'$input)];
            }

            public static function 
    word($input)
            {
                
    $input pack('S'$input);

                
    $input unpack('S'$input);

                return [
    $input 0xFF$input >> 8];
            }

            public static function 
    dword($input)
            {
                
    $input pack('I'$input);

                
    $input unpack('I'$input);

                return [
    $input 0xFF, ($input >> 8) & 0xFF, ($input >> 16) & 0xFF, ($input >> 24) & 0xFF];
            }
        }

        abstract class 
    Head
        
    {
            const 
    SetB 0;
            const 
    SetBE 1;
            const 
    SetSubB 2;
            const 
    SetSubBE 3;
            const 
    SetW 4;
            const 
    SetSubW 5;
        }

    ?>
    You need transform script to Musitev2 correct Packet


    Update:
    Type: 0xC1 Header: 0x30 Struct: char Account[11]
    Last edited by richard88; 03/06/2016 at 02:08 PM.

Permissões de Postagem

  • Você não pode iniciar novos tópicos
  • You may not post Resposta(s)
  • Você não pode enviar anexos
  • Você não pode editar suas mensagens
  •  
Sobre nós
Somos uma comunidade em atividade a 8 anos que aborda assuntos relacionados a games em geral, principalmente games MMORPG. e que busca sempre ajudar os membros através de conteúdos, tutoriais e suporte...
Nossos anunciantes
Hinetworks
VelozHost
InovHost
Rede Sociais