Skip to content

接口函数API

接口函数API

1. 概述

本文档描述玩家管理、积分兑换、国内充值、海外充值、绑定相关管理等涉及到的接口函数。

2. 玩家管理

玩家管理包含获取玩家网关URL(GetGatwayUrl)、获取玩家在第三方的点数(QueryPoint)与剔除玩家(Kickout)。

2.1 GetGatwayUrl

接口功能

本接口用于获取玩家的网关url。

2.2 QueryPoint

接口功能

本接口用于获取玩家在第三方的点数。

回复函数

ReturnQueryPlatPointSdkPmd_S。

2.3 Kickout

接口功能

本接口用于服务器把玩家踢掉。

参数说明

本接口具体参数表2-1

表2-1 接口参数说明


参数名 字符类型 含义
desc string 踢出玩家人描述信息

3. 积分兑换

说明

在积分兑换的流程中,unilight通过loginserver与SDKserver通信,图中不再详细描述。

积分兑换的流程如下:

  1. 创建订单(自定义协议)
  2. 创建订单(CreatePlatOrderByPayPlatid,可参见“CreatePlatOrderByPayPlatid”)
  3. 返回创建结果(SDKserver至Unilight)
  4. 返回创建结果(Unilight至客户端)
  5. 自定义兑换协议
  6. 兑出(RedeemBackPoint,可参见“RedeemBackPoint”)/兑入(RedeemPoint,可参见“RedeemPoint”)
  7. 请求兑换
  8. 返回兑换结果(第三方到SDKserver)
  9. 返回兑换结果 (SDKserver到unilight)

3.1 RedeemBackPoint

接口功能

本接口用于从本平台兑入到第三方。

参数说明

本接口具体参数参见表3-1

表3-1 接口参数说明


参数名 字符类型 含义
money float32 以分为单位的人民币
point uint32 兑出平台货币
gameorder string 游戏订单号
extdata string 一个扩展字段方便特殊平台
**回复函数** ReturnRedeemBackPlatPointSdkPmd_S。 **参数顺序** RedeemBackPoint(money point gameorder extdata) ### 3.2 RedeemPoint **接口功能** 本接口用于从第三方兑入本平台。 **参数说明** 本接口具体参数表3-2表3-2 接口参数说明
参数名 字符类型 含义
money float32 以分为单位的人民币
goodid uint32 游戏商品id
gameorder string 游戏订单号
extdata string 一个扩展字段方便特殊平台
**回复函数** ReturnRedeemPlatPointSdkPmd_S。 **参数顺序** RedeemPoint(money goodid gameorder extdata) ### 4 国内充值 **说明**: 在国内充值的流程中,unilight通过loginserver与SDKserver通信,图中不再详细描述。 国内充值的流程如下: ![](images/guoneichongzhi.png) 1. 创建订单(自定义协议) 1. 创建订单(CreatePlatOrderByPayPlatid,可参见“CreatePlatOrderByPayPlatid”) 1. 返回创建结果(SDKserver至Unilight) 1. 返回创建结果(Unilight至客户端) 1. 充值 1. 返回充值结果(NotifyRechargeReturn,可参见“NotifyRechargeReturnd”) ### 4.1 CreatePlatOrderByPayPlatid **接口功能** 本接口用于创建订单号。 **参数说明** 本接口具体参数参见表4-1表4-1 接口参数说明
参数名 字符类型含义
gameorder string游戏订单号
rolename string用户在游戏内部游戏服上的角色名称
goodname string商品名称
redirectUrl string客户端跳转url
gooddesc string商品描述
extdata string做了兼容,方便以后别的平台有特殊需求
roleid uint64用户在游戏内部游戏服上的角色ID
originalmoney float32原价(格式:0.00),购买时应用传入的单价*总数,总原价
ordermoney float32实际价格(格式:0.00),购买时应用传入的单价*总数,总实际价格
goodid uint32用户买商品的种类
goodnum uint32用户买商品的数量
payplatid uint32支付平台id
**回复函数** CreatePlatOrderReturnSdkPmd_S。 **参数顺序** laccount.CreatePlatOrderByPayPlatid(gameOrder, roleName, goodName, redirectUrl, goodDesc, extData, roleId, originalMoney, orderMoney, goodId, goodNum, payPlatId) ### 4.2 NotifyRechargeReturn **接口功能** 本接口用于平台回调sdk后通知游戏平台,PS2ASRechargeCommand。 **参数说明** 本接口具体参数参见表4-2表4-2 接口参数说明
参数名 字符类型含义
gameorder string游戏订单号
platorder string平台订单号
extdata string扩展数据长度
result uint32购买状态
  • 0:支付成功
  • 1:处理中
  • 2:支付成功(兼容老版本)
  • 3:支付失败
