AccelByte WebSocket Messaging protocol is a simple messaging protocol focusing on fast object-message conversion on server side and simplicity on the client side. This protocol is subset of YAML data serialization language.
The structure supported by this protocol is string key-value object. The keys and the values are separated by a colon followed by a white space. Objects are separated by newline.
keyA: valueA\n keyB: valueB\n keyC: valueC
Value could be scalar or array. Array elements are enclosed by square brackets and separated by commas. There may be trailing comma at the end of array.
keyA: [valueA1,valueA2,valueAn,]\n keyB: [valueB1,valueB2,valueBn,]
Each message must come with a type object defining the message type.
type: messageType\n keyA: valueA\n keyB: [valueB1,valueB2,valueBn,]
Date-time-based values must be represented by date time ISO-8601 up to second field.
type: messageType\n keyA: valueA\n keyB: [valueB1,valueB2,valueBn,]\n time: 2018-11-09T03:51:18Z
There are 3 types of message on lobby server implementation :
Request message is message from client to server. Request message type should have -Request suffix. Request message must have object id generated by client. Object id must be placed after object type. Each request must be responded by the server with the same object id. Object type must be in the top of any object.
type: fooRequest\n id: 878a0f51bedd4825cf46827fd1478224\n keyA: valueA\n keyB: [valueB1,valueB2,valueBn,]
Response message is message from server to client corresponding to client’s request. Response message type should have -Response suffix. Response object id must correspond with the request. Response must have object code identifying response code. Successful request must be responded with status 0 . Unsuccessful request must be responded with non-0 status code, preferably error event id. When the code is non-0 the other field should be ignored.
type: fooResponse\n id: 878a0f51bedd4825cf46827fd1478224\n code: 0\n keyA: valueA\n keyB: [valueB1,valueB2,valueBn,]
Notification is message send from server to a client without user request. Notification message type should have -Notif suffix.
type: fooNotif\n keyA: valueA\n keyB: [valueB1,valueB2,valueBn,]