Skip to content
This repository has been archived by the owner on Nov 12, 2018. It is now read-only.

Make use of state call #31

Closed
eigenein opened this issue Aug 19, 2016 · 2 comments
Closed

Make use of state call #31

eigenein opened this issue Aug 19, 2016 · 2 comments
Assignees

Comments

@eigenein
Copy link
Owner

Looks like state call returns some state that is corresponding to a main call. I can try to use it when I need to refresh resources and buildings. Example:

{
  "date": 1471644485.9929,
  "results": [
    {
      "ident": "group_0_body",
      "result": {
        "buildingId": 1144,
        "reward": {
          "resource": [
            {
              "id": 26,
              "amount": 209
            }
          ]
        },
        "available": {
          "resource": [
            {
              "id": 26,
              "amount": 209
            }
          ]
        }
      }
    },
    {
      "ident": "group_1_body",
      "result": {
        "resource": [
          {
            "id": 1,
            "amount": 2416207
          },
          {
            "id": 2,
            "amount": 15303182
          },
          {
            "id": 5,
            "amount": 28
          },
          {
            "id": 26,
            "amount": 42641
          },
          {
            "id": 4,
            "amount": 41
          },
          {
            "id": 6,
            "amount": 13
          },
          {
            "id": 20,
            "amount": 0
          },
          {
            "id": 3,
            "amount": 13
          },
          {
            "id": 8,
            "amount": 35
          },
          {
            "id": 7,
            "amount": 0
          },
          {
            "id": 9,
            "amount": 34
          },
          {
            "id": 27,
            "amount": 2976
          },
          {
            "id": 29,
            "amount": 172
          },
          {
            "id": 34,
            "amount": 0
          },
          {
            "id": 40,
            "amount": 188
          },
          {
            "id": 38,
            "amount": 0
          },
          {
            "id": 39,
            "amount": 0
          },
          {
            "id": 51,
            "amount": 0
          },
          {
            "id": 21,
            "amount": 50
          },
          {
            "id": 50,
            "amount": 84
          },
          {
            "id": 52,
            "amount": 10
          },
          {
            "id": 57,
            "amount": 0
          },
          {
            "id": 55,
            "amount": 0
          },
          {
            "id": 104,
            "amount": 245
          },
          {
            "id": 59,
            "amount": 3
          },
          {
            "id": 89,
            "amount": 1
          },
          {
            "id": 79,
            "amount": 2
          },
          {
            "id": 69,
            "amount": 2
          },
          {
            "id": 88,
            "amount": 1
          },
          {
            "id": 78,
            "amount": 1
          },
          {
            "id": 68,
            "amount": 2
          },
          {
            "id": 70,
            "amount": 0
          },
          {
            "id": 111,
            "amount": 11
          },
          {
            "id": 41,
            "amount": 0
          },
          {
            "id": 126,
            "amount": 117
          },
          {
            "id": 127,
            "amount": 0
          },
          {
            "id": 123,
            "amount": 0
          },
          {
            "id": 128,
            "amount": 0
          },
          {
            "id": 58,
            "amount": 1
          },
          {
            "id": 131,
            "amount": 132
          },
          {
            "id": 130,
            "amount": 0
          },
          {
            "id": 132,
            "amount": 0
          },
          {
            "id": 145,
            "amount": 23
          },
          {
            "id": 147,
            "amount": 0
          },
          {
            "id": 146,
            "amount": 0
          },
          {
            "id": 80,
            "amount": 1
          },
          {
            "id": 90,
            "amount": 0
          },
          {
            "id": 60,
            "amount": 1
          },
          {
            "id": 153,
            "amount": 298
          },
          {
            "id": 155,
            "amount": 0
          },
          {
            "id": 154,
            "amount": 0
          },
          {
            "id": 156,
            "amount": 0
          },
          {
            "id": 81,
            "amount": 0
          },
          {
            "id": 162,
            "amount": 57
          },
          {
            "id": 164,
            "amount": 0
          },
          {
            "id": 163,
            "amount": 0
          },
          {
            "id": 169,
            "amount": 0
          },
          {
            "id": 161,
            "amount": 141
          },
          {
            "id": 167,
            "amount": 0
          },
          {
            "id": 91,
            "amount": 1
          },
          {
            "id": 172,
            "amount": 0
          },
          {
            "id": 171,
            "amount": 1
          }
        ],
        "buildingChanged": [
          {
            "id": 1144,
            "typeId": 31,
            "flip": false,
            "level": 1,
            "x": 23,
            "y": 21,
            "completed": true,
            "volume": 0,
            "stateTimestamp": 1471644485,
            "hitpoints": 920,
            "disabled": false,
            "speedMultiplier": 1.1000001,
            "boosts": [
              673,
              673
            ],
            "completeTime": 0
          }
        ]
      }
    }
  ]
}
@eigenein eigenein self-assigned this Aug 19, 2016
eigenein added a commit that referenced this issue Aug 19, 2016
eigenein added a commit that referenced this issue Aug 19, 2016
eigenein added a commit that referenced this issue Aug 19, 2016
eigenein added a commit that referenced this issue Aug 20, 2016
eigenein added a commit that referenced this issue Aug 20, 2016
@eigenein
Copy link
Owner Author

