GithubHelp home page GithubHelp logo

Comments (4)

adamscybot avatar adamscybot commented on September 7, 2024 1

I've been battling similar problems and think I can offer some help. Firstly, your "non response" problem, I believe you need to bump the value key on the game_event each time to prevent the device caching. In your example, you are missing the value key as a sibling to the frame key. I think this is supposed to be a unique integer each time.

POST http://127.0.0.1:49391/game_event HTTP/1.1
Content-Type: application/json

{  
    "game": "TS3TOSSE3",
    "event": "POKE_MESSAGE",
    "data": {
      "value": 1, // make this increase each time you want to update
      "frame": {
         "custom-text": "test test 12345564556789"
      }
   }
}

I've also come across the problem of needing scrolling text. I first tried to force a new line (why does it only show 1 line in the centre?! Argh!!) but was unable to even inserting carriage returns in the JSON string.

I was able to get a scrolling affect by hitting the endpoint a lot bumping the aforementioned value integer each time, and manually manipulating the text by cutting off the first character each time.

Another way is to abuse the suffix key when you register the event, and then use the repeat feature. This is probably closer to a final solution, since you first bind the event (I think this sends the frames to the device beforehand) then we "play" them by sending the event.

POST http://127.0.0.1:49391/bind_game_event HTTP/1.1
Content-Type: application/json

{
   "game": "TS3TOSSE3",
   "event": "POKE_MESSAGE",
   "handlers": [
      {
         "device-type": "screened",
         "mode": "screen",
         "zone": "one",
         "datas": [
         {
            "has-text": true,
            "suffix": "I am a long piece of text",
            "length-millis": 200
         },
            {
            "has-text": true,
            "suffix": " am a long piece of text",
            "length-millis": 200
         },
            {
            "has-text": true,
            "suffix": "am a long piece of text",
            "length-millis": 200
         },
            {
            "has-text": true,
            "suffix": "m a long piece of text",
            "length-millis": 200
         },
            {
            "has-text": true,
            "suffix": " a long piece of text",
            "length-millis": 200
         },
            {
            "has-text": true,
               "suffix": "a long piece of text",
            "length-millis": 200
         },
            {
            "has-text": true,
            "suffix": " long piece of text",
            "length-millis": 200
         },
         {
            "has-text": true,
            "suffix": "long piece of text",
            "length-millis": 200,
            "repeats": true
         }
         ]
      }
   ]
}

It's hacky, but you can obviously build an abstraction on top of this. Still though, no way to wrap text as far as a I can see. For that reason, I'm probably going to generate and send my own bitmaps...

from gamesense-sdk.

szabolcs-dekany92 avatar szabolcs-dekany92 commented on September 7, 2024 1

Hey @adamscybot !
Thanks for the awesome responses. I'll be sure to tinker around with these during the weekend! Cheers

from gamesense-sdk.

szabolcs-dekany92 avatar szabolcs-dekany92 commented on September 7, 2024

Update: After removing the app from SSE3 and re-registering it, It just refuses to work. The message gets sent, the response is there, but nothing happens.

from gamesense-sdk.

adamscybot avatar adamscybot commented on September 7, 2024

I found some more tricks :). After looking into the DB that backs the game engine, I can see there are some undocumented features we can use. You can split text on multiple lines like so:

POST http://127.0.0.1:50035/bind_game_event HTTP/1.1
Content-Type: application/json

{
   "game": "TEST",
   "event": "DISPLAY",
   "icon_id": 16,
   "handlers": [
      {"device-type": "screened",
         "mode": "screen",
         "zone": "one",
         "datas": [
            {
               "length-millis": 5000,
               "lines": [
                  {
                     "has-text": true,
                     "context-frame-key": "line1",
                     "bold": true
                  },
                  {
                     "has-text": true,
                     "context-frame-key": "line2"
                  },
                  {
                     "has-text": true,
                     "context-frame-key": "line3"
                  }
               ]
            }
         ]
      }
   ]
}

Then send the event like so:


POST http://127.0.0.1:50035/game_event HTTP/1.1
Content-Type: application/json

{  
    "game": "TEST",
    "event": "DISPLAY",
    "data": {
      "value": 1,
      "frame": {
         "line1": "test1",
         "line2": "test2",
         "line3": "test3"
      }
   }
}

from gamesense-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.