Commit 1df833f9bc936f6902f3ddd119b9e6c6e4b877f2
Merge branch 'cn/develop' into cn/publish/release
Showing
7 changed files
with
84 additions
and
12 deletions
 
Show diff stats
src/ProtocolCode.lua
| @@ -232,6 +232,7 @@ actionCodes = { | @@ -232,6 +232,7 @@ actionCodes = { | ||
| 232 | Store_getTotalRechargeAwardRpc = 564, -- 累计充值 | 232 | Store_getTotalRechargeAwardRpc = 564, -- 累计充值 | 
| 233 | Store_monthCardRewardRpc = 565, --每日月卡+特刊奖励 | 233 | Store_monthCardRewardRpc = 565, --每日月卡+特刊奖励 | 
| 234 | Store_dyhxAndroidRechargeRpc = 566, -- 东银河充值 | 234 | Store_dyhxAndroidRechargeRpc = 566, -- 东银河充值 | 
| 235 | + Store_getCpOrderIdRpc = 567, -- 生成充值订单号 | ||
| 235 | 236 | ||
| 236 | Store_biliCloudRechargeRpc = 596, | 237 | Store_biliCloudRechargeRpc = 596, | 
| 237 | Store_biliAndroidRechargeRpc = 597, | 238 | Store_biliAndroidRechargeRpc = 597, | 
src/actions/RoleAction.lua
| @@ -334,6 +334,7 @@ function _M.loginRpc( agent, data ) | @@ -334,6 +334,7 @@ function _M.loginRpc( agent, data ) | ||
| 334 | 334 | ||
| 335 | local hangPass = role:getProperty("hangPass") | 335 | local hangPass = role:getProperty("hangPass") | 
| 336 | role:mylog("login", {key1 = agent.ip:toArray(false, ":")[1], int1 = hangPass[1] or 0}) | 336 | role:mylog("login", {key1 = agent.ip:toArray(false, ":")[1], int1 = hangPass[1] or 0}) | 
| 337 | + role:onUploadLoginout(1, agent.client_fd) | ||
| 337 | 338 | ||
| 338 | -- 是否是新设备 | 339 | -- 是否是新设备 | 
| 339 | local deviced = cluster.query("center", "deviced") | 340 | local deviced = cluster.query("center", "deviced") | 
| @@ -344,6 +345,15 @@ function _M.loginRpc( agent, data ) | @@ -344,6 +345,15 @@ function _M.loginRpc( agent, data ) | ||
| 344 | end | 345 | end | 
| 345 | end | 346 | end | 
| 346 | 347 | ||
| 348 | + -- 临时处理方式,清空电台活动队伍 | ||
| 349 | + local radioTask = role:getProperty("radioTask") | ||
| 350 | + for id, data in pairs(radioTask) do | ||
| 351 | + if (data["actid"] or 0) ~= 0 then | ||
| 352 | + radioTask[id] = nil | ||
| 353 | + end | ||
| 354 | + end | ||
| 355 | + --- | ||
| 356 | + | ||
| 347 | return true | 357 | return true | 
| 348 | end | 358 | end | 
| 349 | 359 | 
src/actions/StoreAction.lua
| @@ -281,6 +281,37 @@ function _M.dyhxAndroidRechargeRpc(agent, data) | @@ -281,6 +281,37 @@ function _M.dyhxAndroidRechargeRpc(agent, data) | ||
| 281 | return true | 281 | return true | 
| 282 | end | 282 | end | 
| 283 | 283 | ||
| 284 | +local rechargeHandler = { | ||
| 285 | + ali = function(cp_order_id, rechargeId, result) | ||
| 286 | + end, | ||
| 287 | + wx = function(cp_order_id, rechargeId, result) | ||
| 288 | + end, | ||
| 289 | +} | ||
| 290 | + | ||
| 291 | +function _M.getCpOrderIdRpc(agent, data) | ||
| 292 | + local role = agent.role | ||
| 293 | + local msg = MsgPack.unpack(data) | ||
| 294 | + local id = msg.id | ||
| 295 | + local type = msg.skd_type or "" | ||
| 296 | + local choose = msg.choose or "" | ||
| 297 | + local dataSet = csvdb["shop_rechargeCsv"][id] | ||
| 298 | + if not dataSet then return end | ||
| 299 | + local roleId = role:getProperty("id") | ||
| 300 | + | ||
| 301 | + role.ignoreHeartbeat = true | ||
| 302 | + --创建订单号 | ||
| 303 | + local partnerOrderId = role:getPurchaseOrder(id,nil,choose) | ||
| 304 | + | ||
| 305 | + local result = {} | ||
| 306 | + result["order"] = partnerOrderId | ||
| 307 | + local handler = rechargeHandler[type] | ||
| 308 | + if handler then | ||
| 309 | + handler(partnerOrderId, id, result) | ||
| 310 | + end | ||
| 311 | + | ||
| 312 | + SendPacket(actionCodes.Store_getCpOrderIdRpc, MsgPack.pack(result)) | ||
| 313 | +end | ||
| 314 | + | ||
| 284 | 315 | ||
| 285 | function _M.purchaseOrderResult(agent, data) | 316 | function _M.purchaseOrderResult(agent, data) | 
| 286 | local role = agent.role | 317 | local role = agent.role | 
src/agent.lua
| @@ -295,6 +295,7 @@ function CMD.close() | @@ -295,6 +295,7 @@ function CMD.close() | ||
| 295 | role:log("onLogout", {logtime = skynet.timex()-role:getProperty("ltime")}) | 295 | role:log("onLogout", {logtime = skynet.timex()-role:getProperty("ltime")}) | 
| 296 | role:mylog("logout", {int1 = skynet.timex()-role:getProperty("ltime")}) | 296 | role:mylog("logout", {int1 = skynet.timex()-role:getProperty("ltime")}) | 
| 297 | role:onOfflineEvent() | 297 | role:onOfflineEvent() | 
| 298 | + role:onUploadLoginout(0, agentInfo.client_fd) | ||
| 298 | end | 299 | end | 
| 299 | 300 | ||
| 300 | function CMD.exit() | 301 | function CMD.exit() | 
src/models/Activity.lua
| @@ -1488,12 +1488,13 @@ activityFunc[Activity.ActivityType.RadioTask] = { | @@ -1488,12 +1488,13 @@ activityFunc[Activity.ActivityType.RadioTask] = { | ||
| 1488 | if config.activity_ctrl_id == actid then | 1488 | if config.activity_ctrl_id == actid then | 
| 1489 | radioTask[id] = nil | 1489 | radioTask[id] = nil | 
| 1490 | 1490 | ||
| 1491 | - if not task then return 4 end | ||
| 1492 | - if skynet.timex() < task.time then return 5 end | ||
| 1493 | - | ||
| 1494 | - local reward = getActRadioTaskReward(self.owner, id, task) | ||
| 1495 | - for k, v in pairs(reward) do | ||
| 1496 | - result[k] = (result[k] or 0) + v | 1491 | + if task then | 
| 1492 | + if skynet.timex() > task.time then | ||
| 1493 | + local reward = getActRadioTaskReward(self.owner, id, task) | ||
| 1494 | + for k, v in pairs(reward) do | ||
| 1495 | + result[k] = (result[k] or 0) + v | ||
| 1496 | + end | ||
| 1497 | + end | ||
| 1497 | end | 1498 | end | 
| 1498 | end | 1499 | end | 
| 1499 | end | 1500 | end | 
src/models/RolePlugin.lua
| @@ -36,6 +36,25 @@ function RolePlugin.bind(Role) | @@ -36,6 +36,25 @@ function RolePlugin.bind(Role) | ||
| 36 | self:saveRoleData() | 36 | self:saveRoleData() | 
| 37 | end | 37 | end | 
| 38 | 38 | ||
| 39 | + -- 上报中宣数据 | ||
| 40 | + function Role:onUploadLoginout(bt, session) | ||
| 41 | + local uid = self:getProperty("uid") | ||
| 42 | + local id = self:getProperty("id") | ||
| 43 | + local time = skynet.timex() | ||
| 44 | + local si = string.format("%s_%s", id, session) | ||
| 45 | + local info = {{si = si, bt = bt, ot = time}} | ||
| 46 | + | ||
| 47 | + local codeurl = skynet.getenv("codeurl") | ||
| 48 | + local content = { | ||
| 49 | + ["si"] = si, | ||
| 50 | + ["bt"] = bt, | ||
| 51 | + ["ot"] = time, | ||
| 52 | + ["uid"] = uid, | ||
| 53 | + ["key"] = "zhaolugame20170831", | ||
| 54 | + } | ||
| 55 | + httpc.get(codeurl, "/collect?" .. httpGetFormatData(content), {}) | ||
| 56 | + end | ||
| 57 | + | ||
| 39 | local function checkItemCount(self, itemId, count) | 58 | local function checkItemCount(self, itemId, count) | 
| 40 | local itemData = csvdb["itemCsv"][itemId] | 59 | local itemData = csvdb["itemCsv"][itemId] | 
| 41 | -- 种类 类型数量限制 | 60 | -- 种类 类型数量限制 | 
| @@ -2410,11 +2429,20 @@ function RolePlugin.bind(Role) | @@ -2410,11 +2429,20 @@ function RolePlugin.bind(Role) | ||
| 2410 | end | 2429 | end | 
| 2411 | local rechargeId = back | 2430 | local rechargeId = back | 
| 2412 | local rechargeData = csvdb["shop_rechargeCsv"][rechargeId] | 2431 | local rechargeData = csvdb["shop_rechargeCsv"][rechargeId] | 
| 2413 | - if (params.is_mycard and rechargeData.twd * 100 ~= tonumber(params.amount)) or (not params.is_mycard and ((rechargeData.rmb * 100) / globalCsv.QArecharge) ~= tonumber(params.amount)) then | ||
| 2414 | - skynet.error(string.format("[recharge] fake order: %s, roleId: %d, order: %s, rmb %s, get %s", | ||
| 2415 | - params.transactionId, roleId, partnerOrderStr, rechargeData.rmb, params.amount | ||
| 2416 | - )) | ||
| 2417 | - return | 2432 | + if params.amount == 0 then | 
| 2433 | + if params.product_id ~= rechargeData.iap_product_id then | ||
| 2434 | + skynet.error(string.format("[recharge] fake order: %s, roleId: %d, order: %s, rmb %s, get %s", | ||
| 2435 | + params.transactionId, roleId, partnerOrderStr, rechargeData.iap_product_id, params.product_id | ||
| 2436 | + )) | ||
| 2437 | + return | ||
| 2438 | + end | ||
| 2439 | + else | ||
| 2440 | + if (params.is_mycard and rechargeData.twd * 100 ~= tonumber(params.amount)) or (not params.is_mycard and ((rechargeData.rmb * 100) / globalCsv.QArecharge) ~= tonumber(params.amount)) then | ||
| 2441 | + skynet.error(string.format("[recharge] fake order: %s, roleId: %d, order: %s, rmb %s, get %s", | ||
| 2442 | + params.transactionId, roleId, partnerOrderStr, rechargeData.rmb, params.amount | ||
| 2443 | + )) | ||
| 2444 | + return | ||
| 2445 | + end | ||
| 2418 | end | 2446 | end | 
| 2419 | 2447 | ||
| 2420 | local status, reward = self:recharge({ | 2448 | local status, reward = self:recharge({ |