**回复函数** NotifyRechargeRequestSdkPmd_S。 **参数顺序** laccount.NotifyRechargeReturn(gameorder platorder extdata result) ### 5 海外充值 **说明**: 在海外充值的流程中,unilight通过loginserver与SDKserver通信,图中不再详细描述。 海外充值流程: ![](images/guoneichongzhi.png)

1. 创建订单(自定义协议) 1. 创建订单(CreatePlatOrderByPayPlatid,可参见“CreatePlatOrderByPayPlatid”) 1. 返回创建结果(SDKserver至Unilight) 1. 返回创建结果(Unilight至客户端) 1. 充值 1. 返回充值结果(第三方至客户端) 1. 主动请求充值结果 1. 请求充值结果(RechargeQueryRequestIOS,可参见“RechargeQueryRequestIOS”) 1. 返回充值结果(NotifyRechargeReturn,可参见“NotifyRechargeReturn”) 1. 返回充值结果(Unilight至客户端) ### 5.1 RechargeQueryRequestIOS **接口功能** 本接口用于ISO,玩家请求充值后通知sdk服务器去苹果服务器查询,PS2ASRechargeQueryCommand。 **参数说明** 本接口具体参数参见表5-1表5-1 接口参数说明

参数名 字符类型含义
gameorder string游戏订单号
originalmoney float32原价(格式:0.00),购买时应用传入的单价*总数,总原价
token string查询凭证
extdata string扩展数据长度
**回复函数** NotifyRechargeRequestSdkPmd_S。 **参数顺序** laccount.RechargeQueryRequestIOS(gameorder string, originalmoney, ordermoney float32, token, extdata string) ### 6 绑定相关管理 绑定相关管理包含通过平台account查平台id("RequestAccidByPlatinfo")、请求玩家已绑定的平台信息("RequestBindPlatInfo")、请求绑定("RequestBindAccount")与请求解绑("RequestUnbindAccount")。 ### 6.1 RequestAccidByPlatinfo **接口功能** 本接口通过平台account查平台id。 **参数说明** 本接口具体参数参见表6-1表6-1 接口参数说明
参数名 字符类型含义
reqinfo map[string]uint32 map样式
  • key = plataccount
  • value = platid
**回复函数** RequestAccidByPlatinfoSdkPmd_CS。 **参数值** reqinfo[platId] = plataccount ### 6.2 RequestBindPlatInfo **接口功能** 请求玩家已绑定的平台信息。 **回复函数** RequestBindAccountSdkPmd_CS。 ### 6.3 RequestBindAccount **接口功能** 本接口用于请求绑定账号。 **参数说明** 本接口具体参数参见表6-2表6-2 接口参数说明
参数名 字符类型含义
platid uint32平台编号
plataccount string账号信息。如果是ID,需要转换成字符串;如果id和account都存在,需要"id|account"链接
**回复函数** RequestBindAccountSdkPmd_CS。 **参数顺序** laccount.RequestBindAccount(platId, plataccount) ### 6.4 RequestUnbindAccount **接口功能** 本接口用于解除第三方账号绑定。 **参数说明** 本接口具体参数参见表6-3表6-3 接口参数说明
参数名 字符类型含义
platid uint32平台编号
plataccount string账号信息,如果是ID,也需要转换成字符串,如果是id和account都有,就需要“id|account”链接
**回复函数** RequestUnbindAccountSdkPmd_CS。 **参数顺序** laccount.RequestUnbindAccount(platId,plataccount)