32. Game operation part 2: Server maintenance messages¶
Users connected to the server at the beginning of a server maintenance period are automatically notified, and all other packets sent by clients are ignored.
32.1. Server maintenance message settings¶
32.1.1. (Method 1) Static method using MANIFEST.json¶
You can restart the server with the following settings.
32.1.1.1. MANIFEST.json settings¶
Add a MaintenanceService
session to MANIFEST.json as follows.
1 2 3 4 5 6 7 8 9 | {
"dependency": {
...
"MaintenanceService": {
"under_maintenance": true,
"maintenance_data_path": "/path/to/maintenance.json"
}
}
}
|
Note
/path/to/mintenance.json
represents the maintenance.json file path in the example above.
32.1.1.2. maintenance.json settings¶
Create a json file with date_start
, date_end
, and messages
input as follows.
1 2 3 4 5 | {
"date_start": "2015/09/23 04:00", // start time
"date_end": "2015/09/23 08:00", // end time
"messages": "The state of being maintained." // message for the client.
}
|
Important
You cannot add items other than date_start
date_end
messages
to maintenance.json.
32.1.2. (Method 2) Dynamic method set while server is running¶
Change server maintenance status and message without restarting the server using the API provided in the following component.
-
PUT
/v1/maintenance/update
¶ - Request JSON Object
date_start (string) – (required) “2015/09/23 04:00” form
date_end (string) – (required) “2015/09/23 08:00” form
messages (string) – (required) message sent to client
under_maintenance (bool) – (optional) Use to turn this feature on or off
- Status Codes
200 OK – success
400 Bad Request – failure. If the request body is not json or the field type is different
Note
See Server management part 1: Adding RESTful APIs for the API service port.
32.2. Server maintenance message client code¶
Please refer to the distributed client plugin tester code for a client example. For more details, see Plugin server maintenance messages.