44 lines
2.3 KiB
Lua
44 lines
2.3 KiB
Lua
|
|
local skynet = require "skynet"
|
|||
|
|
local oo = require "Class"
|
|||
|
|
local pb = require "pb"
|
|||
|
|
local log = require "Log"
|
|||
|
|
local errorInfo = require "ErrorInfo"
|
|||
|
|
local dataType = require "DataType"
|
|||
|
|
local Audit = oo.class()
|
|||
|
|
|
|||
|
|
function Audit:InitData( player , platform , curHardwareCode )
|
|||
|
|
if skynet.server.gameConfig:IsAudit() and player.gameData.level < 45 then
|
|||
|
|
player.gameData.isAudit = true
|
|||
|
|
player.gameData.coin = 10000
|
|||
|
|
player.gameData.clovers = 10000
|
|||
|
|
player.gameData.volute = 10000
|
|||
|
|
log.info(string.format("玩家 %d 开启审核模式" , player.userId))
|
|||
|
|
--开启审核模式
|
|||
|
|
for i = 1, 45, 1 do
|
|||
|
|
player:AddExp( 10000 )
|
|||
|
|
end
|
|||
|
|
|
|||
|
|
--商城开启相关礼包 类型7的直接可以购买
|
|||
|
|
local StorePack = skynet.server.gameConfig.StorePack --获取配置文件StorePack中的数据
|
|||
|
|
for k , v in pairs(StorePack) do
|
|||
|
|
if 7==v.packType then
|
|||
|
|
local count = v.id
|
|||
|
|
player.gameData.storePack.storePackInfo[ count ] = {}
|
|||
|
|
player.gameData.storePack.storePackInfo[ count ].storeId = v.id --礼包id
|
|||
|
|
player.gameData.storePack.storePackInfo[ count ].buyTimes = 0 --玩家购买的次数
|
|||
|
|
player.gameData.storePack.storePackInfo[ count ].historyBuyTimes = 0 --玩家历史购买次数
|
|||
|
|
player.gameData.storePack.storePackInfo[ count ].buyStatus = false --玩家是否购买该礼包 付费成功 改为true ; 发放奖励后 改为false
|
|||
|
|
player.gameData.storePack.storePackInfo[ count ].packLimit = v.packLimit --礼包对应的购买次数 例 [1,2] (1:日限购 2:周限购 3:限购购买) 每日限购2次
|
|||
|
|
player.gameData.storePack.storePackInfo[ count ].look = false --玩家是否看过该礼包(配合限时礼包)
|
|||
|
|
--同时添加该礼包的存在时间
|
|||
|
|
player.gameData.storePack.storePackInfo[ count ].startTime = os.time()
|
|||
|
|
player.gameData.storePack.storePackInfo[ count ].failureTime = skynet.server.common:GetAfterSomeHour(72)
|
|||
|
|
player.gameData.storePack.storePackInfo[ count ].IsShow = true --是否继续展示packLimit[0] = 3 ,即限制购买的礼包 默认为true
|
|||
|
|
end
|
|||
|
|
end
|
|||
|
|
|
|||
|
|
end
|
|||
|
|
end
|
|||
|
|
|
|||
|
|
skynet.server.audit = Audit
|
|||
|
|
return Audit
|