How do I GET 512 long frame from HTTP server

0 favourites
  • 1 posts
From the Asset Store
Selection frame like in RTS games, works both on mobile and desktop devices.
  • Hi!

    I have a project, that takes one games information (telemetry data) that comes trough third party "Telemetry server" program, that opens datastream at localhost:19000. The protocol used is HTTP-GET and the data getting in python my Communications Software does this using this :

        
    try:
        telemetry_server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        telemetry_server.connect(('127.0.0.1', 19000))              # Setting TCP/IP connection to telemetry server
    except socket.error, v:
        errorcode=v[0]
        if errorcode==errno.ECONNREFUSED:
            print "Connection refused."
            print "Please start ETS2 Telemetry server before you launch this app."
    
    <CODE exluded, nothing to do with subject>
    
    while 1:
    
        frame = telemetry_server.recv(512)                      # Receiving frame of data
    
        data = frame.split('#')
        telemetry = data[0].split('|')
        indicators=data[2]
    
        if len(telemetry) == 16:                                # To be sure that data is complete ("Index out of range" error may appear sometimes without it, that's the simplest walkaround)
    
    <Serial port communication exluded>
    
    [/code:12rshews]
    
    

    So. The problem is now, i would like to implement the code to browser window at first so user can see data on browser (using the all might Construct 2 graphics!) and afterwards id like to make it ask user for IP where to get data on Local Area Network, so user could use example their mobile device, or tablet to see telemetry data like how their truck is doing (Speed, fuel quantity etc).

    Take a look at:

    http://www.edltech.org/telemetry.htm

    FAQ:

    1.

    Q: Why not continue using python?

    A: The problem is , that i want multiplatform, easy to use app for everyone! Current serial port streamer is easy to use, but need hardware to show data.

    2.

    Q: What game is this?

    A: Its Euro Truck Simulator 2 from SCS-Software.

    3.

    Q: Where to download these server files?

    A: From same page where you can see how the datastream is coming to my Serial streamer.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)