Character pictures are kept in characters/ next to the settings, with an index.json of when the server last changed each one and when it was downloaded. Only new or changed pictures are downloaded, using the server's new /character/details. Older servers fall back to the name list, and pictures are downloaded again after 7 days. Downloaded songs are written to songs/ and only their paths are kept in memory. The folder is emptied when the game starts and when the playlist resets.
27 lines
842 B
GDScript
27 lines
842 B
GDScript
# Generated by tools/generate_api_types.gd from server/openapi.json.
|
|
# Do not edit; change the server and generate again.
|
|
class_name CharacterDetails
|
|
extends RefCounted
|
|
## The [code]CharacterDetails[/code] schema of the MusicServer API.
|
|
|
|
## When the image was last changed, in Unix seconds
|
|
var modified: int
|
|
## File name of the character image
|
|
var name: String
|
|
|
|
|
|
## Reads the fields from parsed JSON. Missing fields keep their defaults.
|
|
static func from_dict(data: Dictionary) -> CharacterDetails:
|
|
var result: CharacterDetails = CharacterDetails.new()
|
|
result.modified = ApiJson.get_int(data, "modified", 0)
|
|
result.name = ApiJson.get_string(data, "name", "")
|
|
return result
|
|
|
|
|
|
## Returns the fields under their JSON names, ready for [method JSON.stringify].
|
|
func to_dict() -> Dictionary:
|
|
return {
|
|
"modified": modified,
|
|
"name": name,
|
|
}
|