OrionPyro's Recent Forum Activity

  • When i try simple node.js server everything works fine, so I don't believe that "Send" action does not work correctly.

    Also, when I try your server, i get same behavior as you, except when I close the browser I get the following message:

              

    UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 0: ordinal not in range(128)

    then i tried bunch of different examples i found on the web, the best one (which nicely prints all the messages received, but still doesen't work) is here:

    http://stackoverflow.com/questions/2153294/python-example-of-joes-erlang-websocket-example

    so, i believe your current server isn't doing the whole connection/handshake thing properly, and the client and server don't actually connect, although they exchange handshakes.

    (this is interesting read: https://github.com/learnboost/socket.io-spec)

    i would try this:

    http://autobahn.ws/python

    or this:

    https://github.com/Lawouach/WebSocket-for-Python

    or this:

    http://code.google.com/p/pywebsocket/

    and more info here:

    http://en.wikipedia.org/wiki/Comparison_of_WebSocket_implementations

    I use Python 3.2, that's why I do not use these libraries.

    Anyway I'm going to try out this websocket example, and reading more about handshaking.

  • Not sure about this, sounds like some server side problem, but need more info. i really dont understand the socket is still receiving part.ell, it means that the server-side socket is still waiting for data at this line :

    tmp = client.recv(128).decode()

    But I guess that the "Send" action does not work correctly, since the server-side socket can't receive anything after the handshake. Also, I tried with a regular Python client in order to test, it works well.

    Looks like you didn't handle what happens when a client disconnects, so your server stays in a loop (because of while True:), and goes to else part, prints "waiting for data", Data received : ",tmp,

    but tmp is empty.

    I think you should end while loop when a client disconnects.

    owever, socket is still in blocking-mode, whatever, it does not seem to be the main problem (I will add thing to manage disconnecting btw)

  • Hi, I have some issues with your modified Socket-IO plugin, the "Send" action and some conditions (such as "on connect") do not seem to work.

    I currently use a quick Python server like this :

    import socket
    import sys
    
    PORT = 9999
    
    handshake = '''
    HTTP/1.1 101 Web Socket Protocol Handshake\r\n\  
    Upgrade: WebSocket\r\n\  
    Connection: Upgrade\r\n\  
    WebSocket-Origin: http://localhost:50000\r\n\  
    WebSocket-Location: ws://localhost:'''+str(PORT)+'''/\r\n\r\n'''  
    handshakeDone = False
    data = "" 
    header = ""
    
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)  
    sock.bind(("", PORT))  
    sock.listen(5)
    print("Listening on port", PORT)
    
    print("Accepting...")
    client, address = sock.accept()
    print("Client connected.")
    while True:  
        if not handshakeDone:  
            header += client.recv(16).decode()
            if header.find('\r\n\r\n') != -1:
                data = header.split('\r\n\r\n', 1)[1]  
                handshakeDone = True
                print("Handshake Done !")
                client.send(handshake.encode())
                print("Handshake sent back to client.")
        else:
                print("Waiting for data...")
                tmp = client.recv(128).decode()
                print("Data received : ",tmp)
                data += tmp;
    
                validated = []  
      
                msgs = data.split('\xff')  
                data = msgs.pop()  
      
                for msg in msgs:  
                    if msg[0] == '\x00':  
                        validated.append(msg[1:])  
      
                for v in validated:  
                    print(v)  
                    client.send('\x00' + v + '\xff'.encode())
    

    And some events like this (I verified names and conditions etc...)

    <img src="http://i.imgur.com/9Vlro.png" border="0" />

    I can successfully connect to my server (however, the "OnConnect" event does not trigger). But whenever I try to send data to my server, nothing happens on serverside (the socket is still receiving). And when I close the browser I test my layout in, the Python Console gets full of :

    Waiting for data...
    Data received :
    
    Waiting for data...
    Data received :
    
    Waiting for data...
    Data received :
    
    Waiting for data...
    Data received :
    
    Waiting for data...
    Data received :
    
    Waiting for data...
    Data received :
    
    etc...

    Any clues to get this problems solved ?

    Thanks.

  • It's been some time since this bug has been reported.

    OrionPyro: first, be sure to update your graphic card drivers.

    This often solved the problem in the first place.

    Thanks, it works now :D

  • Hello.

    I have a problem, that s quite annoying and seems to be a bug.

    When i add a Sprite object on layout, I chose my texture pic etc, it becomes transparent in the layout editor.

    However, it shows correctly when previewing in a browser.

    Here is a picture to show you the problem :

    <img src="http://i.imgur.com/jPyyA.png" border="0" />

    So I ask you if it is a bug or not, and if it's one, please fix it :D

    Thanks :).

    More informations :

    System : Windows Vista 32 Bits Premium Edition

    CPU : Intel Dual Core (Centrino 2) 2 GHz

    Memory : 3 Go RAM

    Video : ATI Radeon HD3650

    Color of the sky : blue

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It's actually David's, just checked it.

    Anyway I guess I gotta read dev forum's topics in order to get how it works :)

  • I actually don't know anything about SDK, I just try to read C++ code (roughly). The only thing I'd like to know is "how it works" at middle-level.

    So yes, if you can explain it to me, i don't deny :)

  • Bump.

  • I just wanted to know how it works. Why don't developper release the source code of this since the Construct's one is ?

  • Hi huys !

    I'm Orion-Pyro and I'm looking for the source code of the "Object Pairer" plugin. But unfortunately I couldn't find it in Construct's sources.

    So here are my questions :

    • Is this plugin Open-Source ?
    • If yes, where can I find it ?

    I'm very interrested by this plugin, I hope you guys will reply soon.

    Thanks :) !

OrionPyro's avatar

OrionPyro

Member since 25 Jul, 2011

Twitter
OrionPyro has 1 followers

Trophy Case

  • 13-Year Club
  • x8
    Coach One of your tutorials has over 1,000 readers
  • x2
    Educator One of your tutorials has over 10,000 readers

Progress

15/44
How to earn trophies