Aldeia RPG

Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Suporte ao desenvolvimento de jogos


2 participantes

    [DÚVIDA] Socket Request

    Curirin107
    Curirin107
    Iniciante
    Iniciante


    Mensagens : 36
    Créditos : 2

    [DÚVIDA] Socket Request Empty [DÚVIDA] Socket Request

    Mensagem por Curirin107 Qui Out 10, 2013 12:58 pm

    Oopa! Eu aqui de novo!
    Bom, por acaso lembram da minha dúvida mortal de Requisição HTTP?
    Pois bem, decidi fazer melhor e fiz em Lua.

    Seguinte:
    - Envia pedido para o servidor
    - Servidor recebe e enviar o conteúdo da página
    * RGSS entende e mostra na tela

    Bom, essa parte (*), eu não to conseguindo fazer (receber o que o socket envia).
    Tentei assim:
    Código:
    module Network
    class Main
      def self.update_admmod(line)
        case line
        when /<88d>(.*)<\/88d>/
          print $1.to_s
        end
      end
    end
    end
    Mas deu fail.
    Ajuda? :3


    _________________
    Make you life, not me life.
    - Delphi Programmer / WebDesigner / Designer Gráfico
    Gauthier99
    Gauthier99
    Iniciante
    Iniciante


    Mensagens : 33
    Créditos : 24

    [DÚVIDA] Socket Request Empty Re: [DÚVIDA] Socket Request

    Mensagem por Gauthier99 Qua Out 23, 2013 11:38 am

    (Sorry I'm French)

    You have to create a socket request in your game like this :
    Add this in the script "[NET] Network" after the others commands.

    Código:
    def messageserver
        @socket.send("<88a>'request'</88a>\n")
    end
    With this little script, the message will be displays on the screen when you call the script "messageserver" (with an event for exemple).

    [DÚVIDA] Socket Request T33e


    EDIT : I've tried your script with my little message, It works fine. May be the mistake is in your lua script.


    _________________
    "My script doesn't work, I don't know why :/
    My script works, I don't know why ._."

    - All great scripters


    My Scripts :
    Curirin107
    Curirin107
    Iniciante
    Iniciante


    Mensagens : 36
    Créditos : 2

    [DÚVIDA] Socket Request Empty Re: [DÚVIDA] Socket Request

    Mensagem por Curirin107 Sex Out 25, 2013 3:27 pm

    It works but...
    my LUA script is Wrong!

    Thank's very much man!

    - Admin pode dar closed


    _________________
    Make you life, not me life.
    - Delphi Programmer / WebDesigner / Designer Gráfico

    Conteúdo patrocinado


    [DÚVIDA] Socket Request Empty Re: [DÚVIDA] Socket Request

    Mensagem por Conteúdo patrocinado


      Data/hora atual: Sex Abr 19, 2024 1:14 am