xy-server/game/core/Interface.ts

39 lines
894 B
TypeScript
Raw Permalink Normal View History

2025-04-23 09:34:08 +08:00
import DB from "../utils/DB";
import {MsgCode} from "../role/EEnum";
import SKDataUtil from "../gear/SKDataUtil";
/**
*
*/
export default class Interface {
static shared = new Interface();
// 白名单集合
interface_list: any;
constructor() {
this.interface_list = [];
}
init() {
DB.selectInterface((code: any, info: any) => {
if (MsgCode.SUCCESS == code){
this.interface_list = [];
for (const data of info) {
this.interface_list.push(data.map_interface);
}
}
});
}
/**
*
* @param player
*/
getInterfaceData(player: any){
player.send("s2c_whitelist_interface",{list: SKDataUtil.toJson(this.interface_list,"[]")});
}
}