Cấu hình đối tượng khởi tạo cục bộ hiển thị trò chơi và thiết lập giao diện người dùng.
{ } clientConfig.js{ } clientConfig.json
Sao chép mã
JavaScript
// Cấu hình tham số hiển thị giao diện cục bộ cho trò chơi ON68
const clientConfig = {
platform: "ON68" ,
selectedCategory: "Nổ hũ" ,
defaultGameId: "098" , // Mermaid Riches
soundEnabled: true ,
locale: "vi-VN" ,
availableGames: [
{ id: "098" , name: "Mermaid Riches" },
{ id: "124" , name: "Totem Wonders" },
{ id: "122" , name: "Wild Bounty Sd" }
]
};
function getInitialGame(config) {
return config.availableGames.find(g => g.id === config.defaultGameId);
}
// Xuất cấu hình kiểm tra cục bộ
console.log("Trò chơi khởi đầu:" , getInitialGame(clientConfig)); JSON
{
"platform" : "ON68" ,
"selectedCategory" : "Nổ hũ" ,
"defaultGameId" : "098" ,
"soundEnabled" : true ,
"locale" : "vi-VN" ,
"availableGames" : [
{
"id" : "098" ,
"name" : "Mermaid Riches"
},
{
"id" : "124" ,
"name" : "Totem Wonders"
},
{
"id" : "122" ,
"name" : "Wild Bounty Sd"
}
]
}