Compare commits
4 Commits
b313a1c71a
...
44b4759211
| Author | SHA1 | Date | |
|---|---|---|---|
| 44b4759211 | |||
| 37a7ada472 | |||
| d896c89d80 | |||
| 90e3fbb682 |
@@ -1,30 +0,0 @@
|
|||||||
--P-平台福利37.xlsx 37
|
|
||||||
Platform37Config={
|
|
||||||
SPID = "21",
|
|
||||||
bindPhoneReward = {{type=0,id=351,count=1},{type=0,id=421,count=5},{type=0,id=302,count=1},{type=2,id=2,count=30000}},
|
|
||||||
FcmReward = {{type=0,id=365,count=1},{type=0,id=261,count=10},{type=0,id=300,count=1},{type=2,id=2,count=50000}},
|
|
||||||
downloadBoxReward = {{type=0,id=247,count=10},{type=7,id=7,count=5},{type=0,id=261,count=10},{type=2,id=2,count=20000}},
|
|
||||||
levelGift = {
|
|
||||||
[1]={lvl=50,awards={{type=2,id=2,count=5000},{type=0,id=421,count=1}}},
|
|
||||||
[2]={lvl=60,awards={{type=2,id=2,count=10000},{type=0,id=421,count=2}}},
|
|
||||||
[3]={lvl=70,awards={{type=2,id=2,count=15000},{type=0,id=421,count=3}}},
|
|
||||||
[4]={lvl=80,awards={{type=2,id=2,count=20000},{type=0,id=853,count=5}}},
|
|
||||||
[5]={lvl=90,awards={{type=2,id=2,count=25000},{type=0,id=854,count=5}}},
|
|
||||||
[6]={lvl=100,awards={{type=2,id=2,count=30000},{type=0,id=365,count=1}}},
|
|
||||||
},
|
|
||||||
dailyGift = {
|
|
||||||
[1]={viplvl=1,awards={{type=0,id=269,count=1},{type=7,id=7,count=2},{type=0,id=247,count=3}}},
|
|
||||||
[2]={viplvl=2,awards={{type=0,id=269,count=1},{type=7,id=7,count=2},{type=0,id=247,count=3}}},
|
|
||||||
[3]={viplvl=3,awards={{type=0,id=269,count=2},{type=7,id=7,count=3},{type=0,id=247,count=4}}},
|
|
||||||
[4]={viplvl=4,awards={{type=0,id=269,count=2},{type=7,id=7,count=3},{type=0,id=247,count=4}}},
|
|
||||||
[5]={viplvl=5,awards={{type=0,id=269,count=3},{type=7,id=7,count=4},{type=0,id=247,count=5}}},
|
|
||||||
[6]={viplvl=6,awards={{type=0,id=269,count=3},{type=7,id=7,count=4},{type=0,id=247,count=5}}},
|
|
||||||
[7]={viplvl=7,awards={{type=0,id=269,count=4},{type=7,id=7,count=5},{type=0,id=247,count=6}}},
|
|
||||||
[8]={viplvl=8,awards={{type=0,id=269,count=4},{type=7,id=7,count=5},{type=0,id=247,count=6}}},
|
|
||||||
},
|
|
||||||
bindPhoneUitips = "|C:0xf56f00&T:领取成功|",
|
|
||||||
FcmUitips = "|C:0xf56f00&T:领取成功|",
|
|
||||||
levelGiftUitips = "|C:0xf56f00&T:领取成功|",
|
|
||||||
downloadBoxUitips = "|C:0xf56f00&T:领取成功|",
|
|
||||||
dailyGiftUitips = "|C:0xf56f00&T:领取成功|",
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
--P-平台福利4366.xlsx 连登礼包
|
|
||||||
Login4366Config={
|
|
||||||
[1] = {
|
|
||||||
day = 1,
|
|
||||||
reward = {{type=0,id=269,count=1},{type=7,id=7,count=2},{type=2,id=2,count=10000}},
|
|
||||||
},
|
|
||||||
[2] = {
|
|
||||||
day = 2,
|
|
||||||
reward = {{type=0,id=421,count=1},{type=7,id=7,count=3},{type=2,id=2,count=10000}},
|
|
||||||
},
|
|
||||||
[3] = {
|
|
||||||
day = 3,
|
|
||||||
reward = {{type=0,id=261,count=1},{type=7,id=7,count=3},{type=2,id=2,count=10000}},
|
|
||||||
},
|
|
||||||
[4] = {
|
|
||||||
day = 4,
|
|
||||||
reward = {{type=0,id=269,count=2},{type=7,id=7,count=4},{type=2,id=2,count=10000}},
|
|
||||||
},
|
|
||||||
[5] = {
|
|
||||||
day = 5,
|
|
||||||
reward = {{type=0,id=421,count=2},{type=7,id=7,count=4},{type=2,id=2,count=10000}},
|
|
||||||
},
|
|
||||||
[6] = {
|
|
||||||
day = 6,
|
|
||||||
reward = {{type=0,id=261,count=2},{type=7,id=7,count=5},{type=2,id=2,count=10000}},
|
|
||||||
},
|
|
||||||
[7] = {
|
|
||||||
day = 7,
|
|
||||||
reward = {{type=0,id=421,count=3},{type=7,id=7,count=5},{type=2,id=2,count=10000}},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
--P-平台福利4366.xlsx 手机、微信、认证礼包
|
|
||||||
Platform4366Config={
|
|
||||||
reward1 = {{type=0,id=1019,count=1}},
|
|
||||||
reward2 = {{type=0,id=261,count=10},{type=0,id=269,count=1},{type=0,id=246,count=100},{type=2,id=2,count=30000}},
|
|
||||||
reward3 = {{type=0,id=421,count=10},{type=0,id=269,count=1},{type=0,id=246,count=100},{type=2,id=2,count=30000}},
|
|
||||||
type = 4,
|
|
||||||
bagtype = 16,
|
|
||||||
rewardClient = {{type=0,id=247,count=10},{type=7,id=7,count=5},{type=0,id=261,count=10},{type=2,id=2,count=20000}},
|
|
||||||
tips = "|C:0xeee104&T:%s|领取微端登录礼包,端游操作PK更爽快",
|
|
||||||
tips2 = "|C:0xeee104&T:%s|领取微端登录礼包,端游操作PK更爽快|E:-2,21,&U:&C:0x28ee01&T:[我也要礼包]|",
|
|
||||||
SPID = "4",
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
--P-平台福利QQ.xlsx 蓝钻每日礼包
|
|
||||||
BlueDiamondDailyConfig={
|
|
||||||
[1] = {
|
|
||||||
level = 1,
|
|
||||||
reward1 = {{type=0,id=269,count=1},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
reward2 = {{type=0,id=853,count=1},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
reward3 = {{type=0,id=421,count=3},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
},
|
|
||||||
[2] = {
|
|
||||||
level = 2,
|
|
||||||
reward1 = {{type=0,id=269,count=1},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
reward2 = {{type=0,id=853,count=1},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
reward3 = {{type=0,id=421,count=3},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
},
|
|
||||||
[3] = {
|
|
||||||
level = 3,
|
|
||||||
reward1 = {{type=0,id=269,count=1},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
reward2 = {{type=0,id=853,count=1},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
reward3 = {{type=0,id=421,count=3},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
},
|
|
||||||
[4] = {
|
|
||||||
level = 4,
|
|
||||||
reward1 = {{type=0,id=269,count=1},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
reward2 = {{type=0,id=853,count=1},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
reward3 = {{type=0,id=421,count=3},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
},
|
|
||||||
[5] = {
|
|
||||||
level = 5,
|
|
||||||
reward1 = {{type=0,id=261,count=1},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
reward2 = {{type=0,id=853,count=1},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
reward3 = {{type=0,id=421,count=3},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
},
|
|
||||||
[6] = {
|
|
||||||
level = 6,
|
|
||||||
reward1 = {{type=0,id=261,count=1},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
reward2 = {{type=0,id=853,count=1},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
reward3 = {{type=0,id=421,count=3},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
},
|
|
||||||
[7] = {
|
|
||||||
level = 7,
|
|
||||||
reward1 = {{type=0,id=261,count=1},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
reward2 = {{type=0,id=853,count=1},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
reward3 = {{type=0,id=421,count=3},{type=7,id=7,count=2},{type=0,id=247,count=3},},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
--P-平台福利QQ.xlsx 蓝钻等级礼包
|
|
||||||
LevelBlueDiamondConfig={
|
|
||||||
[1] = {
|
|
||||||
id = 1,
|
|
||||||
level = 50,
|
|
||||||
reward = {{type=2,id=2,count=10000},{type=0,id=421,count=1}},
|
|
||||||
},
|
|
||||||
[2] = {
|
|
||||||
id = 2,
|
|
||||||
level = 60,
|
|
||||||
reward = {{type=2,id=2,count=15000},{type=0,id=421,count=1}},
|
|
||||||
},
|
|
||||||
[3] = {
|
|
||||||
id = 3,
|
|
||||||
level = 70,
|
|
||||||
reward = {{type=2,id=2,count=20000},{type=0,id=421,count=2}},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
--P-平台福利QQ.xlsx 等级礼包
|
|
||||||
LoginQQConfig={
|
|
||||||
[1] = {
|
|
||||||
id = 1,
|
|
||||||
level = 60,
|
|
||||||
reward = {{type=2,id=2,count=20000},{type=0,id=853,count=5}},
|
|
||||||
},
|
|
||||||
[2] = {
|
|
||||||
id = 2,
|
|
||||||
level = 70,
|
|
||||||
reward = {{type=2,id=2,count=25000},{type=0,id=854,count=5}},
|
|
||||||
},
|
|
||||||
[3] = {
|
|
||||||
id = 3,
|
|
||||||
level = 80,
|
|
||||||
reward = {{type=2,id=2,count=30000},{type=0,id=365,count=1}},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
--P-平台福利QQ.xlsx 注册、活跃礼包
|
|
||||||
PlatformQQConfig={
|
|
||||||
reward1 = {{type=0,id=421,count=1},{type=0,id=261,count=1},{type=0,id=239,count=100},{type=2,id=2,count=30000}},
|
|
||||||
reward2 = {{type=0,id=269,count=1},{type=7,id=3,count=10},{type=0,id=246,count=10},{type=2,id=2,count=10000}},
|
|
||||||
reward3 = {{type=0,id=421,count=5},{type=0,id=269,count=5},{type=0,id=245,count=100},{type=2,id=2,count=50000}},
|
|
||||||
SPID = "6",
|
|
||||||
bagtype = 16,
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
--P-平台福利搜狗.xlsx 等级礼包
|
|
||||||
LevelSogouConfig={
|
|
||||||
[1] = {
|
|
||||||
id = 1,
|
|
||||||
level = 50,
|
|
||||||
reward = {{type=2,id=2,count=5000},{type=0,id=421,count=1},},
|
|
||||||
tips = "|C:0xf56f00&T:领取成功|",
|
|
||||||
},
|
|
||||||
[2] = {
|
|
||||||
id = 2,
|
|
||||||
level = 60,
|
|
||||||
reward = {{type=2,id=2,count=10000},{type=0,id=421,count=2},},
|
|
||||||
tips = "|C:0xf56f00&T:领取成功|",
|
|
||||||
},
|
|
||||||
[3] = {
|
|
||||||
id = 3,
|
|
||||||
level = 70,
|
|
||||||
reward = {{type=2,id=2,count=15000},{type=0,id=421,count=3},},
|
|
||||||
tips = "|C:0xf56f00&T:领取成功|",
|
|
||||||
},
|
|
||||||
[4] = {
|
|
||||||
id = 4,
|
|
||||||
level = 80,
|
|
||||||
reward = {{type=2,id=2,count=20000},{type=0,id=853,count=5},},
|
|
||||||
tips = "|C:0xf56f00&T:领取成功|",
|
|
||||||
},
|
|
||||||
[5] = {
|
|
||||||
id = 5,
|
|
||||||
level = 90,
|
|
||||||
reward = {{type=2,id=2,count=25000},{type=0,id=854,count=5},},
|
|
||||||
tips = "|C:0xf56f00&T:领取成功|",
|
|
||||||
},
|
|
||||||
[6] = {
|
|
||||||
id = 6,
|
|
||||||
level = 100,
|
|
||||||
reward = {{type=2,id=2,count=30000},{type=0,id=365,count=1},},
|
|
||||||
tips = "|C:0xf56f00&T:领取成功|",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
--P-平台福利搜狗.xlsx 登录礼包
|
|
||||||
LoginSogouConfig={
|
|
||||||
[1] = {
|
|
||||||
day = 1,
|
|
||||||
reward = {{type=0,id=269,count=1},{type=7,id=7,count=2},{type=2,id=2,count=10000},},
|
|
||||||
tips = "|C:0xf56f00&T:领取成功|",
|
|
||||||
},
|
|
||||||
[2] = {
|
|
||||||
day = 2,
|
|
||||||
reward = {{type=0,id=421,count=1},{type=7,id=7,count=3},{type=2,id=2,count=10000},},
|
|
||||||
tips = "|C:0xf56f00&T:领取成功|",
|
|
||||||
},
|
|
||||||
[3] = {
|
|
||||||
day = 3,
|
|
||||||
reward = {{type=0,id=261,count=1},{type=7,id=7,count=3},{type=2,id=2,count=10000},},
|
|
||||||
tips = "|C:0xf56f00&T:领取成功|",
|
|
||||||
},
|
|
||||||
[4] = {
|
|
||||||
day = 4,
|
|
||||||
reward = {{type=0,id=269,count=2},{type=7,id=7,count=4},{type=2,id=2,count=10000},},
|
|
||||||
tips = "|C:0xf56f00&T:领取成功|",
|
|
||||||
},
|
|
||||||
[5] = {
|
|
||||||
day = 5,
|
|
||||||
reward = {{type=0,id=421,count=2},{type=7,id=7,count=4},{type=2,id=2,count=10000},},
|
|
||||||
tips = "|C:0xf56f00&T:领取成功|",
|
|
||||||
},
|
|
||||||
[6] = {
|
|
||||||
day = 6,
|
|
||||||
reward = {{type=0,id=261,count=2},{type=7,id=7,count=5},{type=2,id=2,count=10000},},
|
|
||||||
tips = "|C:0xf56f00&T:领取成功|",
|
|
||||||
},
|
|
||||||
[7] = {
|
|
||||||
day = 7,
|
|
||||||
reward = {{type=0,id=421,count=3},{type=7,id=7,count=5},{type=2,id=2,count=10000},},
|
|
||||||
tips = "|C:0xf56f00&T:领取成功|",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
--P-平台福利搜狗.xlsx 搜狗平台福利
|
|
||||||
PlatformSogouConfig={
|
|
||||||
reward1 = {{type=0,id=421,count=5},{type=0,id=269,count=5},{type=0,id=245,count=100},{type=2,id=2,count=20000},},
|
|
||||||
reward2 = {{type=0,id=247,count=10},{type=7,id=7,count=5},{type=0,id=261,count=10},{type=2,id=2,count=20000},},
|
|
||||||
tips1 = "|C:0xf56f00&T:领取成功|",
|
|
||||||
tips2 = "|C:0xf56f00&T:领取成功|",
|
|
||||||
limit = 30000,
|
|
||||||
reward3 = {{type=0,id=1289,count=1}},
|
|
||||||
CDkeytype = 4,
|
|
||||||
PhoneReward = {{type=0,id=351,count=1},{type=0,id=421,count=5},{type=0,id=302,count=1},{type=2,id=2,count=30000},},
|
|
||||||
tips = "|C:0xf56f00&T:领取成功|",
|
|
||||||
}
|
|
||||||
@@ -1,442 +0,0 @@
|
|||||||
module("ActivityQQHall", package.seeall)
|
|
||||||
|
|
||||||
--[[
|
|
||||||
|
|
||||||
QQ大厅特权
|
|
||||||
|
|
||||||
个人数据:qqHallData
|
|
||||||
{
|
|
||||||
activeGift = 0/1 是否领取活跃礼包(0否,1是)
|
|
||||||
registerGift = 0/1 是否领取注册礼包(0否,1是)
|
|
||||||
lastLoginTime = 0 上一次通过YY大厅登录的时间戳
|
|
||||||
loginDay = 1 通过YY大厅登录的累计天数
|
|
||||||
levelGift = 00000000 32位 是否领取某天的登录礼包
|
|
||||||
|
|
||||||
--蓝钻
|
|
||||||
newPlayerGift //新手礼包
|
|
||||||
growupgift //成长礼包
|
|
||||||
dailyGift //每日礼包
|
|
||||||
blueDimandGift //蓝钻等级
|
|
||||||
BlueLv //蓝钻等级
|
|
||||||
Blue //蓝钻
|
|
||||||
BlueYear //年费
|
|
||||||
}
|
|
||||||
]]--
|
|
||||||
PlatformConfig = PlatformQQConfig
|
|
||||||
LoginConfig = LoginQQConfig
|
|
||||||
|
|
||||||
local PfId = System.getPfId()
|
|
||||||
--对应的活动配置
|
|
||||||
function getQQHallData(pActor)
|
|
||||||
local var = Actor.getStaticVar(pActor)
|
|
||||||
if var.qqHallData== nil then
|
|
||||||
var.qqHallData = {}
|
|
||||||
end
|
|
||||||
return var.qqHallData
|
|
||||||
end
|
|
||||||
|
|
||||||
function SendQQHallData(pActor)
|
|
||||||
if PfId ~= nil and PlatformConfig.SPID ~= nil then
|
|
||||||
--print("[Tip] [PlatformQQ] SendQQHallData ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID)
|
|
||||||
if tostring(PfId) ~= tostring(PlatformConfig.SPID) then
|
|
||||||
|
|
||||||
print("[Tip] [PlatformQQ] [非本平台活动]")
|
|
||||||
return --非本平台活动
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local npack = DataPack.allocPacket(pActor, enPlatforMwelfareID, sGetQQhallInfos)
|
|
||||||
if npack then
|
|
||||||
-- print("1111")
|
|
||||||
local data = getQQHallData(pActor)
|
|
||||||
DataPack.writeByte(npack, (data.activeGift or 0)) --是否领取活跃礼包(0否,1是)
|
|
||||||
DataPack.writeByte(npack, (data.registerGift or 0)) --是否领取认证礼包(0否,1是)
|
|
||||||
DataPack.writeUInt(npack, (data.levelGift or 0))--礼包的领取标记 32 位
|
|
||||||
DataPack.flush(npack)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------
|
|
||||||
-- CPP回调
|
|
||||||
--------------------------------------------------------------------
|
|
||||||
|
|
||||||
function OnQQHallLogin(pActor)
|
|
||||||
|
|
||||||
if PfId ~= nil and PlatformConfig.SPID ~= nil then
|
|
||||||
--print("[Tip] [PlatformQQ] OnQQHallLogin ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID)
|
|
||||||
if tostring(PfId) ~= tostring(PlatformConfig.SPID) then
|
|
||||||
|
|
||||||
print("[Tip] [PlatformQQ] [非本平台活动]")
|
|
||||||
return --非本平台活动
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- 当天初始化
|
|
||||||
local data = getQQHallData(pActor)
|
|
||||||
if data.lastLoginTime == nil then
|
|
||||||
data.lastLoginTime = System.getCurrMiniTime()
|
|
||||||
--print("第一天")
|
|
||||||
end
|
|
||||||
-- print("1111")
|
|
||||||
SendQQHallData(pActor);
|
|
||||||
end
|
|
||||||
|
|
||||||
--------------------------------------------------------------------
|
|
||||||
-- 客户端请求协议回调
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
--登录
|
|
||||||
function OnReqQQHallLevelGift(pActor, packet)
|
|
||||||
|
|
||||||
if PfId ~= nil and PlatformConfig.SPID ~= nil then
|
|
||||||
--print("[Tip] [PlatformQQ] OnReqQQHallLevelGift ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID)
|
|
||||||
if tostring(PfId) ~= tostring(PlatformConfig.SPID) then
|
|
||||||
|
|
||||||
print("[Tip] [PlatformQQ] [非本平台活动]")
|
|
||||||
return --非本平台活动
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local idx = DataPack.readByte(packet)
|
|
||||||
if idx > #LoginConfig then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local conf = PlatformConfig
|
|
||||||
local Cfg = LoginQQConfig[idx]
|
|
||||||
idx = idx - 1
|
|
||||||
local data = getQQHallData(pActor)
|
|
||||||
if Cfg then
|
|
||||||
-- 领取检查data.levelGift
|
|
||||||
if not data.levelGift then
|
|
||||||
data.levelGift = 0
|
|
||||||
end
|
|
||||||
local flag = System.getIntBit(data.levelGift, idx)
|
|
||||||
--print("loginGift="..data.levelGift.." flag="..flag)
|
|
||||||
if flag == 1 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local lv = Actor.getIntProperty( pActor, PROP_CREATURE_LEVEL )
|
|
||||||
|
|
||||||
if Cfg.level and ( lv < Cfg.level ) then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:等级不足|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor,conf.bagtype,tmLeftBagNumNotEnough,tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
-- 天数检查
|
|
||||||
data.levelGift = System.setIntBit(data.levelGift, idx, true)
|
|
||||||
CommonFunc.Awards.Give(pActor, Cfg.reward, GameLog.Log_QQhallLevel)
|
|
||||||
SendQQHallData(pActor)
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:领取成功|", tstUI)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--注册
|
|
||||||
function OnReqQQHallRegisteGift(pActor, packet)
|
|
||||||
|
|
||||||
if PfId ~= nil and PlatformConfig.SPID ~= nil then
|
|
||||||
--print("[Tip] [PlatformQQ] OnReqQQHallRegisteGift ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID)
|
|
||||||
if tostring(PfId) ~= tostring(PlatformConfig.SPID) then
|
|
||||||
|
|
||||||
print("[Tip] [PlatformQQ] [非本平台活动]")
|
|
||||||
return --非本平台活动
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local data = getQQHallData(pActor)
|
|
||||||
if data.registerGift then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local conf = PlatformConfig
|
|
||||||
local awards = conf.reward1
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor,conf.bagtype,tmLeftBagNumNotEnough,tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
CommonFunc.Awards.Give(pActor, awards, GameLog.Log_QQhallRegiste)
|
|
||||||
data.registerGift = 1;
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:领取成功|", tstUI)
|
|
||||||
SendQQHallData(pActor)
|
|
||||||
end
|
|
||||||
--认证
|
|
||||||
function OnReqQQHallIdActiveGift(pActor, packet)
|
|
||||||
|
|
||||||
if PfId ~= nil and PlatformConfig.SPID ~= nil then
|
|
||||||
--print("[Tip] [PlatformQQ] OnReqQQHallIdActiveGift ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID)
|
|
||||||
if tostring(PfId) ~= tostring(PlatformConfig.SPID) then
|
|
||||||
|
|
||||||
print("[Tip] [PlatformQQ] [非本平台活动]")
|
|
||||||
return --非本平台活动
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local conf = PlatformConfig
|
|
||||||
local awards = conf.reward2
|
|
||||||
local data = getQQHallData(pActor)
|
|
||||||
if data.activeGift == 1 then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:重复领取|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor,conf.bagtype,tmLeftBagNumNotEnough,tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
CommonFunc.Awards.Give(pActor, awards, GameLog.Log_QQhallActive)
|
|
||||||
data.activeGift = 1;
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:领取成功|", tstUI)
|
|
||||||
SendQQHallData(pActor)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, cGetQQHallInfos, OnQQHallLogin)
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, cGetQQqHallLevelAward, OnReqQQHallLevelGift)
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, cGetQQHallRegisteAward, OnReqQQHallRegisteGift)
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, cGetQQqHallActiveAward, OnReqQQHallIdActiveGift)
|
|
||||||
--------------------------------------------------------------------
|
|
||||||
-- 玩家 回调注册
|
|
||||||
--------------------------------------------------------------------
|
|
||||||
|
|
||||||
-- 跨天
|
|
||||||
function OnNewDayArrive(pActor,ndiffday)
|
|
||||||
|
|
||||||
if PfId ~= nil and PlatformConfig.SPID ~= nil then
|
|
||||||
--print("[Tip] [PlatformQQ] OnNewDayArrive ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID)
|
|
||||||
if tostring(PfId) ~= tostring(PlatformConfig.SPID) then
|
|
||||||
|
|
||||||
print("[Tip] [PlatformQQ] [非本平台活动]")
|
|
||||||
return --非本平台活动
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
print("[ActivityTypeQQHall:OnNewDayArrive-001--")
|
|
||||||
local currMiniTime = System.getCurrMiniTime()
|
|
||||||
local data = getQQHallData(pActor)
|
|
||||||
--print("[ActivityTypeQQHall:OnNewDayArrive-101--".. tostring(data.lastLoginTime))
|
|
||||||
print("[ActivityTypeQQHall:OnNewDayArrive-123--".. tostring(data.dailyGift))
|
|
||||||
print("[ActivityTypeQQHall:OnNewDayArrive-111--".. tostring(data.activeGift))
|
|
||||||
--if data.lastLoginTime then
|
|
||||||
print("[ActivityTypeQQHall:OnNewDayArrive-002--")
|
|
||||||
if not System.isSameDay(data.lastLoginTime, System.getCurrMiniTime()) then
|
|
||||||
data.lastLoginTime = System.getCurrMiniTime()
|
|
||||||
-- data.loginDay = data.loginDay + 1
|
|
||||||
data.activeGift = 0
|
|
||||||
data.dailyGift = 0;
|
|
||||||
|
|
||||||
print("[ActivityTypeQQHall:OnNewDayArrive-9123--".. tostring(data.dailyGift))
|
|
||||||
print("[ActivityTypeQQHall:OnNewDayArrive-9111--".. tostring(data.activeGift))
|
|
||||||
end
|
|
||||||
|
|
||||||
SendQQHallData(pActor)
|
|
||||||
--end
|
|
||||||
end
|
|
||||||
|
|
||||||
ActorEventDispatcher.Reg(aeNewDayArrive, OnNewDayArrive, "ActivityQQHall.lua")
|
|
||||||
|
|
||||||
|
|
||||||
-----------
|
|
||||||
--蓝钻
|
|
||||||
-----------
|
|
||||||
function OnSetQQBlueDiamond(pActor, packet)
|
|
||||||
|
|
||||||
if PfId ~= nil and PlatformConfig.SPID ~= nil then
|
|
||||||
--print("[Tip] [PlatformQQ] OnSetQQBlueDiamond ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID)
|
|
||||||
if tostring(PfId) ~= tostring(PlatformConfig.SPID) then
|
|
||||||
|
|
||||||
print("[Tip] [PlatformQQ] [非本平台活动]")
|
|
||||||
return --非本平台活动
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local data = getQQHallData(pActor)
|
|
||||||
local nBlue =DataPack.readByte(packet);
|
|
||||||
local nBlueYear =DataPack.readByte(packet);
|
|
||||||
local nBluelv =DataPack.readByte(packet);
|
|
||||||
local nVip = 0;
|
|
||||||
nVip = System.getValueMAKELONG(nBluelv, nBlueYear, nBlue);
|
|
||||||
data.Blue = nBlue;
|
|
||||||
data.BlueLv = nBluelv;
|
|
||||||
data.BlueYear = nBlueYear;
|
|
||||||
Actor.setUIntProperty(pActor,PROP_ACTOR_SUPPER_PLAY_LVL,nVip)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function SendQQBlueDiamondData(pActor)
|
|
||||||
if PfId ~= nil and PlatformConfig.SPID ~= nil then
|
|
||||||
--print("[Tip] [PlatformQQ] SendQQBlueDiamondData ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID)
|
|
||||||
if tostring(PfId) ~= tostring(PlatformConfig.SPID) then
|
|
||||||
|
|
||||||
print("[Tip] [PlatformQQ] [非本平台活动]")
|
|
||||||
return --非本平台活动
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local npack = DataPack.allocPacket(pActor, enMiscSystemID, sGetQQBlueDiamond)
|
|
||||||
if npack then
|
|
||||||
local data = getQQHallData(pActor)
|
|
||||||
DataPack.writeByte(npack, (data.newPlayerGift or 0)) --
|
|
||||||
DataPack.writeUInt(npack, (data.growupgift or 0)) --
|
|
||||||
DataPack.writeUInt(npack, (data.dailyGift or 0))--
|
|
||||||
DataPack.writeUInt(npack, (data.blueDimandGift or 0))--
|
|
||||||
DataPack.flush(npack)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function GetQQBlueDiamonGift(pActor, packet)
|
|
||||||
if PfId ~= nil and PlatformConfig.SPID ~= nil then
|
|
||||||
--print("[Tip] [PlatformQQ] GetQQBlueDiamonGift ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID)
|
|
||||||
if tostring(PfId) ~= tostring(PlatformConfig.SPID) then
|
|
||||||
|
|
||||||
print("[Tip] [PlatformQQ] [非本平台活动]")
|
|
||||||
return --非本平台活动
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local type = DataPack.readByte(packet)
|
|
||||||
local idx = DataPack.readByte(packet)
|
|
||||||
if type == 1 then --新手礼包
|
|
||||||
GetQQBlueNewPlayerGift(pActor, idx)
|
|
||||||
elseif type == 2 then --成长礼包
|
|
||||||
GetQQBlueGrowUpGift(pActor, idx)
|
|
||||||
elseif type == 3 then --每日礼包
|
|
||||||
GetQQblueDailyGift(pActor, idx)
|
|
||||||
elseif type == 4 then --蓝砖战神
|
|
||||||
GetQQBlueFightGift(pActor, idx)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function GetQQBlueNewPlayerGift(pActor, idx)
|
|
||||||
if PfId ~= nil and PlatformConfig.SPID ~= nil then
|
|
||||||
--print("[Tip] [PlatformQQ] GetQQBlueNewPlayerGift ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID)
|
|
||||||
if tostring(PfId) ~= tostring(PlatformConfig.SPID) then
|
|
||||||
|
|
||||||
print("[Tip] [PlatformQQ] [非本平台活动]")
|
|
||||||
return --非本平台活动
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local conf = PlatformConfig
|
|
||||||
local awards = conf.reward3
|
|
||||||
local data = getQQHallData(pActor)
|
|
||||||
if data.newPlayerGift then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor,conf.bagtype,tmLeftBagNumNotEnough,tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
CommonFunc.Awards.Give(pActor, awards, GameLog.Log_QQBlueNewPlayer)
|
|
||||||
data.newPlayerGift = 1;
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:领取成功|", tstUI)
|
|
||||||
SendQQBlueDiamondData(pActor)
|
|
||||||
end
|
|
||||||
|
|
||||||
function GetQQBlueGrowUpGift(pActor, idx)
|
|
||||||
if PfId ~= nil and PlatformConfig.SPID ~= nil then
|
|
||||||
--print("[Tip] [PlatformQQ] GetQQBlueGrowUpGift ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID)
|
|
||||||
if tostring(PfId) ~= tostring(PlatformConfig.SPID) then
|
|
||||||
|
|
||||||
print("[Tip] [PlatformQQ] [非本平台活动]")
|
|
||||||
return --非本平台活动
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
if idx > #LoginConfig then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local conf = PlatformConfig
|
|
||||||
local Cfg = LevelBlueDiamondConfig[idx]
|
|
||||||
idx = idx - 1
|
|
||||||
local data = getQQHallData(pActor)
|
|
||||||
if Cfg then
|
|
||||||
-- 领取检查data.levelGift
|
|
||||||
if not data.growupgift then
|
|
||||||
data.growupgift = 0
|
|
||||||
end
|
|
||||||
local flag = System.getIntBit(data.growupgift, idx)
|
|
||||||
--print("loginGift="..data.levelGift.." flag="..flag)
|
|
||||||
if flag == 1 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local lv = Actor.getIntProperty( pActor, PROP_CREATURE_LEVEL )
|
|
||||||
|
|
||||||
if Cfg.level and ( lv < Cfg.level ) then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:等级不足|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor,conf.bagtype,tmLeftBagNumNotEnough,tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
-- 天数检查
|
|
||||||
data.growupgift = System.setIntBit(data.growupgift, idx, true)
|
|
||||||
CommonFunc.Awards.Give(pActor, Cfg.reward, GameLog.Log_QQBlueGrowUp)
|
|
||||||
SendQQBlueDiamondData(pActor)
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:领取成功|", tstUI)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function GetQQblueDailyGift(pActor, idx)
|
|
||||||
if PfId ~= nil and PlatformConfig.SPID ~= nil then
|
|
||||||
--print("[Tip] [PlatformQQ] GetQQblueDailyGift ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID)
|
|
||||||
if tostring(PfId) ~= tostring(PlatformConfig.SPID) then
|
|
||||||
|
|
||||||
print("[Tip] [PlatformQQ] [非本平台活动]")
|
|
||||||
return --非本平台活动
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local conf = PlatformConfig
|
|
||||||
idx = idx - 1
|
|
||||||
local data = getQQHallData(pActor)
|
|
||||||
if not data.dailyGift then
|
|
||||||
data.dailyGift = 0
|
|
||||||
end
|
|
||||||
local flag = System.getIntBit(data.dailyGift, idx)
|
|
||||||
--print("loginGift="..data.levelGift.." flag="..flag)
|
|
||||||
if flag == 1 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if data.Blue == nil then
|
|
||||||
data.Blue = 0;
|
|
||||||
end
|
|
||||||
if data.BlueYear == nil then
|
|
||||||
data.BlueYear = 0;
|
|
||||||
end
|
|
||||||
local Cfg = BlueDiamondDailyConfig[data.BlueLv]
|
|
||||||
if Cfg then
|
|
||||||
local awards = nil;
|
|
||||||
if idx == 0 then
|
|
||||||
awards = Cfg.reward1
|
|
||||||
elseif idx == 1 then
|
|
||||||
if data.Blue == 2 then
|
|
||||||
awards = Cfg.reward2
|
|
||||||
end
|
|
||||||
elseif idx == 2 then
|
|
||||||
if data.BlueYear == 1 then
|
|
||||||
awards = Cfg.reward3
|
|
||||||
end
|
|
||||||
else
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:不满足条件|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if awards then
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor,conf.bagtype,tmLeftBagNumNotEnough,tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
-- 天数检查
|
|
||||||
data.dailyGift = System.setIntBit(data.dailyGift, idx, true)
|
|
||||||
CommonFunc.Awards.Give(pActor, awards, GameLog.Log_QQBlueGrowUp)
|
|
||||||
SendQQBlueDiamondData(pActor)
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:领取成功|", tstUI)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function GetQQBlueFightGift(pActor, idx)
|
|
||||||
end
|
|
||||||
|
|
||||||
NetmsgDispatcher.Reg(enMiscSystemID, CSetQQBlueDiamond, OnSetQQBlueDiamond)
|
|
||||||
NetmsgDispatcher.Reg(enMiscSystemID, CGetQQBlueDiamond, SendQQBlueDiamondData)
|
|
||||||
NetmsgDispatcher.Reg(enMiscSystemID, CGetQQBlueDiamondGift, GetQQBlueDiamonGift)
|
|
||||||
@@ -1,283 +0,0 @@
|
|||||||
module("ActivityType10016", package.seeall)
|
|
||||||
|
|
||||||
--[[
|
|
||||||
YY4366大厅特权
|
|
||||||
|
|
||||||
个人数据:YYHallAtv
|
|
||||||
{
|
|
||||||
phoneGift = 0/1 是否领取手机礼包(0否,1是)
|
|
||||||
idCardGift = 0/1 是否领取认证礼包(0否,1是)
|
|
||||||
lastLoginTime = 0 上一次通过YY大厅登录的时间戳
|
|
||||||
loginDay = 1 通过YY大厅登录的累计天数
|
|
||||||
loginGift = 00000000 32位 是否领取某天的登录礼包
|
|
||||||
loginTypeGift
|
|
||||||
loginType;//登录问题
|
|
||||||
}
|
|
||||||
]]--
|
|
||||||
PlatformConfig = Platform4366Config
|
|
||||||
LoginConfig = Login4366Config
|
|
||||||
local PfId = System.getPfId()
|
|
||||||
--对应的活动配置
|
|
||||||
function get4366Data(pActor)
|
|
||||||
local var = Actor.getStaticVar(pActor)
|
|
||||||
if var.YY4366HallAtv== nil then
|
|
||||||
var.YY4366HallAtv = {}
|
|
||||||
end
|
|
||||||
return var.YY4366HallAtv
|
|
||||||
end
|
|
||||||
|
|
||||||
function Send4366Data(pActor)
|
|
||||||
|
|
||||||
if PfId ~= nil and PlatformConfig.SPID ~= nil then
|
|
||||||
--print("[Tip] [Platform4366] Send4366Data ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID)
|
|
||||||
if tostring(PfId) ~= tostring(PlatformConfig.SPID) then
|
|
||||||
|
|
||||||
print("[Tip] [Platform4366] [非本平台活动]")
|
|
||||||
return --非本平台活动
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local npack = DataPack.allocPacket(pActor, enPlatforMwelfareID, sGet4366Infos)
|
|
||||||
if npack then
|
|
||||||
-- print("1111")
|
|
||||||
local data = get4366Data(pActor)
|
|
||||||
local cdkFlag = 0;
|
|
||||||
local cdkdata = getActorCdkData(pActor)
|
|
||||||
if cdkdata then
|
|
||||||
if cdkdata.codeTypeTimes then
|
|
||||||
if cdkdata.codeTypeTimes[PlatformConfig.type] then
|
|
||||||
cdkFlag = 1;
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
DataPack.writeByte(npack, (cdkFlag or 0)) --是否领取cdk礼包(0否,1是)
|
|
||||||
DataPack.writeByte(npack, (data.phoneGift or 0)) --是否领取手机礼包(0否,1是)
|
|
||||||
DataPack.writeByte(npack, (data.idCardGift or 0)) --是否领取认证礼包(0否,1是)
|
|
||||||
DataPack.writeShort(npack, (data.loginDay or 1))--登录的天数
|
|
||||||
DataPack.writeUInt(npack, (data.loginGift or 0))--礼包的领取标记 32 位
|
|
||||||
DataPack.writeByte(npack, (data.loginTypeGift or 0)) --
|
|
||||||
DataPack.flush(npack)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------
|
|
||||||
-- CPP回调
|
|
||||||
--------------------------------------------------------------------
|
|
||||||
|
|
||||||
function OnYY4366HallLogin(pActor)
|
|
||||||
|
|
||||||
if PfId ~= nil and PlatformConfig.SPID ~= nil then
|
|
||||||
--print("[Tip] [Platform4366] OnYY4366HallLogin ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID)
|
|
||||||
if tostring(PfId) ~= tostring(PlatformConfig.SPID) then
|
|
||||||
|
|
||||||
print("[Tip] [Platform4366] [非本平台活动]")
|
|
||||||
return --非本平台活动
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- 当天初始化
|
|
||||||
local data = get4366Data(pActor)
|
|
||||||
if data.lastLoginTime == nil then
|
|
||||||
data.lastLoginTime = System.getCurrMiniTime()
|
|
||||||
data.loginDay = 1
|
|
||||||
--print("第一天")
|
|
||||||
else
|
|
||||||
if not System.isSameDay(data.lastLoginTime, System.getCurrMiniTime()) then
|
|
||||||
--print("跨一天")
|
|
||||||
data.lastLoginTime = System.getCurrMiniTime()
|
|
||||||
data.loginDay = data.loginDay + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- print("1111")
|
|
||||||
Send4366Data(pActor);
|
|
||||||
end
|
|
||||||
|
|
||||||
--------------------------------------------------------------------
|
|
||||||
-- 客户端请求协议回调
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
--登录
|
|
||||||
function OnReqYY4366HallLoginGift(pActor, packet)
|
|
||||||
if PfId ~= nil and PlatformConfig.SPID ~= nil then
|
|
||||||
--print("[Tip] [Platform4366] OnReqYY4366HallLoginGift ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID)
|
|
||||||
if tostring(PfId) ~= tostring(PlatformConfig.SPID) then
|
|
||||||
|
|
||||||
print("[Tip] [Platform4366] [非本平台活动]")
|
|
||||||
return --非本平台活动
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local idx = DataPack.readByte(packet)
|
|
||||||
if idx > #LoginConfig then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local conf = PlatformConfig
|
|
||||||
local awards = LoginConfig[idx].reward
|
|
||||||
idx = idx - 1
|
|
||||||
local data = get4366Data(pActor)
|
|
||||||
if awards and data.lastLoginTime then
|
|
||||||
-- 领取检查
|
|
||||||
if not data.loginGift then
|
|
||||||
data.loginGift = 0
|
|
||||||
end
|
|
||||||
local flag = System.getIntBit(data.loginGift, idx)
|
|
||||||
--print("loginGift="..data.loginGift.." flag="..flag)
|
|
||||||
if flag == 1 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if (data.loginDay == nil) or (data.loginDay < idx ) then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:登录天数不足|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor,conf.bagtype,tmLeftBagNumNotEnough,tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
-- 天数检查
|
|
||||||
if data.loginDay and (data.loginDay > idx )then
|
|
||||||
data.loginGift = System.setIntBit(data.loginGift, idx, true)
|
|
||||||
CommonFunc.Awards.Give(pActor, awards, GameLog.Log_4366Login)
|
|
||||||
Send4366Data(pActor)
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:领取成功|", tstUI)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--认证
|
|
||||||
function OnReqYY4366HallPhoneGift(pActor, packet)
|
|
||||||
if PfId ~= nil and PlatformConfig.SPID ~= nil then
|
|
||||||
--print("[Tip] [Platform4366] OnReqYY4366HallPhoneGift ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID)
|
|
||||||
if tostring(PfId) ~= tostring(PlatformConfig.SPID) then
|
|
||||||
|
|
||||||
print("[Tip] [Platform4366] [非本平台活动]")
|
|
||||||
return --非本平台活动
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local conf = PlatformConfig
|
|
||||||
local awards = conf.reward2
|
|
||||||
local data = get4366Data(pActor)
|
|
||||||
if data.phoneGift then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor,conf.bagtype,tmLeftBagNumNotEnough,tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
CommonFunc.Awards.Give(pActor, awards, GameLog.Log_4366Phone)
|
|
||||||
data.phoneGift = 1;
|
|
||||||
Send4366Data(pActor)
|
|
||||||
end
|
|
||||||
--认证
|
|
||||||
function OnReqYY4366HallIdCardGift(pActor, packet)
|
|
||||||
|
|
||||||
if PfId ~= nil and PlatformConfig.SPID ~= nil then
|
|
||||||
--print("[Tip] [Platform4366] OnReqYY4366HallIdCardGift ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID)
|
|
||||||
if tostring(PfId) ~= tostring(PlatformConfig.SPID) then
|
|
||||||
|
|
||||||
print("[Tip] [Platform4366] [非本平台活动]")
|
|
||||||
return --非本平台活动
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local conf = PlatformConfig
|
|
||||||
local awards = conf.reward3
|
|
||||||
local data = get4366Data(pActor)
|
|
||||||
if data.idCardGift then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor,conf.bagtype,tmLeftBagNumNotEnough,tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
CommonFunc.Awards.Give(pActor, awards, GameLog.Log_4366IdCard)
|
|
||||||
data.idCardGift = 1;
|
|
||||||
Send4366Data(pActor)
|
|
||||||
end
|
|
||||||
|
|
||||||
function OnReqYY4366Login(pActor, packet)
|
|
||||||
|
|
||||||
if PfId ~= nil and PlatformConfig.SPID ~= nil then
|
|
||||||
--print("[Tip] [Platform4366] OnReqYY4366Login ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID)
|
|
||||||
if tostring(PfId) ~= tostring(PlatformConfig.SPID) then
|
|
||||||
|
|
||||||
print("[Tip] [Platform4366] [非本平台活动]")
|
|
||||||
return --非本平台活动
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local idx = DataPack.readByte(packet)
|
|
||||||
local data = get4366Data(pActor)
|
|
||||||
data.loginType = idx;
|
|
||||||
end
|
|
||||||
|
|
||||||
function OnReqYY4366LoginTypeGift(pActor, packet)
|
|
||||||
|
|
||||||
if PfId ~= nil and PlatformConfig.SPID ~= nil then
|
|
||||||
--print("[Tip] [Platform4366] OnReqYY4366LoginTypeGift ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID)
|
|
||||||
if tostring(PfId) ~= tostring(PlatformConfig.SPID) then
|
|
||||||
|
|
||||||
print("[Tip] [Platform4366] [非本平台活动]")
|
|
||||||
return --非本平台活动
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local conf = PlatformConfig
|
|
||||||
local awards = conf.rewardClient
|
|
||||||
local data = get4366Data(pActor)
|
|
||||||
if data.loginTypeGift then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if data.loginType == nil or data.loginType == 0 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor,conf.bagtype,tmLeftBagNumNotEnough,tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
CommonFunc.Awards.Give(pActor, awards, GameLog.Log_4366ExeLogin)
|
|
||||||
data.loginTypeGift = 1;
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:领取成功|", tstUI)
|
|
||||||
Send4366Data(pActor)
|
|
||||||
Actor.setStaticCount(pActor, 10005, 1);
|
|
||||||
|
|
||||||
local strName = Actor.getName(pActor)
|
|
||||||
if conf and conf.tips then
|
|
||||||
local strTips = string.format(conf.tips,strName)
|
|
||||||
System.broadcastTipmsgLimitLev(strTips, tstKillDrop)
|
|
||||||
end
|
|
||||||
|
|
||||||
if conf and conf.tips2 then
|
|
||||||
local strTips2 = string.format(conf.tips2,strName)
|
|
||||||
System.broadcastTipmsgLimitLev(strTips2, tstChatSystem)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, cGet4366Infos, OnYY4366HallLogin)
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, cGet4366LoginAward, OnReqYY4366HallLoginGift)
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, cGet4366PhoneAward, OnReqYY4366HallPhoneGift)
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, cGet4366IdCardAward, OnReqYY4366HallIdCardGift)
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, c4366LoginType, OnReqYY4366Login)
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, c4366LoginTypeGift, OnReqYY4366LoginTypeGift)
|
|
||||||
--------------------------------------------------------------------
|
|
||||||
-- 玩家 回调注册
|
|
||||||
--------------------------------------------------------------------
|
|
||||||
|
|
||||||
-- 跨天
|
|
||||||
function OnNewDayArrive(pActor,ndiffday)
|
|
||||||
|
|
||||||
if PfId ~= nil and PlatformConfig.SPID ~= nil then
|
|
||||||
--print("[Tip] [Platform4366] OnNewDayArrive ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID)
|
|
||||||
if tostring(PfId) ~= tostring(PlatformConfig.SPID) then
|
|
||||||
|
|
||||||
print("[Tip] [Platform4366] [非本平台活动]")
|
|
||||||
return --非本平台活动
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local currMiniTime = System.getCurrMiniTime()
|
|
||||||
local data = get4366Data(pActor)
|
|
||||||
if data.lastLoginTime then
|
|
||||||
if not System.isSameDay(data.lastLoginTime, System.getCurrMiniTime()) then
|
|
||||||
data.lastLoginTime = System.getCurrMiniTime()
|
|
||||||
data.loginDay = data.loginDay + 1
|
|
||||||
end
|
|
||||||
|
|
||||||
Send4366Data(pActor)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
ActorEventDispatcher.Reg(aeNewDayArrive, OnNewDayArrive, "ActivityType10016.lua")
|
|
||||||
@@ -73,21 +73,6 @@
|
|||||||
--#include "data/config/YYPlatform/YYVIPConfig.config" once
|
--#include "data/config/YYPlatform/YYVIPConfig.config" once
|
||||||
--#include "data/config/YYPlatform/GameVIPConfig.config" once
|
--#include "data/config/YYPlatform/GameVIPConfig.config" once
|
||||||
|
|
||||||
--#include "data/config/Platform37/Platform37.config" once --37游
|
|
||||||
--#include "data/config/PlatformSogou/LevelSogou.config" once --sogou游
|
|
||||||
--#include "data/config/PlatformSogou/LoginSogou.config" once --sogou游
|
|
||||||
--#include "data/config/PlatformSogou/PlatformSogou.config" once --sogou游
|
|
||||||
|
|
||||||
|
|
||||||
--#include "data/config/Platform4366/Login4366.config" once --4366
|
|
||||||
--#include "data/config/Platform4366/Platform4366.config" once --4366
|
|
||||||
--#include "data/config/PlatformQQ/PlatformQQ.config" once --qq
|
|
||||||
--#include "data/config/PlatformQQ/LoginQQ.config" once --qq
|
|
||||||
--#include "data/config/PlatformQQ/BlueDiamondDaily.config" once --qq
|
|
||||||
--#include "data/config/PlatformQQ/LevelBlueDiamond.config" once --qq
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- 套装
|
-- 套装
|
||||||
--#include "data/config/SuitConfig.config" once
|
--#include "data/config/SuitConfig.config" once
|
||||||
|
|
||||||
|
|||||||
@@ -71,8 +71,6 @@ require("ActorSystems.RechargeSystem.Fee") --玩家消费充值
|
|||||||
|
|
||||||
require("Common.CrossServerDispatcher")
|
require("Common.CrossServerDispatcher")
|
||||||
require("Common.NewCdkey")
|
require("Common.NewCdkey")
|
||||||
require("Platform.Platform37Gift")
|
|
||||||
require("Platform.PlatformSoGouGift")
|
|
||||||
|
|
||||||
--#include "data\functions\Common\Mail.txt" once --邮件
|
--#include "data\functions\Common\Mail.txt" once --邮件
|
||||||
--#include "data\functions\Common\CommonMisc.txt" once --工具
|
--#include "data\functions\Common\CommonMisc.txt" once --工具
|
||||||
|
|||||||
@@ -1,829 +0,0 @@
|
|||||||
module("Platform37Gift", package.seeall)
|
|
||||||
|
|
||||||
local CODE_CHECK_NULL = 0
|
|
||||||
local CODE_CHECK_DOWNLOADBOX = 1 -- 盒子下载领取
|
|
||||||
local CODE_CHECK_PHONEGIFT = 2 -- 手机绑定
|
|
||||||
local CODE_CHECK_FCM = 3 -- 防沉迷
|
|
||||||
|
|
||||||
local CODE_SUCCESS = 0 -- 成功
|
|
||||||
local CODE_INVALID = 4 -- 已被使用
|
|
||||||
|
|
||||||
--对应的活动配置
|
|
||||||
ActivityConfig = Platform37Config
|
|
||||||
local PfId = System.getPfId()
|
|
||||||
local SrvId = System.getServerId()
|
|
||||||
|
|
||||||
local bagLimit = 16 --需要的格子数量
|
|
||||||
|
|
||||||
local ServiceConfCKD = CdkeyServiceConf[PfId]
|
|
||||||
--BindPhoneHost = ServiceConfCKD.host --"fgtest.bigrnet.com"
|
|
||||||
--BindPhonePort = ServiceConf.port --"80"
|
|
||||||
--BindPhoneApi = "/Service/CheckBindPhoneCode.php" --"/H5CQ/develop/Service/CheckBindPhoneCode.php"
|
|
||||||
|
|
||||||
--http://gameapi.37.com/?a=get_user_info
|
|
||||||
-- 服务接口
|
|
||||||
Host = ActivityConfig.host or "gameapi.37.com"
|
|
||||||
Port = ActivityConfig.port or "80"
|
|
||||||
Api = ActivityConfig.api or "/"
|
|
||||||
PfKey = "VgvCLoGkwMdLsUPFnvAVr8QGvXBKLxRr"
|
|
||||||
|
|
||||||
function OnCheck37Platform()
|
|
||||||
-- 平台验证
|
|
||||||
if not PfId then
|
|
||||||
print("[Tip] [Platform37] OnCheck37Platform not PfId")
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if not ActivityConfig then
|
|
||||||
print("[Tip] [Platform37] OnCheck37Platform not ActivityConfig")
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if not ActivityConfig.SPID then
|
|
||||||
print("[Tip] [Platform37] OnCheck37Platform not ActivityConfig.SPID")
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if tostring(PfId) ~= tostring(ActivityConfig.SPID) then
|
|
||||||
print("[Tip] [非本平台活动]")
|
|
||||||
return false--非本平台活动
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
--对应的活动配置
|
|
||||||
function get37PlatformData(pActor)
|
|
||||||
local var = Actor.getStaticVar(pActor)
|
|
||||||
if var.Platform37Data == nil then
|
|
||||||
var.Platform37Data = {}
|
|
||||||
var.Platform37Data.DataLevelGift = 0
|
|
||||||
var.Platform37Data.DataDailyGift = 0
|
|
||||||
|
|
||||||
var.Platform37Data.phoneGift = 0
|
|
||||||
|
|
||||||
var.Platform37Data.downloadBox = 0
|
|
||||||
|
|
||||||
var.Platform37Data.FcmGift = 0
|
|
||||||
|
|
||||||
var.Platform37Data.Vip = 0
|
|
||||||
var.Platform37Data.hezi = 0
|
|
||||||
var.Platform37Data.phone = 0
|
|
||||||
var.Platform37Data.fcm = 0
|
|
||||||
|
|
||||||
print("[Tip] [Platform37]init data")
|
|
||||||
end
|
|
||||||
return var.Platform37Data
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function Send37PlatformData(pActor)
|
|
||||||
-- 平台验证
|
|
||||||
if not OnCheck37Platform() then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local data = get37PlatformData(pActor)
|
|
||||||
|
|
||||||
if data.Vip == nil then
|
|
||||||
data.Vip = 0
|
|
||||||
end
|
|
||||||
local npack = DataPack.allocPacket(pActor, enPlatforMwelfareID, sSend37GameGitfData)
|
|
||||||
if npack then
|
|
||||||
-- print("1111")
|
|
||||||
--local cdkFlag = 0;
|
|
||||||
--local cdkdata = getActorCdkData(pActor)
|
|
||||||
--if cdkdata then
|
|
||||||
-- if cdkdata.codeTypeTimes then
|
|
||||||
-- if cdkdata.codeTypeTimes[ActivityConfig.type] then
|
|
||||||
-- cdkFlag = 1;
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
--end
|
|
||||||
-- dailyGift
|
|
||||||
DataPack.writeByte(npack, (data.downloadBox or 0))
|
|
||||||
DataPack.writeByte(npack, (data.phoneGift or 0))
|
|
||||||
DataPack.writeByte(npack, (data.FcmGift or 0))
|
|
||||||
|
|
||||||
DataPack.writeUInt(npack, (data.DataLevelGift or 0))
|
|
||||||
DataPack.writeUInt(npack, (data.DataDailyGift or 0))
|
|
||||||
|
|
||||||
print("[Tip] [Platform37] ------DataPack.LevelGift=:".. tostring(data.DataLevelGift))
|
|
||||||
print("[Tip] [Platform37] ------DataPack.DailyGift=:".. tostring(data.DataDailyGift))
|
|
||||||
--DataPack.writeByte(npack, (data.idCardGift or 0)) --是否领取认证礼包(0否,1是)
|
|
||||||
--DataPack.writeShort(npack, (data.loginDay or 1))--登录的天数
|
|
||||||
--DataPack.writeUInt(npack, (data.loginGift or 0))--礼包的领取标记 32 位
|
|
||||||
--DataPack.writeByte(npack, (data.loginTypeGift or 0)) --
|
|
||||||
DataPack.flush(npack)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function AfterCheckBindPhoneLogon(paramPack, content, result)
|
|
||||||
print("[Tip] [Platform37] 登陆AfterCheckBindPhoneLogon -------------------------content:"..tostring(content).."result:"..tostring(result))
|
|
||||||
|
|
||||||
local aid = paramPack[1]
|
|
||||||
local pActor = Actor.getActorById(aid)
|
|
||||||
if not pActor then
|
|
||||||
print("[Tip] [Platform37]error--玩家不在线- AfterCheckBindPhoneLogon"..tostring(aid))
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local data = get37PlatformData(pActor)
|
|
||||||
if data == nil then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local data = get37PlatformData(pActor)
|
|
||||||
|
|
||||||
local res = CODE_SUCCESS
|
|
||||||
local actid = 0
|
|
||||||
if (result == 0) then --有反馈
|
|
||||||
local resPattern = "^(.*)(return_code%s*:%s)([^,]*)(.*)$"
|
|
||||||
strCapture1, strCapture2, res, strCapture3, strCapture4 = string.match(content, resPattern)
|
|
||||||
print("[Tip] [Platform37] -------------------------param1:"..tostring(strCapture1).."|param2:"..tostring(strCapture2).."|param3:"..tostring(res).."|param4:"..tostring(strCapture3).."|param5:"..tostring(strCapture4))
|
|
||||||
|
|
||||||
if (res == "0") then --可以领
|
|
||||||
data.phone = 0 --默认手机绑定,后面再查询
|
|
||||||
else
|
|
||||||
print("[Tip] [Platform37] AfterCheckBindPhoneLogon : 已经领了, content: "..content)
|
|
||||||
data.phone = 1 --默认手机绑定,后面再查询
|
|
||||||
end
|
|
||||||
else
|
|
||||||
res = CODE_HTTP
|
|
||||||
print("[ERR] [Platform37]1 AfterCheckBindPhoneLogon : result("..result.."), content: "..content)
|
|
||||||
data.phone = 0 --默认手机绑定,后面再查询
|
|
||||||
end
|
|
||||||
local npack = DataPack.allocPacket(pActor, enPlatforMwelfareID, sUse37GiftPhone)
|
|
||||||
if npack then
|
|
||||||
if data.phone == 0 then
|
|
||||||
DataPack.writeByte(npack, 0)
|
|
||||||
else
|
|
||||||
DataPack.writeByte(npack, 1)
|
|
||||||
end
|
|
||||||
DataPack.flush(npack)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--------------------------------------------------------------------
|
|
||||||
-- CPP回调
|
|
||||||
--------------------------------------------------------------------
|
|
||||||
|
|
||||||
-- 7游戏玩家登录
|
|
||||||
function On37GameLogin(pActor, packet)
|
|
||||||
|
|
||||||
local name = Actor.getName(pActor)
|
|
||||||
|
|
||||||
local nIndex1 = DataPack.readInt(packet)
|
|
||||||
local nIndex2 = DataPack.readInt(packet)
|
|
||||||
local nIndex3 = DataPack.readInt(packet)
|
|
||||||
local nIndex4 = DataPack.readInt(packet)
|
|
||||||
print("[Tip] [Platform37] On7GameLogin:".. nIndex1.. ":"..nIndex2.. ":"..nIndex3..":"..nIndex4.. ":name".. name)
|
|
||||||
|
|
||||||
|
|
||||||
-- 平台验证
|
|
||||||
if not OnCheck37Platform() then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
-- 当天初始化
|
|
||||||
local data = get37PlatformData(pActor)
|
|
||||||
|
|
||||||
if nIndex1 > 0 then
|
|
||||||
data.Vip = nIndex1
|
|
||||||
else
|
|
||||||
data.Vip = 0
|
|
||||||
end
|
|
||||||
if nIndex2 == 1 then
|
|
||||||
data.hezi = 1
|
|
||||||
else
|
|
||||||
data.hezi = 0
|
|
||||||
end
|
|
||||||
|
|
||||||
data.phone = 0 --默认手机绑定,后面再查询
|
|
||||||
|
|
||||||
if nIndex4 == 1 then
|
|
||||||
data.fcm = 1
|
|
||||||
else
|
|
||||||
data.fcm = 0
|
|
||||||
end
|
|
||||||
|
|
||||||
if data.lastLoginTime == nil then
|
|
||||||
data.lastLoginTime = System.getCurrMiniTime()
|
|
||||||
end
|
|
||||||
|
|
||||||
Send37PlatformData(pActor)
|
|
||||||
|
|
||||||
BindPhoneHost = ServiceConfCKD.host --"fgtest.bigrnet.com"
|
|
||||||
BindPhonePort = ServiceConfCKD.port --"80"
|
|
||||||
BindPhoneApi = "/Service/CheckBindPhoneCode.php" --"/H5CQ/develop/Service/CheckBindPhoneCode.php"
|
|
||||||
|
|
||||||
local sActorId = Actor.getActorId(pActor)
|
|
||||||
local req = BindPhoneApi..'?pfid='..PfId..'&aid='..sActorId..'&sid='..SrvId..'&check='..1
|
|
||||||
print("[Platform37] GetHttpContent -------------------------ServiceHost:"..tostring(BindPhoneHost))
|
|
||||||
print("[Platform37] GetHttpContent -------------------------ServicePort:"..tostring(BindPhonePort))
|
|
||||||
print("[Platform37] GetHttpContent -------------------------req:"..tostring(req))
|
|
||||||
|
|
||||||
--加入异步工作
|
|
||||||
AsyncWorkDispatcher.Add(
|
|
||||||
{'GetHttpContent', BindPhoneHost, BindPhonePort, req},
|
|
||||||
AfterCheckBindPhoneLogon,
|
|
||||||
{sActorId, 0}
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- 跨天
|
|
||||||
function OnNewDayArrive(pActor,ndiffday)
|
|
||||||
print("[Tip] [Platform37] OnNewDayArrive")
|
|
||||||
|
|
||||||
-- 平台验证
|
|
||||||
if not OnCheck37Platform() then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local currMiniTime = System.getCurrMiniTime()
|
|
||||||
--local data = get4366Data(pActor)
|
|
||||||
local data = get37PlatformData(pActor)--37平台数据
|
|
||||||
|
|
||||||
if data.lastLoginTime then
|
|
||||||
if not System.isSameDay(data.lastLoginTime, System.getCurrMiniTime()) then
|
|
||||||
data.lastLoginTime = System.getCurrMiniTime()
|
|
||||||
--data.loginDay = data.loginDay + 1
|
|
||||||
|
|
||||||
print("[Tip] [Platform37] -----------------------------------4newday!")
|
|
||||||
print("[Tip] [Platform37] OnNewDayArrive set newday!")
|
|
||||||
data.DataDailyGift = 0
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
Send37PlatformData(pActor)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
--ctorEventDispatcher.Reg(aeUserLogout, OnUserLogout, "Activity37Gift.lua")
|
|
||||||
|
|
||||||
--领取下载盒子奖励
|
|
||||||
function OnClickDownloadBox(pActor, packet)
|
|
||||||
print("[Tip] [Platform37] OnClickDownloadBox")
|
|
||||||
|
|
||||||
-- 平台验证
|
|
||||||
if not OnCheck37Platform() then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local data = get37PlatformData(pActor)
|
|
||||||
if data == nil then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if data.downloadBox == nil then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if data.hezi == 0 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local name = Actor.getName(pActor)
|
|
||||||
|
|
||||||
if ActivityConfig.downloadBoxReward == nil then
|
|
||||||
print("[Tip] [Platform37]没有此配置 DownloadBox Name = "..name)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if data.downloadBox > 0 then
|
|
||||||
print("[Tip] [Platform37]DownloadBox 重复领取!Name = "..name)
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:奖励已领取|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor, bagLimit, tmLeftBagNumNotEnough, tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local AwardCfg = ActivityConfig.downloadBoxReward
|
|
||||||
if AwardCfg then
|
|
||||||
--系统广播
|
|
||||||
--if AwardCfg.tips then
|
|
||||||
-- local name = Actor.getName(pActor);
|
|
||||||
-- 提示需要配置
|
|
||||||
-- System.broadTipmsgWithParams(AwardCfg.tips ,tstKillDrop, name)
|
|
||||||
-- System.broadTipmsgWithParams(AwardCfg.tips ,tstChatSystem, name)
|
|
||||||
--end
|
|
||||||
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType,ActivityType,1)
|
|
||||||
CommonFunc.Awards.Give(pActor, AwardCfg, GameLog.Log_Platform37)
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType, ActivityType, 2)
|
|
||||||
--提示 要配
|
|
||||||
if AwardCfg.downloadBoxUitips then
|
|
||||||
Actor.sendTipmsg(pActor, AwardCfg.downloadBoxUitips, tstUI)
|
|
||||||
end
|
|
||||||
data.downloadBox = data.downloadBox + 1
|
|
||||||
print("[Tip] [Platform37] DownloadBox Gift Success "..name)
|
|
||||||
end
|
|
||||||
|
|
||||||
local npack = DataPack.allocPacket(pActor, enPlatforMwelfareID, sUse37DownloadBox)
|
|
||||||
if npack then
|
|
||||||
|
|
||||||
DataPack.writeByte(npack, 1) --领取成功
|
|
||||||
DataPack.flush(npack)
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--37手机绑定
|
|
||||||
function OnClickGiftPhone(pActor, packet)
|
|
||||||
if 1 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
-- 平台验证
|
|
||||||
if not OnCheck37Platform() then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local data = get37PlatformData(pActor)
|
|
||||||
if data == nil then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if data.phoneGift == nil then
|
|
||||||
data.phoneGift = 0
|
|
||||||
end
|
|
||||||
|
|
||||||
if data.phone == 0 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local name = Actor.getName(pActor)
|
|
||||||
|
|
||||||
if ActivityConfig.bindPhoneReward == nil then
|
|
||||||
print("[Tip] [Platform37]没有此配置 GiftPhone Name = "..name)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if data.phoneGift > 0 then
|
|
||||||
print("[Tip] [Platform37]GiftFCM 重复领取!Name = "..name)
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:奖励已领取|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor, bagLimit, tmLeftBagNumNotEnough, tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local AwardCfg = ActivityConfig.bindPhoneReward
|
|
||||||
if AwardCfg then
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType,ActivityType,1)
|
|
||||||
CommonFunc.Awards.Give(pActor, AwardCfg, GameLog.Log_Platform37)
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType, ActivityType, 2)
|
|
||||||
--提示 要配
|
|
||||||
if AwardCfg.bindPhoneUitips then
|
|
||||||
Actor.sendTipmsg(pActor, AwardCfg.bindPhoneUitips, tstUI)
|
|
||||||
end
|
|
||||||
|
|
||||||
data.phoneGift = data.phoneGift + 1
|
|
||||||
print("[Tip] [Platform37] GiftPhone Success "..name)
|
|
||||||
end
|
|
||||||
local npack = DataPack.allocPacket(pActor, enPlatforMwelfareID, sUse37GiftPhone)
|
|
||||||
if npack then
|
|
||||||
|
|
||||||
DataPack.writeByte(npack, 1) --领取成功
|
|
||||||
DataPack.flush(npack)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--37防沉迷
|
|
||||||
function OnClickGiftFCM(pActor, packet)
|
|
||||||
-- 平台验证
|
|
||||||
if not OnCheck37Platform() then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local data = get37PlatformData(pActor)
|
|
||||||
if data == nil then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if data.FcmGift == nil then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if data.fcm ~= 1 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local name = Actor.getName(pActor)
|
|
||||||
|
|
||||||
if ActivityConfig.FcmReward == nil then
|
|
||||||
print("[Tip] [Platform37]没有此配置 GiftFCM!Name = "..name)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if data.FcmGift > 0 then
|
|
||||||
print("[Tip] [Platform37]GiftFCM 重复领取!Name = "..name)
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:奖励已领取|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor, bagLimit, tmLeftBagNumNotEnough, tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local AwardCfg = ActivityConfig.FcmReward
|
|
||||||
if AwardCfg then
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType,ActivityType,1)
|
|
||||||
CommonFunc.Awards.Give(pActor, AwardCfg, GameLog.Log_Platform37)
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType, ActivityType, 2)
|
|
||||||
--提示 要配
|
|
||||||
if AwardCfg.FcmUitips then
|
|
||||||
Actor.sendTipmsg(pActor, AwardCfg.FcmUitips, tstUI)
|
|
||||||
end
|
|
||||||
|
|
||||||
data.FcmGift = data.FcmGift + 1
|
|
||||||
print("[Tip] [Platform37] GiftFCM Gift Success "..name)
|
|
||||||
end
|
|
||||||
local npack = DataPack.allocPacket(pActor, enPlatforMwelfareID, sUse37GiftFCM)
|
|
||||||
if npack then
|
|
||||||
|
|
||||||
DataPack.writeByte(npack, 1) --领取成功
|
|
||||||
DataPack.flush(npack)
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
--37等级礼包
|
|
||||||
|
|
||||||
function OnClickGiftDaily(pActor, packet)
|
|
||||||
local nIndex = DataPack.readByte(packet);
|
|
||||||
print("[Tip] [Platform37] OnClickGiftDaily :".. nIndex)
|
|
||||||
-- 平台验证
|
|
||||||
if not OnCheck37Platform() then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local name = Actor.getName(pActor)
|
|
||||||
|
|
||||||
local PlatformData = get37PlatformData(pActor)
|
|
||||||
if PlatformData == nil then
|
|
||||||
print("[Tip] [Platform37] error data :".. nIndex)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if nIndex >= 32 then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此选项|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if ActivityConfig.dailyGift == nil then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此选项|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local Cfg = ActivityConfig.dailyGift[nIndex]
|
|
||||||
if Cfg == nil then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此选项|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if Cfg.awards == nil then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此奖励|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local LoginConfig = ActivityConfig.dailyGift
|
|
||||||
--local nIndex = DataPack.readByte(packet)
|
|
||||||
if nIndex > #LoginConfig then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此选项|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if PlatformData.Vip == 0 then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:等级不足|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local lv = PlatformData.Vip
|
|
||||||
--local Cfg
|
|
||||||
local count = 0
|
|
||||||
local Idlocal = 0
|
|
||||||
local CfgTmp = ActivityConfig.dailyGift
|
|
||||||
print("[Tip] [Platform37] 111error ddata.Vip :".. PlatformData.Vip )
|
|
||||||
if CfgTmp then
|
|
||||||
--print("[Tip] [Platform37] 222error ddata.Vip :".. PlatformData.Vip )
|
|
||||||
for key, value in pairs(CfgTmp) do
|
|
||||||
|
|
||||||
if value.viplvl > lv then
|
|
||||||
--Actor.sendTipmsg(pActor, "|C:0xf56f00&T:不满足条件|", tstUI)
|
|
||||||
--return
|
|
||||||
elseif nIndex == key and value.viplvl <= lv then
|
|
||||||
Idlocal = key
|
|
||||||
|
|
||||||
print("[Tip] [Platform37] 333error ddata.Vip :".. lv ..":"..value.viplvl..":"..nIndex)
|
|
||||||
--Cfg = value
|
|
||||||
break
|
|
||||||
else
|
|
||||||
end
|
|
||||||
count = count + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
print("[Tip] [Platform37]68764---------- :"..Idlocal ..":name"..name)
|
|
||||||
local Cfg = ActivityConfig.dailyGift[Idlocal]
|
|
||||||
if Cfg == nil then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此选项|", tstUI)
|
|
||||||
print("[Tip] [Platform37] 222er212321ror 无此选项 :")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if Cfg.awards == nil then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此奖励|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor, bagLimit, tmLeftBagNumNotEnough, tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local AwardCfg = Cfg.awards
|
|
||||||
if AwardCfg then
|
|
||||||
-- 领取检查
|
|
||||||
local flag = System.getIntBit(PlatformData.DataDailyGift, nIndex - 1)
|
|
||||||
if flag == 1 then
|
|
||||||
print("[Tip] [Platform37]DailyGift 重复领取!Name = "..name)
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:奖励已领取|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType,ActivityType,1)
|
|
||||||
CommonFunc.Awards.Give(pActor, AwardCfg, GameLog.Log_Platform37)
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType, ActivityType, 2)
|
|
||||||
--提示 要配
|
|
||||||
if Cfg.FcmUitips then
|
|
||||||
Actor.sendTipmsg(pActor, Cfg.FcmUitips, tstUI)
|
|
||||||
end
|
|
||||||
|
|
||||||
PlatformData.DataDailyGift = System.setIntBit(PlatformData.DataDailyGift, nIndex - 1, 1) --将indexId位置置为1
|
|
||||||
|
|
||||||
print("[Tip] [Platform37] ------------- running 333"..name)
|
|
||||||
end
|
|
||||||
print("[Tip] [Platform37] ---OnClickGiftDaily:"..name)
|
|
||||||
local npack = DataPack.allocPacket(pActor, enPlatforMwelfareID, sUse37GiftDaily)
|
|
||||||
if npack then
|
|
||||||
DataPack.writeByte(npack, 1) --领取成功
|
|
||||||
DataPack.writeUInt(npack, PlatformData.DataDailyGift)
|
|
||||||
DataPack.flush(npack)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
--37等级礼包
|
|
||||||
function OnClickLevelDaily(pActor, packet)
|
|
||||||
local nIndex = DataPack.readByte(packet);
|
|
||||||
print("[Tip] [Platform37] OnClickLevelDaily :".. nIndex)
|
|
||||||
-- 平台验证
|
|
||||||
if not OnCheck37Platform() then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local PlatformData = get37PlatformData(pActor)
|
|
||||||
if PlatformData == nil then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local name = Actor.getName(pActor)
|
|
||||||
|
|
||||||
if nIndex >= 32 then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此选项|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if ActivityConfig.levelGift == nil then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此选项|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local Cfg = ActivityConfig.levelGift[nIndex]
|
|
||||||
if Cfg == nil then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此选项|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if Cfg.awards == nil then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此奖励|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local LoginConfig = ActivityConfig.levelGift
|
|
||||||
--local nIndex = DataPack.readByte(packet)
|
|
||||||
if nIndex > #LoginConfig then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此选项|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local lv = Actor.getIntProperty( pActor, PROP_CREATURE_LEVEL )
|
|
||||||
|
|
||||||
local count = 0
|
|
||||||
local Idlocal = 0
|
|
||||||
local CfgTmp = ActivityConfig.levelGift
|
|
||||||
if CfgTmp then
|
|
||||||
for key, value in pairs(CfgTmp) do
|
|
||||||
|
|
||||||
if value.lvl > lv then
|
|
||||||
--Actor.sendTipmsg(pActor, "|C:0xf56f00&T:不满足条件|", tstUI)
|
|
||||||
--return
|
|
||||||
elseif nIndex == key and value.lvl <= lv then
|
|
||||||
Idlocal = key
|
|
||||||
break
|
|
||||||
else
|
|
||||||
end
|
|
||||||
count = count + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local Cfg = ActivityConfig.levelGift[Idlocal]
|
|
||||||
if Cfg == nil then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此选项|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if Cfg.awards == nil then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此奖励|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor, bagLimit, tmLeftBagNumNotEnough, tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local AwardCfg = Cfg.awards
|
|
||||||
if AwardCfg then
|
|
||||||
-- 领取检查
|
|
||||||
local flag = System.getIntBit(PlatformData.DataLevelGift, nIndex - 1)
|
|
||||||
if flag == 1 then
|
|
||||||
print("[Tip] [Platform37]LevelDaily 重复领取!Name = "..name)
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:奖励已领取|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType,ActivityType,1)
|
|
||||||
CommonFunc.Awards.Give(pActor, AwardCfg, GameLog.Log_Platform37)
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType, ActivityType, 2)
|
|
||||||
--提示 要配
|
|
||||||
if Cfg.FcmUitips then
|
|
||||||
Actor.sendTipmsg(pActor, Cfg.FcmUitips, tstUI)
|
|
||||||
end
|
|
||||||
|
|
||||||
PlatformData.DataLevelGift = System.setIntBit(PlatformData.DataLevelGift, nIndex - 1, 1) --将indexId位置置为1
|
|
||||||
|
|
||||||
end
|
|
||||||
print("[Tip] [Platform37] ---OnClickLevelDaily:"..name)
|
|
||||||
local npack = DataPack.allocPacket(pActor, enPlatforMwelfareID, sUse37LevelDaily)
|
|
||||||
if npack then
|
|
||||||
DataPack.writeByte(npack, 1) --领取成功
|
|
||||||
DataPack.writeUInt(npack, PlatformData.DataLevelGift)
|
|
||||||
DataPack.flush(npack)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function OnClickGiftDaily111(pActor, packet)
|
|
||||||
local data = get37PlatformData(pActor)
|
|
||||||
if data == nil then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if data.Vip == nil then
|
|
||||||
data.Vip = 3
|
|
||||||
end
|
|
||||||
data.Vip = 6
|
|
||||||
data.hezi = 1
|
|
||||||
data.phone = 1
|
|
||||||
data.fcm = 1
|
|
||||||
data.DataLevelGift = 56
|
|
||||||
data.DataDailyGift = 72
|
|
||||||
|
|
||||||
print("[Tip] [Platform37]init data".. data.Vip)
|
|
||||||
Send37PlatformData(pActor)
|
|
||||||
OnClickGiftDaily(pActor, packet)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function AfterCheckBindPhone(paramPack, content, result)
|
|
||||||
print("[Tip] [Platform37] AfterCheckBindPhone -------------------------content:"..tostring(content).."result:"..tostring(result))
|
|
||||||
local res = CODE_SUCCESS
|
|
||||||
local actid = 0
|
|
||||||
if (result == 0) then --有反馈
|
|
||||||
local resPattern = "^(.*)(return_code%s*:%s)([^,]*)(.*)$"
|
|
||||||
strCapture1, strCapture2, res, strCapture3, strCapture4 = string.match(content, resPattern)
|
|
||||||
print("[Tip] [Platform37] -------------------------param1:"..tostring(strCapture1).."|param2:"..tostring(strCapture2).."|param3:"..tostring(res).."|param4:"..tostring(strCapture3).."|param5:"..tostring(strCapture4))
|
|
||||||
|
|
||||||
if (res == "0") then --可以领
|
|
||||||
|
|
||||||
local aidPattern = "^(.*)(aid%s*:%s)([^,]*)(.*)$"
|
|
||||||
strCapture1, strCapture2, actid, strCapture3, strCapture4 = string.match(content, aidPattern)
|
|
||||||
print("[Tip] [Platform37] -------------------------param1:"..tostring(strCapture1).."|param2:"..tostring(strCapture2).."|param3:"..tostring(actid).."|param4:"..tostring(strCapture3).."|param5:"..tostring(strCapture4))
|
|
||||||
|
|
||||||
actid = tonumber(actid)
|
|
||||||
if not PfId then
|
|
||||||
print("[Tip] [Platform37]AfterCheckBindPhone OnCheck37Platform not PfId")
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if not ActivityConfig then
|
|
||||||
print("[Tip] [Platform37]AfterCheckBindPhone OnCheck37Platform not ActivityConfig")
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if not ActivityConfig.SPID then
|
|
||||||
print("[Tip] [Platform37]AfterCheckBindPhone OnCheck37Platform not ActivityConfig.SPID")
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if tostring(PfId) ~= tostring(ActivityConfig.SPID) then
|
|
||||||
print("[Tip] [非本平台活动]")
|
|
||||||
return false--非本平台活动
|
|
||||||
end
|
|
||||||
if ActivityConfig.bindPhoneReward == nil then
|
|
||||||
print("[ERR] [Platform37] AfterCheckBindPhone没有此配置 GiftPhone ")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local AwardCfg = ActivityConfig.bindPhoneReward
|
|
||||||
if AwardCfg then
|
|
||||||
SendMail(actid, "系统邮件", "尊敬的玩家:感谢您的支持,请查收您的手机绑定礼包奖励。", AwardCfg)
|
|
||||||
print("[Tip] [Platform37] AfterCheckBindPhone success : res("..res.."), content: "..content)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
print("[Tip] [Platform37] AfterCheckBindPhone : 已经领了, content: "..content)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
res = CODE_HTTP
|
|
||||||
print("[ERR] [Platform37]1 AfterCheckBindPhone : result("..result.."), content: "..content)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function OnCMDBackStageBindPhone(packet)
|
|
||||||
local sActorId = DataPack.readInt(packet)
|
|
||||||
print("[Tip] [Platform37]--- BackStageBindPhone:"..tostring(sActorId))
|
|
||||||
|
|
||||||
-- 平台验证
|
|
||||||
if not OnCheck37Platform() then
|
|
||||||
print("[Tip] [Platform37]error--非本平台- BackStageBindPhone:"..tostring(sActorId))
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
BindPhoneHost = ServiceConfCKD.host --"fgtest.bigrnet.com"
|
|
||||||
BindPhonePort = ServiceConfCKD.port --"80"
|
|
||||||
BindPhoneApi = "/Service/CheckBindPhoneCode.php" --"/H5CQ/develop/Service/CheckBindPhoneCode.php"
|
|
||||||
|
|
||||||
local req = BindPhoneApi..'?pfid='..PfId..'&aid='..sActorId..'&sid='..SrvId..'&check='..0
|
|
||||||
print("[Platform37] GetHttpContent -------------------------ServiceHost:"..tostring(BindPhoneHost))
|
|
||||||
print("[Platform37] GetHttpContent -------------------------ServicePort:"..tostring(BindPhonePort))
|
|
||||||
print("[Platform37] GetHttpContent -------------------------req:"..tostring(req))
|
|
||||||
|
|
||||||
--加入异步工作
|
|
||||||
AsyncWorkDispatcher.Add(
|
|
||||||
{'GetHttpContent', BindPhoneHost, BindPhonePort, req},
|
|
||||||
AfterCheckBindPhone,
|
|
||||||
{sActorId, 0}
|
|
||||||
)
|
|
||||||
if 1 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local pActor = Actor.getActorById(sActorId)
|
|
||||||
if not pActor then
|
|
||||||
print("[Tip] [Platform37]error--玩家不在线- BackStageBindPhone:"..tostring(sActorId))
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local data = get37PlatformData(pActor)
|
|
||||||
if data == nil then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if data.phoneGift == nil then
|
|
||||||
data.phoneGift = 0
|
|
||||||
end
|
|
||||||
|
|
||||||
--if data.phone == 0 then
|
|
||||||
-- return
|
|
||||||
--end
|
|
||||||
|
|
||||||
local name = Actor.getName(pActor)
|
|
||||||
|
|
||||||
if ActivityConfig.bindPhoneReward == nil then
|
|
||||||
print("[Tip] [Platform37]error 没有此配置 GiftPhone Name = "..name)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if data.phoneGift > 0 then
|
|
||||||
print("[Tip] [Platform37]error GiftFCM 重复领取!Name = "..name)
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:奖励已领取|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor, bagLimit, tmLeftBagNumNotEnough, tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local AwardCfg = ActivityConfig.bindPhoneReward
|
|
||||||
if AwardCfg then
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType,ActivityType,1)
|
|
||||||
--CommonFunc.Awards.Give(pActor, AwardCfg, GameLog.Log_Platform37)
|
|
||||||
|
|
||||||
SendMail(sActorId, "系统邮件", "尊敬的玩家:感谢您的支持,请查收您的手机绑定礼包奖励。", AwardCfg)-- NewCdkeyAwards)
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType, ActivityType, 2)
|
|
||||||
--提示 要配
|
|
||||||
if AwardCfg.bindPhoneUitips then
|
|
||||||
Actor.sendTipmsg(pActor, AwardCfg.bindPhoneUitips, tstUI)
|
|
||||||
end
|
|
||||||
|
|
||||||
data.phoneGift = data.phoneGift + 1
|
|
||||||
print("[Tip] [Platform37] GiftPhone Success "..name)
|
|
||||||
end
|
|
||||||
local npack = DataPack.allocPacket(pActor, enPlatforMwelfareID, sUse37GiftPhone)
|
|
||||||
if npack then
|
|
||||||
|
|
||||||
DataPack.writeByte(npack, 1) --领取成功
|
|
||||||
DataPack.flush(npack)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--登陆
|
|
||||||
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, cUse37DownloadBox, OnClickDownloadBox)--37盒子下载礼包
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, cUse37GiftFCM, OnClickGiftFCM)--37防沉迷
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, cUse37GiftPhone, OnClickGiftPhone)--37手机礼包
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, cUse37GiftDaily, OnClickGiftDaily)--37每日礼包
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, cUse37LevelDaily, OnClickLevelDaily)--37等级礼包
|
|
||||||
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, c37Logon, On37GameLogin)--37等级礼包
|
|
||||||
--测试
|
|
||||||
--NetmsgDispatcher.Reg(enMiscSystemID, cBuyMonthCard, OnClickDownloadBox)--37盒子下载礼包
|
|
||||||
--NetmsgDispatcher.Reg(enMiscSystemID, cBuyMonthCard, OnClickGiftFCM)--37防沉迷
|
|
||||||
|
|
||||||
ActorEventDispatcher.Reg(aeNewDayArrive, OnNewDayArrive, "Platform37Gift.lua")
|
|
||||||
|
|
||||||
@@ -1,630 +0,0 @@
|
|||||||
module("PlatformSoGouGift", package.seeall)
|
|
||||||
|
|
||||||
local CODE_CHECK_NULL = 0
|
|
||||||
local CODE_CHECK_SKIN_LOGIN = 1 -- 皮肤登陆
|
|
||||||
local CODE_CHECK_PLAZA_LOGIN = 2 -- 大厅登陆
|
|
||||||
|
|
||||||
--对应的活动配置
|
|
||||||
ActivityConfigPT = PlatformSogouConfig-- skin 和大厅礼包
|
|
||||||
ActivityConfigLv = LevelSogouConfig
|
|
||||||
ActivityConfigLg = LoginSogouConfig
|
|
||||||
|
|
||||||
local PfId = System.getPfId()
|
|
||||||
local SOGOU_SPID = 23
|
|
||||||
|
|
||||||
local bagLimit = 16 --需要的格子数量
|
|
||||||
|
|
||||||
Host = ActivityConfigPT.host or "wan.sogou.com"
|
|
||||||
Port = ActivityConfigPT.port or "80"
|
|
||||||
Api = ActivityConfigPT.api or "/api/user/bindMobile/status.do"
|
|
||||||
|
|
||||||
function OnCheckSogouPlatform()
|
|
||||||
-- 平台验证
|
|
||||||
if not PfId then
|
|
||||||
print("[Tip] [PlatformSogou] OnCheckSogouPlatform not PfId")
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if not ActivityConfigPT then
|
|
||||||
print("[Tip] [PlatformSogou] OnCheckSogouPlatform not ActivityConfigPT")
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if not ActivityConfigLv then
|
|
||||||
print("[Tip] [PlatformSogou] OnCheckSogouPlatform not ActivityConfigLv")
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if not ActivityConfigLg then
|
|
||||||
print("[Tip] [PlatformSogou] OnCheckSogouPlatform not ActivityConfigLg")
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if tostring(PfId) ~= tostring(SOGOU_SPID) then
|
|
||||||
print("[Tip] [非本平台活动]")
|
|
||||||
return false--非本平台活动
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
--对应的活动配置
|
|
||||||
function getSogouPlatformData(pActor)
|
|
||||||
local var = Actor.getStaticVar(pActor)
|
|
||||||
if var.PlatformSogouData == nil then
|
|
||||||
var.PlatformSogouData = {}
|
|
||||||
var.PlatformSogouData.DataLevelGift = 0
|
|
||||||
var.PlatformSogouData.DataDailyGift = 0
|
|
||||||
|
|
||||||
|
|
||||||
var.PlatformSogouData.PlazaData = 0
|
|
||||||
var.PlatformSogouData.SkinData = 0
|
|
||||||
|
|
||||||
var.PlatformSogouData.loginday = 1
|
|
||||||
var.PlatformSogouData.WEINXIN_LOGIN = 0
|
|
||||||
var.PlatformSogouData.PLAZA_LOGIN = 0
|
|
||||||
var.PlatformSogouData.SKIN_LOGIN = 0
|
|
||||||
var.PlatformSogouData.BINDPHONE = 0 --绑定手机
|
|
||||||
|
|
||||||
print("[Tip] [PlatformSogou]init data")
|
|
||||||
end
|
|
||||||
return var.PlatformSogouData
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function SendSogouPlatformData(pActor)
|
|
||||||
-- 平台验证
|
|
||||||
if not OnCheckSogouPlatform() then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local data = getSogouPlatformData(pActor)
|
|
||||||
|
|
||||||
local npack = DataPack.allocPacket(pActor, enPlatforMwelfareID, sSogouLogonData)
|
|
||||||
if npack then
|
|
||||||
-- print("1111")
|
|
||||||
|
|
||||||
if data.loginday == nil then
|
|
||||||
data.loginday = 1
|
|
||||||
end
|
|
||||||
|
|
||||||
DataPack.writeByte(npack, (data.loginday or 1))
|
|
||||||
DataPack.writeByte(npack, (data.WEINXIN_LOGIN or 0))
|
|
||||||
DataPack.writeByte(npack, (data.SKIN_LOGIN or 0))
|
|
||||||
DataPack.writeByte(npack, (data.PLAZA_LOGIN or 0))
|
|
||||||
|
|
||||||
DataPack.writeUInt(npack, (data.DataDailyGift or 0))
|
|
||||||
DataPack.writeUInt(npack, (data.DataLevelGift or 0))
|
|
||||||
|
|
||||||
DataPack.writeByte(npack, (data.BINDPHONE or 0))
|
|
||||||
|
|
||||||
print("[Tip] [PlatformSogou] ------DataPack.LevelGift=:".. tostring(data.DataLevelGift))
|
|
||||||
print("[Tip] [PlatformSogou] ------DataPack.DailyGift=:".. tostring(data.DataDailyGift))
|
|
||||||
DataPack.flush(npack)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--------------------------------------------------------------------
|
|
||||||
-- CPP回调
|
|
||||||
--------------------------------------------------------------------
|
|
||||||
|
|
||||||
-- Sogou游戏玩家登录
|
|
||||||
function OnSogouLogon(pActor, packet)
|
|
||||||
local nIndex1 = DataPack.readByte(packet)
|
|
||||||
print("[Tip] [PlatformSogou] OnSogouGameLogin:".. nIndex1)
|
|
||||||
|
|
||||||
-- 平台验证
|
|
||||||
if not OnCheckSogouPlatform() then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
-- 当天初始化
|
|
||||||
local data = getSogouPlatformData(pActor)
|
|
||||||
|
|
||||||
--更新登陆数据
|
|
||||||
data.PlazaData = 0
|
|
||||||
data.SkinData = 0
|
|
||||||
if nIndex1 == 2 then
|
|
||||||
data.PlazaData = 1
|
|
||||||
elseif nIndex1 == 3 then
|
|
||||||
data.SkinData = 1
|
|
||||||
end
|
|
||||||
|
|
||||||
local Cfg = ActivityConfigPT
|
|
||||||
local data = getActorCdkData(pActor)
|
|
||||||
if data then
|
|
||||||
if data.codeTypeTimes then
|
|
||||||
if data.codeTypeTimes[Cfg.CDkeytype] then
|
|
||||||
data.WEINXIN_LOGIN = 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if data.lastLoginTime == nil then
|
|
||||||
data.lastLoginTime = System.getCurrMiniTime()
|
|
||||||
print("[Tip] [PlatformSogou] 564336434-----------------2-----------")
|
|
||||||
end
|
|
||||||
|
|
||||||
if data.loginday == nil then
|
|
||||||
data.loginday = 1
|
|
||||||
print("[Tip] [PlatformSogou] 564336434----------------------------".. data.loginday)
|
|
||||||
end
|
|
||||||
SendSogouPlatformData(pActor)
|
|
||||||
--[[
|
|
||||||
local account = Actor.getAccount(pActor)
|
|
||||||
local aid = Actor.getActorId(pActor)
|
|
||||||
local now = os.time()
|
|
||||||
local key = "{FD11BC5B-A515-48E5-B09A-FAA45839292B}" -- {FD11BC5B-A515-48E5-B09A-FAA45839292B}
|
|
||||||
local sign = System.MD5(account, now, key)
|
|
||||||
local req = Api..'?gid='..account..'&uid='..aid..'&time='..now.."&sign="..string.upper(sign)
|
|
||||||
print("Require YYHallLogin[" .. Actor.getName(pActor) .. "] : ".. req)
|
|
||||||
AsyncWorkDispatcher.Add(
|
|
||||||
{'GetHttpContent',Host,Port,req},
|
|
||||||
AfterCheckYYHall,
|
|
||||||
{aid}
|
|
||||||
)
|
|
||||||
--]]
|
|
||||||
|
|
||||||
end
|
|
||||||
-- 跨天
|
|
||||||
function OnNewDayArrive(pActor,ndiffday)
|
|
||||||
print("[Tip] [PlatformSogou] OnNewDayArrive")
|
|
||||||
|
|
||||||
-- 平台验证
|
|
||||||
if not OnCheckSogouPlatform() then
|
|
||||||
print("[Tip] [PlatformSogou] -------------21321312312321is newday!")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
print("[Tip] [PlatformSogou] ------------000000000000000000000is newday!")
|
|
||||||
local currMiniTime = System.getCurrMiniTime()
|
|
||||||
--local data = get4366Data(pActor)
|
|
||||||
local data = getSogouPlatformData(pActor)--37平台数据
|
|
||||||
|
|
||||||
if data.lastLoginTime then
|
|
||||||
print("[Tip] [PlatformSogou] -----------------222------------------is newday!".. data.loginDay)
|
|
||||||
if not System.isSameDay(data.lastLoginTime, System.getCurrMiniTime()) then
|
|
||||||
data.lastLoginTime = System.getCurrMiniTime()
|
|
||||||
data.loginDay = data.loginDay + 1
|
|
||||||
|
|
||||||
print("[Tip] [PlatformSogou] ---------------333--------------------is newday!".. data.loginDay)
|
|
||||||
data.DataDailyGift = 0
|
|
||||||
end
|
|
||||||
|
|
||||||
SendSogouPlatformData(pActor)
|
|
||||||
else
|
|
||||||
|
|
||||||
data.lastLoginTime = System.getCurrMiniTime()
|
|
||||||
data.loginDay = 1
|
|
||||||
print("[Tip] [PlatformSogou] -------------3464646465444--------------------is newday!")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--领取手机绑定礼包
|
|
||||||
function OnClickSogouBindPhone(pActor, packet)
|
|
||||||
print("[Tip] [PlatformSogou] OnClickSogouBindPhone")
|
|
||||||
|
|
||||||
-- 平台验证
|
|
||||||
if not OnCheckSogouPlatform() then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local data = getSogouPlatformData(pActor)
|
|
||||||
if data == nil then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local name = Actor.getName(pActor)
|
|
||||||
|
|
||||||
if data.BINDPHONE == nil then
|
|
||||||
data.BINDPHONE = 0
|
|
||||||
end
|
|
||||||
|
|
||||||
if ActivityConfigPT.PhoneReward == nil then
|
|
||||||
print("[Tip] [PlatformSogou]没有此配置 SKIN_LOGIN Name = "..name)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if data.BINDPHONE > 0 then
|
|
||||||
print("[Tip] [PlatformSogou]SKIN_LOGIN 重复领取!Name = "..name)
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:奖励已领取|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor, bagLimit, tmLeftBagNumNotEnough, tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local AwardCfg = ActivityConfigPT.PhoneReward
|
|
||||||
if AwardCfg then
|
|
||||||
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType, ActivityType, 1)
|
|
||||||
CommonFunc.Awards.Give(pActor, AwardCfg, GameLog.Log_PlatformSoGou)
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType, ActivityType, 2)
|
|
||||||
|
|
||||||
--提示 要配
|
|
||||||
if ActivityConfigPT.tips then
|
|
||||||
Actor.sendTipmsg(pActor, ActivityConfigPT.tips, tstUI)
|
|
||||||
end
|
|
||||||
print("[Tip] [PlatformSogou] BINDPHONE Gift Success ")
|
|
||||||
data.BINDPHONE = data.BINDPHONE + 1
|
|
||||||
end
|
|
||||||
|
|
||||||
local npack = DataPack.allocPacket(pActor, enPlatforMwelfareID, sSogouGiftPhone)
|
|
||||||
if npack then
|
|
||||||
|
|
||||||
DataPack.writeByte(npack, 1) --领取成功
|
|
||||||
DataPack.flush(npack)
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
--领取皮肤登陆奖励
|
|
||||||
function OnClickSogouGiftSkin(pActor, packet)
|
|
||||||
print("[Tip] [PlatformSogou] OnClickSogouGiftSkin")
|
|
||||||
|
|
||||||
-- 平台验证
|
|
||||||
if not OnCheckSogouPlatform() then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local data = getSogouPlatformData(pActor)
|
|
||||||
if data == nil then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local name = Actor.getName(pActor)
|
|
||||||
|
|
||||||
if data.SKIN_LOGIN == nil then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if data.SkinData == 0 then
|
|
||||||
print("[Tip] [PlatformSogou] SkinData 登陆条件不满足 Name = "..name)
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:登陆条件不满足|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if ActivityConfigPT.reward1 == nil then
|
|
||||||
print("[Tip] [PlatformSogou]没有此配置 SKIN_LOGIN Name = "..name)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if data.SKIN_LOGIN > 0 then
|
|
||||||
print("[Tip] [PlatformSogou]SKIN_LOGIN 重复领取!Name = "..name)
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:奖励已领取|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor, bagLimit, tmLeftBagNumNotEnough, tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local AwardCfg = ActivityConfigPT.reward1
|
|
||||||
if AwardCfg then
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType, ActivityType, 1)
|
|
||||||
CommonFunc.Awards.Give(pActor, AwardCfg, GameLog.Log_PlatformSoGou)
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType, ActivityType, 2)
|
|
||||||
|
|
||||||
--提示 要配
|
|
||||||
if ActivityConfigPT.tips1 then
|
|
||||||
Actor.sendTipmsg(pActor, ActivityConfigPT.tips1, tstUI)
|
|
||||||
end
|
|
||||||
data.SKIN_LOGIN = data.SKIN_LOGIN + 1
|
|
||||||
print("[Tip] [PlatformSogou] SKIN_LOGIN Gift Success ")
|
|
||||||
end
|
|
||||||
|
|
||||||
local npack = DataPack.allocPacket(pActor, enPlatforMwelfareID, sSogouGiftSkin)
|
|
||||||
if npack then
|
|
||||||
|
|
||||||
DataPack.writeByte(npack, 1) --领取成功
|
|
||||||
DataPack.flush(npack)
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--37大厅登陆新手礼包
|
|
||||||
function OnClickGiftRookie(pActor, packet)
|
|
||||||
-- 平台验证
|
|
||||||
if not OnCheckSogouPlatform() then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local data = getSogouPlatformData(pActor)
|
|
||||||
if data == nil then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local name = Actor.getName(pActor)
|
|
||||||
|
|
||||||
if data.PLAZA_LOGIN == nil then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if data.PlazaData == 0 then
|
|
||||||
print("[Tip] [PlatformSogou] PlazaData登陆条件不满足 Name = "..name)
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:登陆条件不满足|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if ActivityConfigPT.reward2 == nil then
|
|
||||||
print("[Tip] [PlatformSogou]没有此配置 OnClickGiftRookie Name = "..name)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if data.PLAZA_LOGIN > 0 then
|
|
||||||
print("[Tip] [PlatformSogou]GiftFCM 重复领取!Name = "..name)
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:奖励已领取|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor, bagLimit, tmLeftBagNumNotEnough, tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local AwardCfg = ActivityConfigPT.reward2
|
|
||||||
if AwardCfg then
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType,ActivityType,1)
|
|
||||||
CommonFunc.Awards.Give(pActor, AwardCfg, GameLog.Log_PlatformSoGou)
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType, ActivityType, 2)
|
|
||||||
--提示 要配
|
|
||||||
if ActivityConfigPT.tips2 then
|
|
||||||
Actor.sendTipmsg(pActor, ActivityConfigPT.tips2, tstUI)
|
|
||||||
end
|
|
||||||
|
|
||||||
data.PLAZA_LOGIN = data.PLAZA_LOGIN + 1
|
|
||||||
print("[Tip] [PlatformSogou] OnClickGiftRookie Success ")
|
|
||||||
end
|
|
||||||
local npack = DataPack.allocPacket(pActor, enPlatforMwelfareID, sSogouGiftRookie)
|
|
||||||
if npack then
|
|
||||||
|
|
||||||
DataPack.writeByte(npack, 1) --领取成功
|
|
||||||
DataPack.flush(npack)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--登陆礼包
|
|
||||||
function OnClickGiftLogin(pActor, packet)
|
|
||||||
local nIndex = DataPack.readByte(packet);
|
|
||||||
print("[Tip] [PlatformSogou] OnClickGiftLogin :".. nIndex)
|
|
||||||
-- 平台验证
|
|
||||||
if not OnCheckSogouPlatform() then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local name = Actor.getName(pActor)
|
|
||||||
|
|
||||||
local PlatformData = getSogouPlatformData(pActor)
|
|
||||||
if PlatformData == nil then
|
|
||||||
print("[Tip] [PlatformSogou] error data :".. nIndex)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if nIndex >= 32 then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此选项1|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local LocalCfg = ActivityConfigLg
|
|
||||||
if LocalCfg == nil then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此选项2|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local Cfg = LocalCfg[nIndex]
|
|
||||||
if Cfg == nil then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此选项3|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if Cfg.reward == nil then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此奖励4|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
--local nIndex = DataPack.readByte(packet)
|
|
||||||
if nIndex > #LocalCfg then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此选项5|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if PlatformData.loginday == nil then
|
|
||||||
PlatformData.loginday = 1
|
|
||||||
end
|
|
||||||
|
|
||||||
local count = 0
|
|
||||||
local Idlocal = 0
|
|
||||||
local CfgTmp = LocalCfg
|
|
||||||
if CfgTmp then
|
|
||||||
--print("[Tip] [PlatformSogou] 222error ddata.Vip :".. PlatformData.Vip )
|
|
||||||
for key, value in pairs(CfgTmp) do
|
|
||||||
|
|
||||||
print("[Tip] [PlatformSogou] loginday data :".. key .. ":"..value.day .. ":"..Idlocal)
|
|
||||||
if value.day > PlatformData.loginday then
|
|
||||||
--Actor.sendTipmsg(pActor, "|C:0xf56f00&T:不满足条件|", tstUI)
|
|
||||||
--return
|
|
||||||
elseif nIndex == key and value.day <= PlatformData.loginday then
|
|
||||||
Idlocal = key
|
|
||||||
|
|
||||||
break
|
|
||||||
else
|
|
||||||
end
|
|
||||||
count = count + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
print("[Tip] [PlatformSogou] loginday data :".. nIndex .. ":"..PlatformData.loginday .. ":"..Idlocal)
|
|
||||||
local Cfg = LocalCfg[Idlocal]
|
|
||||||
if Cfg == nil then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此选项6|", tstUI)
|
|
||||||
print("[Tip] [PlatformSogou] 222er212321ror 无此选项6 :")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if Cfg.reward == nil then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此奖励7|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor, bagLimit, tmLeftBagNumNotEnough, tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local AwardCfg = Cfg.reward
|
|
||||||
if AwardCfg then
|
|
||||||
-- 领取检查
|
|
||||||
local flag = System.getIntBit(PlatformData.DataDailyGift, nIndex - 1)
|
|
||||||
if flag == 1 then
|
|
||||||
print("[Tip] [PlatformSogou]DailyGift 重复领取!Name = "..name)
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:奖励已领取|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType,ActivityType,1)
|
|
||||||
CommonFunc.Awards.Give(pActor, AwardCfg, GameLog.Log_PlatformSoGou)
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType, ActivityType, 2)
|
|
||||||
--提示 要配
|
|
||||||
if Cfg.tips then
|
|
||||||
Actor.sendTipmsg(pActor, Cfg.tips, tstUI)
|
|
||||||
end
|
|
||||||
|
|
||||||
PlatformData.DataDailyGift = System.setIntBit(PlatformData.DataDailyGift, nIndex - 1, 1) --将indexId位置置为1
|
|
||||||
|
|
||||||
--print("[Tip] [PlatformSogou] ----4------DataDailyGift---::".. PlatformData.DataDailyGift)
|
|
||||||
end
|
|
||||||
local npack = DataPack.allocPacket(pActor, enPlatforMwelfareID, sSogouGiftLogin)
|
|
||||||
if npack then
|
|
||||||
DataPack.writeByte(npack, 1) --领取成功
|
|
||||||
DataPack.writeUInt(npack, PlatformData.DataDailyGift)
|
|
||||||
DataPack.flush(npack)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--37等级礼包
|
|
||||||
function OnClickGiftLevel(pActor, packet)
|
|
||||||
local nIndex = DataPack.readByte(packet);
|
|
||||||
print("[Tip] [PlatformSogou] OnClickGiftLevel :".. nIndex)
|
|
||||||
-- 平台验证
|
|
||||||
if not OnCheckSogouPlatform() then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local PlatformData = getSogouPlatformData(pActor)
|
|
||||||
if PlatformData == nil then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local name = Actor.getName(pActor)
|
|
||||||
|
|
||||||
if nIndex >= 32 then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此选项1|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local LocalCfg = ActivityConfigLv
|
|
||||||
if LocalCfg == nil then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此选项2|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local Cfg = LocalCfg[nIndex]
|
|
||||||
if Cfg == nil then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此选项3|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if Cfg.reward == nil then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此奖励4|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
--local nIndex = DataPack.readByte(packet)
|
|
||||||
if nIndex > #LocalCfg then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此选项5|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local lv = Actor.getIntProperty( pActor, PROP_CREATURE_LEVEL )
|
|
||||||
|
|
||||||
local count = 0
|
|
||||||
local Idlocal = 0
|
|
||||||
local CfgTmp = LocalCfg
|
|
||||||
if CfgTmp then
|
|
||||||
for key, value in pairs(CfgTmp) do
|
|
||||||
print("[Tip] [PlatformSogou] ----2------DataLevelGift---:key:".. key.. ":"..value.level)
|
|
||||||
if value.level > lv then
|
|
||||||
elseif nIndex == nIndex and value.level <= lv then
|
|
||||||
Idlocal = key
|
|
||||||
break
|
|
||||||
else
|
|
||||||
end
|
|
||||||
count = count + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local Cfg = LocalCfg[Idlocal]
|
|
||||||
if Cfg == nil then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此选项6|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if Cfg.reward == nil then
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:无此奖励7|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if CommonFunc.Awards.CheckBagIsEnough(pActor, bagLimit, tmLeftBagNumNotEnough, tstUI) ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local AwardCfg = Cfg.reward
|
|
||||||
if AwardCfg then
|
|
||||||
-- 领取检查
|
|
||||||
local flag = System.getIntBit(PlatformData.DataLevelGift, nIndex - 1)
|
|
||||||
if flag == 1 then
|
|
||||||
print("[Tip] [PlatformSogou]LevelDaily 重复领取!Name = "..name)
|
|
||||||
Actor.sendTipmsg(pActor, "|C:0xf56f00&T:奖励已领取|", tstUI)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType,ActivityType,1)
|
|
||||||
CommonFunc.Awards.Give(pActor, AwardCfg, GameLog.Log_PlatformSoGou)
|
|
||||||
--Actor.SendActivityLog(pActor, ActivityType, ActivityType, 2)
|
|
||||||
--提示 要配
|
|
||||||
if Cfg.tips then
|
|
||||||
Actor.sendTipmsg(pActor, Cfg.tips, tstUI)
|
|
||||||
end
|
|
||||||
|
|
||||||
PlatformData.DataLevelGift = System.setIntBit(PlatformData.DataLevelGift, nIndex - 1, 1) --将indexId位置置为1
|
|
||||||
|
|
||||||
end
|
|
||||||
local npack = DataPack.allocPacket(pActor, enPlatforMwelfareID, sSogouGiftLevel)
|
|
||||||
if npack then
|
|
||||||
DataPack.writeByte(npack, 1) --领取成功
|
|
||||||
DataPack.writeUInt(npack, PlatformData.DataLevelGift)
|
|
||||||
DataPack.flush(npack)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function OnClickGiftLogin2222(pActor, packet)
|
|
||||||
local data = getSogouPlatformData(pActor)
|
|
||||||
if data == nil then
|
|
||||||
print("[Tip]---------------------------212121-------------")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
data.PlazaData = 0
|
|
||||||
data.SkinData = 0
|
|
||||||
--data.DataLevelGift = 0
|
|
||||||
--data.DataDailyGift = 0
|
|
||||||
data.loginday = 12
|
|
||||||
|
|
||||||
|
|
||||||
-- 活动结束
|
|
||||||
local Cfg = ActivityConfigPT
|
|
||||||
--if Cfg == nil then
|
|
||||||
local data = getActorCdkData(pActor)
|
|
||||||
if data then
|
|
||||||
if data.codeTypeTimes then
|
|
||||||
if data.codeTypeTimes[Cfg.CDkeytype] then
|
|
||||||
data.WEINXIN_LOGIN = 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
--end
|
|
||||||
|
|
||||||
print("[Tip] [PlatformSogou]init data")
|
|
||||||
SendSogouPlatformData(pActor)
|
|
||||||
OnClickSogouBindPhone(pActor, packet)
|
|
||||||
end
|
|
||||||
|
|
||||||
--登陆
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, cSogouGiftPhone, OnClickSogouBindPhone)--搜狗手机绑定礼包
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, cSogouGiftSkin, OnClickSogouGiftSkin)--搜狗皮肤登陆
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, cSogouGiftRookie, OnClickGiftRookie)--搜狗新手礼包
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, cSogouGiftLogin, OnClickGiftLogin)--搜狗登陆礼包
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, cSogouGiftLevel, OnClickGiftLevel)--搜狗等级礼包
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NetmsgDispatcher.Reg(enPlatforMwelfareID, cSogouLogon, OnSogouLogon)--搜狗登陆
|
|
||||||
|
|
||||||
--测试
|
|
||||||
--NetmsgDispatcher.Reg(enMiscSystemID, cBuyMonthCard, OnClickGiftLogin2222)--37每日礼包
|
|
||||||
|
|
||||||
ActorEventDispatcher.Reg(aeNewDayArrive, OnNewDayArrive, "PlatformSoGouGift.lua")
|
|
||||||
Reference in New Issue
Block a user