Skip to content
songoo edited this page Aug 17, 2014 · 11 revisions

1. New game json (from server)

{
  "game": {
    "gameId": "00000001",
    "gameStatus": "new",
    "gameMap": {
      "a1":"empty",
      "a2":"empty",
      "a3":"empty",
      "b1":"empty",
      "b2":"empty",
      "b3":"empty",
      "c1":"empty",
      "c2":"empty",
      "c3":"empty"
    },
    "gameSurrounding": {
      "shape":"star",
      "color":"#777",
    },
    "winCombination":{},
    "endGameMessage":{
      "show":false,
      "message":"",
      "messageType":""
    }
  },
  "winnersList": {}
}

2. Selecting firs "O" (by user)

{
  "action": {
    "selectedGameMapSquare": {
      "a1":"O",
    }
  }
}

3. Response from server, selecting "X" for random free map square, with background color change (from server)

{
  "game": {
    "gameId": "00000001",
    "gameStatus": "ongoing",
    "gameMap": {
      "a1":"O",
      "a2":"empty",
      "a3":"empty",
      "b1":"empty",
      "b2":"empty",
      "b3":"empty",
      "c1":"X",
      "c2":"empty",
      "c3":"empty"
    },
    "gameSurrounding": {
      "shape":"star",
      "color":"#222",
    },
    "winCombination":{},
    "endGameMessage":{
      "show":false,
      "message":"",
      "messageType":""
    }
  },
  "winnersList": {}
}

4. Reaching end game state (from server)

{
  "game": {
    "gameId": "00000001",
    "gameStatus": "ongoing",
    "gameMap": {
      "a1":"O",
      "a2":"O",
      "a3":"O",
      "b1":"empty",
      "b2":"empty",
      "b3":"empty",
      "c1":"X",
      "c2":"X",
      "c3":"empty"
    },
    "gameSurrounding": {
      "shape":"star",
      "color":"#444",
    },
    "winCombination":{"b1","b2","b3"},
    "endGameMessage":{
      "show":true,
      "message":"Congratulations you won, you can add +1 point to any desirable nickname even make one own!",
      "messageType":"1"
    }
  },
  "winnersList": {}
}

6. Sending nickname value (By User)

{
  "nickname": "UserNo1",
  "action": "raiseNickPoints",
  "value": "1",
}

6. Sending nickname value (By User)

{
  "nickname": "UserNo1",
  "action": "raiseNickPoints",
  "value": "1",
  "hash": 
}

6b. Response to sent nickname (By Server)

{
  "message": "Nick UserNo1 reached 1 points!"
}

8. New game json example with top players (from server)

{
  "game": {
    "gameId": "00000001",
    "gameStatus": "new",
    "gameMap": {
      "a1":"empty",
      "a2":"empty",
      "a3":"empty",
      "b1":"empty",
      "b2":"empty",
      "b3":"empty",
      "c1":"empty",
      "c2":"empty",
      "c3":"empty"
    },
    "gameSurrounding": {
      "shape":"star",
      "color":"#777",
    },
    "winCombination":{},
    "endGameMessage":{
      "show":false,
      "message":"",
      "messageType":""
    }
  },
  "winnersList": {
      "nickname":{
         "nick":"Luffy",
         "points":"222",
         "place":"1",
      },
      "nickname":{
         "nick":"Zoro",
         "points":"150",
         "place":"2",
      },
      "nickname":{
         "nick":"Pirate Skeleton With..",
         "points":"32",
         "place":"3",
      },
      "nickname":{
         "nick":"Chopper",
         "points":"20",
         "place":"4",
      },
      "nickname":{
         "nick":"Vegeta",
         "points":"17",
         "place":"5",
      },
      "nickname":{
         "nick":"Obito",
         "points":"10",
         "place":"6",
      },
      "nickname":{
         "nick":"UserNo1",
         "points":"1",
         "place":"7",
      },
  }
}
Clone this wiki locally