Node I/O application. 0.1.0

Servers

us-central.japong.yuji.page ws

us-central JaPong node.

asia-northeast.japong.yuji.page ws

asia-northeast JaPong node.

Operations

Pub joinRoom

Send a request to join a room.

Accepts the following message:

JoinRoom

Payload
object
roomNo
integer
playerName
string

Additional properties are allowed.

Examples

JoinRoom
Payload
{
  "roomNo": 4,
  "playerName": "Kevin"
}
This example has been generated automatically.

Pub commandDict

Send player inputs to the server.

Accepts the following message:

CommandDictionary

Payload
object
UP
boolean
DOWN
boolean
LEFT
boolean
RIGHT
boolean
ENTER
boolean
MOVE
boolean

Additional properties are allowed.

Examples

CommandDictionary
Payload
{
  "UP": false,
  "DOWN": false,
  "LEFT": true,
  "RIGHT": true,
  "ENTER": false,
  "MOVE": false
}
This example has been generated automatically.

Sub board

Get the latest game status from the server.

Accepts the following message:

Board

Payload
object
drawables
array<object>
x
integer
y
integer
w
integer
h
integer

Additional items are allowed.

scores
array<integer>

Items:

0
integer

Additional items are allowed.

Additional properties are allowed.

Examples

Board
Payload
{
  "drawables": [
    {
      "x": 30,
      "y": 10,
      "w": 100,
      "h": 20
    },
    {
      "x": 55,
      "y": 100,
      "w": 5,
      "h": 5
    },
    {
      "x": 40,
      "y": 230,
      "w": 100,
      "h": 20
    }
  ],
  "scores": [
    1,
    2
  ]
}
This example has been generated automatically.

Sub gameOver

Get notified when the game is over.

Accepts the following message:

GameOver

Payload
object
scores
array<integer>

Items:

0
integer

Additional items are allowed.

Additional properties are allowed.

Examples

GameOver
Payload
{
  "scores": [
    3,
    2
  ]
}
This example has been generated automatically.

Sub joinedRoom

Get notified about if you successfully joined a room.

Accepts the following message:

JoinedRoom

Payload
object
roomNo
integer
playerId
integer
playerName
string

Additional properties are allowed.

Examples

JoinedRoom
Payload
{
  "roomNo": 2,
  "playerId": 0,
  "playerName": "Kevin"
}
This example has been generated automatically.

Sub opponentLeft

Get notified when your opponent left.

Accepts the following message:

OpponentLeft

Payload
object

Additional properties are allowed.

Examples

OpponentLeft
Payload
{}
This example has been generated automatically.

Sub countDown

Get the seconds until the game starts.

Accepts the following message:

CountDown

Payload
integer

Examples

CountDown
Payload
1
This example has been generated automatically.

Messages

#1 JoinRoom

Payload
object
roomNo
integer
playerName
string

Additional properties are allowed.

#2 CommandDictionary

Payload
object
UP
boolean
DOWN
boolean
LEFT
boolean
RIGHT
boolean
ENTER
boolean
MOVE
boolean

Additional properties are allowed.

#3 Board

Payload
object
drawables
array<object>
x
integer
y
integer
w
integer
h
integer

Additional items are allowed.

scores
array<integer>

Items:

0
integer

Additional items are allowed.

Additional properties are allowed.

#4 GameOver

Payload
object
scores
array<integer>

Items:

0
integer

Additional items are allowed.

Additional properties are allowed.

#5 JoinedRoom

Payload
object
roomNo
integer
playerId
integer
playerName
string

Additional properties are allowed.

#6 OpponentLeft

Payload
object

Additional properties are allowed.

#7 CountDown

Payload
integer