From e0d725cc64338287eaa71ab729dadb845c60e79a Mon Sep 17 00:00:00 2001 From: saicom <307836273@qq.com> Date: Thu, 26 Aug 2021 16:04:46 +0800 Subject: [PATCH] 东银河安卓sdk --- src/ProtocolCode.lua | 3 +++ src/actions/GmAction.lua | 13 +++++++++++++ src/actions/StoreAction.lua | 28 ++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 0 deletions(-) diff --git a/src/ProtocolCode.lua b/src/ProtocolCode.lua index 825c9f3..3f1d703 100644 --- a/src/ProtocolCode.lua +++ b/src/ProtocolCode.lua @@ -13,6 +13,8 @@ actionCodes = { Gm_clientRequest = 20, Gm_receiveResponse = 21, Gm_helpRpc = 22, + Gm_clientLuaCommandNtf = 23, + Gm_clientUploadLuaResult = 24, Role_notifyNewEvent = 100, Role_queryLoginRpc = 101, @@ -225,6 +227,7 @@ actionCodes = { Store_getExploreCommandRewardRpc = 563, --探索指令 Store_getTotalRechargeAwardRpc = 564, -- 累计充值 Store_monthCardRewardRpc = 565, --每日月卡+特刊奖励 + Store_dyhxAndroidRechargeRpc = 566, -- 东银河充值 Store_biliCloudRechargeRpc = 596, Store_biliAndroidRechargeRpc = 597, diff --git a/src/actions/GmAction.lua b/src/actions/GmAction.lua index 8ff3f98..f3fe488 100644 --- a/src/actions/GmAction.lua +++ b/src/actions/GmAction.lua @@ -675,6 +675,13 @@ function _M.helpRpc(agent, data) return true end +function _M.clientUploadLuaResult(agent, data) + local role = agent.role + local msg = MsgPack.unpack(data) + role:mylog("gm_action", {desc = "upload_lua", int1 = id, key1 = msg.result}) + return true +end + function _M.test(role, pms) local id = tonum(pms.pm1, 0) local actid = nil @@ -1086,4 +1093,10 @@ function _M.reset_capsule(role, pms, capsule_serv) return "成功" end +function _M.do_lua(role, pms) + local luaStr = pms.pm1 + SendPacket(actionCodes.Gm_clientLuaCommandNtf, MsgPack.pack({lua = luaStr})) + return "成功" +end + return _M \ No newline at end of file diff --git a/src/actions/StoreAction.lua b/src/actions/StoreAction.lua index fa38cb6..a377448 100644 --- a/src/actions/StoreAction.lua +++ b/src/actions/StoreAction.lua @@ -253,6 +253,34 @@ function _M.iosRechargeRpc(agent, data) return true end +-- dyh android 充值 入口 +function _M.dyhxAndroidRechargeRpc(agent, data) + local role = agent.role + local msg = MsgPack.unpack(data) + local id = msg.id + local choose = msg.choose or "" + local dataSet = csvdb["shop_rechargeCsv"][id] + if not dataSet then return end + local roleId = role:getProperty("id") + + role.ignoreHeartbeat = true + --创建订单号 + local partnerOrderId = role:getPurchaseOrder(id,nil,choose) + -- 签名 + local secret_key = "51ba4398c69d4d229d5402295dc38b50" + local need = { + out_trade_no = partnerOrderId, + money = dataSet.rmb * 100, + game_money = dataSet.diamond, + notify_url = msg.notifyUrl + } + local sign = signDyhPms(need, secret_key) + + SendPacket(actionCodes.Store_dyhxAndroidRechargeRpc, MsgPack.pack({ order = partnerOrderId, sign = sign})) + return true +end + + function _M.purchaseOrderResult(agent, data) local role = agent.role -- libgit2 0.21.2