跳到主要内容

gsdk_core

简介

提供GSDK的核心功能

组件接口

AntiAddictionD.gs

GSDK的防沉迷系统 防沉迷主要有三种限制:是否已实名/游戏时长/充值额度。

函数原型函数作用
void load_config()加载配置
bool is_actived()是否已激活
void enable_active(bool flag)是否激活
void report_login(string account, map extra_info = )登录上报
void report_logout(string account, map extra_info = )登出上报
string allow_play_game(string account)是否允许玩游戏
bool is_holiday(int now_time)是否为节假日
bool update(string account, map new_data = )更新防沉迷信息
mixed query(string account, string path = "")获取防沉迷信息

ComplianceD.gs

GSDK的合规处理模块

函数原型函数作用
string encrypt(string message)数据加密
string decrypt(string base64_ciphertext)数据解密

IDCardCacheD.gs

身份证信息缓存管理(身份证二要素校验是需要付费请求)

函数原型函数作用
bool is_verify_success(string id)是否校验成功
bool verify_success(string id, string name, string msgs = nil)校验成功&缓存数据
bool verify_failure(string id, string name, string msgs = nil)校验失败&缓存数据

IDCardD.gs

身份证管理模块

函数原型函数作用
void load_config()加载配置
string check(string name, string id)是否为有效的身份证信息
bool bind(string account, string id, string name)绑定身份证
mixed query(string account, string path = "")获取身份证信息
bool verify(string account)是否已完成实名认证
map query_identity(string account)获取身份信息

UserD.gs

GSDK账号管理

函数原型函数作用
bool register(string account, string password)账号注册
bool remove(string account)账号删除
bool FCacheByMongo.update(string account, mixed data)账号更新
mixed load_all_data(array fields = [], map conditions = )获取所有账户列表
string to_password(string input_password)密码加密
bool check_password(string input_password, string password)密码是否一致