Scheduling Cloud Phones
After Accessing Games, you can design and develop a system for scheduling gaming phones. The scheduling system should provide the following functions:
- When receiving a new access request, the system allocates an idle gaming phone to the user and updates the gaming phone status to allocated.
- After a user accesses a game on a gaming phone and the game is started, the system updates the gaming phone status to occupied.
- After a user finishes playing the game and exits the gaming phone, the system updates the gaming phone status to idle.
To sum up, you need to maintain the idle, allocated, and occupied states of gaming phones to allow users to access or exit games.
To help you maintain the gaming phone statuses, the gaming media engine performs authentication and event notification between the gaming phones and your applications when users access the gaming phones, start games, and exit games, so that you can know and maintain the gaming phone statuses.
Use the following APIs:
The following parameters are only examples.
Entering the Game Event
- Example request
{
"event_type": "app",
"event": {
"phone_id": "a7f3a1c5258347d6b6f1def79e11f2bc",
"status": 0,
"session_id": "856f5555806443e98b7ed04c5a9d6a9a",
"ticket": "5558064856f5555806443e98b7ed04c5a9d6a9ab7ed04c5a9d6a806443e98",
"time": "2019-11-14T19:38:49Z",
"app_id": "856f5555806443e98b7ed04c5a9d6a9a",
"error_msg": null
}
} - Example response
{
"request_id": "6837531fd3f54550927b930180a706bf"
} Quitting the Game Event
- Example request
{
"event_type": "app",
"event": {
"phone_id": "a7f3a1c5258347d6b6f1def79e11f2bc",
"status": 1,
"session_id": "856f5555806443e98b7ed04c5a9d6a9a",
"ticket": "5558064856f5555806443e98b7ed04c5a9d6a9ab7ed04c5a9d6a806443e98",
"time": "2019-11-14T19:38:49Z",
"run_time": 41000,
"app_id": "856f5555806443e98b7ed04c5a9d6a9a",
"error_msg": null
}
} - Example response
{
"request_id": "6837531fd3f54550927b930180a706bf"
} Heartbeat Reporting
- Example request
{
"event_type": "heartbeat",
"event": {
"phone_id": "a7f3a1c5258347d6b6f1def79e11f2bc",
"app_id": "282fdfd613e04651a48225f1b2034de7",
"session_id": "36728337b89f22122af4a6e08bb1e7c0",
"time": "2019-11-14T19:38:49Z"
}
} - Example response
{
"request_id": "6837531fd3f54550927b930180a706bf"
} Last Article: Accessing Games
Next Article: Performing O&M for Gaming Phones
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.