消消方块阵换皮表情
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

216 lines
7.1 KiB

declare namespace ZYSDK {
class ZYSDK {
/**
* 初始化sdk
* gid: 游戏gid
* invitecode: 邀请码,表示该玩家是通过该邀请码邀请过来的
*/
static initSdk(gid?:string, invitecode?:string);
/**
*
* @param isFinish 视频是否播完
*/
static reportVideo(isFinish: boolean);
/**
*
* @param action 用户行为
*/
static reportUserAction(action: string);
/**
* 上报游戏内打点数据,用于投放优化
* @param task 任务、关卡等,由游戏自定义
* @param action 玩家游戏内行为,如点击开始按钮,进入某某场景,成功通关,等游戏内的一些操作,由游戏自定义
* @param isAD 本次行为是否是广告行为,true:是广告;false:非广告
*/
static reportUserAction2(task: string, action: string, isAD: boolean);
/**
*
* 获取关卡顺序
*/
static getLevel();
/**
*
* 获取userid
*/
static getUserId();
/**
* 用户订阅消息后通知后台
*/
static subscribe(templateid);
/**
* 是否是广告玩家,只有玩家首次通过广告点击进入游戏时有效
*/
static isAdUser();
/**
* 玩家首次登录场景,0: 自然流量; 1: 广告投放
*/
static getScenes();
/**
* 获取玩家游戏数据
*/
static getGameData(onSuccess: Function, onFail: Function);
/**
* 保存玩家游戏数据
* level: 玩家关卡进度, 可传""
* tm: 玩家总时长, 可传0
* attr1: 玩家属性1, 可传""
* attr2: 玩家属性2, 可传""
* attr3: 玩家属性3, 可传""
*
*/
static setGameData(gamedata:string, level:string, tm:number, attr1:string, attr2:string, attr3:string, onSuccess: Function, onFail: Function);
/**
*
* 获取内购道具列表
* 回调函数定义: onCallback(goodslist, msg)
* goodslist: 道具列表,获取失败则是null
* msg: 失败原因
*/
static getGoodsList(onCallback: Function);
/**
*
* 确认订单
* 回调函数定义: onCallback(status, msg)
* status: 订单状态, 1 确认订单,0 订单错误
* msg: 错误原因
*/
static confirmOrder(orderid:string, onCallback: Function);
/**
* 获取游戏配置
*/
static getGameConfig(configname:string, onSuccess: Function, onFail: Function);
/**
* 0 正常,1 增加频次
*/
static getAdLevel();
/**
* 间隔值
*/
static getAdInterval();
/**
* 自定义值
*/
static getCustomValue();
/**
* 获取玩家激活日期
* 返回值日期字符串,格式如:"2025-11-09"
*/
static getActiveDate();
/**
* 获取unix时间戳
*/
static getTimestamp(onSuccess: Function, onFail: Function);
/**
* 设置排行数据
* score: 分数
* category: 排行榜类型
* imgurl: 头像url
* nickname: 昵称
* region: 地区
* expiredate: 指定玩家退出榜单日期,如:2026-01-07, 表示 2026-01-07 23:59:59 退出榜单;
* "" 表示不指定退出榜单时间
* rankingtype: 排行榜类型
* 1: 永久榜
* 2: 日榜
*/
static setRankingData(score:number, category:string, imgurl:string, nickname:string, region:string, expiredate:string, rankingtype:number);
/**
* 获取排行榜数据
* category: 排行榜类型
* topcnt: 取排行榜前topcnt玩家
* preset: 预设值:
* yestoday: 昨天
* today: 今天
* rankingtype: 排行榜类型
* 1: 永久榜
* 2: 日榜
*/
static getRankingList(category:string, topcnt:number, preset:string, rankingtype:number, onSuccess: Function, onFail: Function);
/**
* 为玩家点赞
* userid: 被赞玩家的userid,即玩家的openid
* onSuccess(param) : param 为json对象:格式如下:
* {
* "zan_cnt": 0,
* "invite_cnt": 0,
* "invite_comsume_cnt": 0
* }
*/
static zanUser(userid:string, onSuccess: Function, onFail: Function);
/**
* 消耗邀请次数
* cnt: 消耗次数
* onSuccess(param) : param 为json对象:格式如下:
* {
* "zan_cnt": 0,
* "invite_cnt": 0,
* "invite_comsume_cnt": 0
* }
*/
static consumeInviteCount(cnt:number, onSuccess: Function, onFail: Function);
/**
* 设置成功邀请状态
* * onSuccess(param) : param 为json对象:格式如下:
* {
* }
*/
static setInviteSuccess(onSuccess: Function, onFail: Function);
/**
* 获取玩家属性数据, 如点赞数据,邀请数据等
* userid: 获取属性数据的玩家
* onSuccess(param) : param 为json对象:格式如下:
* {
* "zan_cnt": 0,
* "invite_cnt": 0,
* "invite_comsume_cnt": 0
* }
*/
static getUserAttribute(userid:string, onSuccess: Function, onFail: Function);
/**
* 解密数据
*/
static decryptWithKey(data: string, deckey: string);
/**
* 加密数据
*/
static encryptWithKey(data: string, deckey: string);
/**
* base64解码
*/
static b64decode(data: string);
/**
* base64编码
*/
static b64encode(data: string);
}
}