HomeServer/lualib-src/Server-main/AllServer/GameServer/Audit.lua
2024-11-20 15:41:37 +08:00

44 lines
2.3 KiB
Lua
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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