Skip to content

slothbear/constellette

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

constellette

express path

Skip to the HTTPWidget operation section.

prelude

The operation of HTTPWidget described below contains the structure of the request and response from the RSWGame server. You can use these parameters with any other tool that makes HTTP requests. See the list below. Let me know your experience with those or other tools.

introduction

I like to know how many players have not yet submitted orders. If I've already sent in my orders, this number gives me a rough idea of when the next turn might run. If I haven't sent in my orders and the number reaches 1, I know the turn is waiting for me. There's no legal requirement to finish the turn before the due date, but I like the motivation.

HTTPWidget operation

HTTPWidget is a free app that works on iOS, iPadOS, and MacOS. The app can make a request to the RSWGame server, parse the response, and display the result in a widget on your home screen.

  1. Get the app called HTTPWidget: https://apps.apple.com/us/app/httpwidget/id6447097633
  2. Create a new widget and enter the following fields:
    <?xml version='1.0'?>
    <request command='list'>
        <parameter keyword='accountId' value='YourAccountID' />
        <parameter keyword='password' value='YourPassword' />
        <parameter keyword='onlyMine' value='true' />
        <parameter keyword='format' value='xml' />
    </request>
    • in the RESPONSE EXTRACT section
    • Extract by: Regex
    • Regex String:
    gameID="YourGameID".*numWaitingFor="(\d+)"
    

Now tap the Send Request button in the RESPONSE section. If everything worked, the Extracted: line in the RESPONSE EXTRACT section should show the number of players yet to submit orders.

The example response below is abbreviated. The actual response contains more elements and more attributes.

<?xml version="1.0" encoding="utf-8"?>
<response>
  <gameHeader changeSeq="302" gameId="filament1a"
  		involved="True" numWaitingFor="2" state="active" turnNumber="2">
    <playerHeader handle="omega" msgCount="42" numOrders="12" score="222"
    	thisIsMe="True" typeKey="warlord"/>
  </gameHeader>
  <gameHeader changeSeq="111" gameId="graviton8x"
  		involved="True" numWaitingFor="10" state="active" turnNumber="2">
    <playerHeader handle="alpha" msgCount="1" numOrders="5" score="-100"
    	thisIsMe="True" typeKey="collector"/>
  </gameHeader>
</response>

sample HTTPWidgets

HTTPWidget supports several styles of widget supporting a single or multiple results, along with a "trend" showing result history.

single result widget multiple result widget

trend result widget

HTTPWidget notifications

The app supports sending a notification when the result value changes. If there are ten players in the game, you could get notified when the result changes to "10", indicating a new turn is published.

sample notification

other apps

Any application that can send an HTTP request and format the output can use the techniques documented here.

requirements

  • Send a POST request to the RSWGame server.
    • POST is required for sending the user name and password.
  • Parse the XML result.
  • Display the result somewhere useful.
  • Don't spam the server with simultaneous requests.

platforms & applications

The only application I've used is HTTPWidget. I found some others to explore. Let me know if you've had success with any of them, or find other tools.

About

display RSWGame status in widgets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published