eigenein commented Aug 20, 2016

upgradeBuilding

Implement resource update and building update.

{'buildingChanged': [{'completeTime': 1471681564, 'y': 19, 'typeId': 20, 'level': 1, 'hitpoints': 500, 'volume': 0, 'id': 137, 'flip': False, 'processingType': 'build', 'x': 31, 'stateTimestamp': 1468340379, 'disabled': False, 'completed': False}], 'resource': [{'id': 1, 'amount': 161848}, {'id': 2, 'amount': 236489}, {'id': 26, 'amount': 0}, {'id': 7, 'amount': 4}, {'id': 169, 'amount': 0}, {'id': 3, 'amount': 61}, {'id': 5, 'amount': 1}, {'id': 162, 'amount': 12}, {'id': 164, 'amount': 0}, {'id': 4, 'amount': 0}, {'id': 8, 'amount': 5}, {'id': 9, 'amount': 6}, {'id': 50, 'amount': 57}, {'id': 104, 'amount': 171}, {'id': 69, 'amount': 1}, {'id': 59, 'amount': 2}, {'id': 6, 'amount': 1}, {'id': 79, 'amount': 0}, {'id': 70, 'amount': 0}, {'id': 89, 'amount': 1}, {'id': 60, 'amount': 0}, {'id': 78, 'amount': 1}, {'id': 68, 'amount': 1}, {'id': 58, 'amount': 2}, {'id': 88, 'amount': 2}, {'id': 80, 'amount': 0}, {'id': 172, 'amount': 0}]}

eigenein added a commit that referenced this issue Aug 20, 2016
@eigenein
Copy link
Owner Author

startResearch

{'researchQueue': [{'unitId': 2, 'buildingId': 136, 'endTime': 1471789234, 'level': 4}], 'resource': [{'id': 1, 'amount': 297143}, {'id': 2, 'amount': 18092}, {'id': 26, 'amount': 0}, {'id': 169, 'amount': 0}, {'id': 3, 'amount': 60}, {'id': 162, 'amount': 12}, {'id': 164, 'amount': 0}, {'id': 4, 'amount': 2}, {'id': 8, 'amount': 5}, {'id': 5, 'amount': 3}, {'id': 6, 'amount': 2}, {'id': 7, 'amount': 3}, {'id': 9, 'amount': 6}, {'id': 50, 'amount': 84}, {'id': 104, 'amount': 671}, {'id': 88, 'amount': 0}, {'id': 68, 'amount': 4}, {'id': 58, 'amount': 3}, {'id': 89, 'amount': 0}, {'id': 69, 'amount': 0}, {'id': 59, 'amount': 0}, {'id': 90, 'amount': 0}, {'id': 79, 'amount': 0}, {'id': 78, 'amount': 5}, {'id': 171, 'amount': 3}]}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant