Skip to content

Latest commit

 

History

History
127 lines (118 loc) · 1.54 KB

examples.md

File metadata and controls

127 lines (118 loc) · 1.54 KB

WebSocket - App

Request

Searching start

{
  "operation": 0,
  "body": {
    "profile": {
      "username": "basic",
      "contact": "@basic",
      "language": 1
    }
  }
}

Sync Response

Searching start

{
  "operation": 0,
  "body": {}
}

Async Response

Searching game found

{
  "operation": 2,
  "body": {
    "foundGameData": {
      "chattingStageDuration": 300000,
      "chattingTopic": "Board games",
      "choosingStageDuration": 30000,
      "localProfileId": 1,
      "profilePublicList": [
        {
          "id": 0,
          "username": "Major"
        },
        {
          "id": 1,
          "username": "Minor"
        }
      ],
      "startSessionTime": 1690309190
    }
  }
}

Request

Searching stop

{
  "operation": 1
}

Request

Chatting new message

{
  "operation": 3,
  "body": {
    "message": {
      "text": "Hello!"
    }
  }
}

Async Response

Chatting new message

{
  "operation": 3,
  "body": {
    "message": {
      "senderId": 1,
      "text": "123"
    }
  }
}

Async Response

Chatting stage is over

{
  "operation": 4,
  "body": {}
}

Request

Choosing users chosen

{
  "operation": 5,
  "body": {
    "userIdList": [
      1,
      2,
      3
    ]
  }
}

Async Response

Choosing users chosen

{
  "operation": 6,
  "body": {
    "matchedUsers": [
      {
        "id": 1,
        "contact": "@major"
      }
    ]
  }
}