From c89dcae68db3ab000355062b9f37384be5406024 Mon Sep 17 00:00:00 2001 From: kubbo <390378816@qq.com> Date: Sun, 23 Feb 2025 17:37:05 +0800 Subject: [PATCH] =?UTF-8?q?refactor(YYPlatform):=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E4=B8=8EYY=E5=B9=B3=E5=8F=B0=E7=9B=B8=E5=85=B3=E7=9A=84?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=92=8C=E6=B4=BB=E5=8A=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了GameVIPConfig、YYMemberConfig和YYVIPConfig三个配置文件 - 删除了ActivityType10011和ActivityType10012两个活动的实现代码 - 清除了与YY平台福利相关的所有逻辑和数据结构 --- .../config/YYPlatform/GameVIPConfig.config | 36 -- .../config/YYPlatform/YYMemberConfig.config | 38 -- .../data/config/YYPlatform/YYVIPConfig.config | 28 -- .../functions/Activity/ActivityType10011.lua | 274 ------------- .../functions/Activity/ActivityType10012.lua | 384 ------------------ .../functions/Activity/ActivityType10013.lua | 289 ------------- .../data/functions/Activity/Activitys.txt | 4 - LogicServer/data/functions/GameConfigs.txt | 5 - 8 files changed, 1058 deletions(-) delete mode 100755 LogicServer/data/config/YYPlatform/GameVIPConfig.config delete mode 100755 LogicServer/data/config/YYPlatform/YYMemberConfig.config delete mode 100755 LogicServer/data/config/YYPlatform/YYVIPConfig.config delete mode 100755 LogicServer/data/functions/Activity/ActivityType10011.lua delete mode 100755 LogicServer/data/functions/Activity/ActivityType10012.lua delete mode 100755 LogicServer/data/functions/Activity/ActivityType10013.lua diff --git a/LogicServer/data/config/YYPlatform/GameVIPConfig.config b/LogicServer/data/config/YYPlatform/GameVIPConfig.config deleted file mode 100755 index 872be5c..0000000 --- a/LogicServer/data/config/YYPlatform/GameVIPConfig.config +++ /dev/null @@ -1,36 +0,0 @@ ---P-平台福利YY.xlsx 超玩俱乐部 -GameVIPConfig={ - host = "proxy.udblogin.game.yy.com", - port = "80", - api = "/query/cwVipInfo.do", - vipMap = {[1]=2,[2]=6,[3]=9}, - vipGift = { -[1]={{type=0,id=261,count=3},{type=0,id=421,count=3},{type=7,id=7,count=3},{type=0,id=247,count=3}}, -[2]={{type=0,id=261,count=3},{type=0,id=421,count=3},{type=7,id=7,count=3},{type=0,id=247,count=3}}, -[3]={{type=0,id=261,count=5},{type=0,id=269,count=10},{type=0,id=904,count=1},{type=0,id=914,count=1}}, -}, - VIPTitle = "超玩俱乐部会员礼包", - VIPContent = "恭喜你领取了超玩俱乐部会员专属礼包", - dailyGift = { -[1]={{type=0,id=247,count=5},{type=2,id=2,count=3000},{type=5,id=5,count=1000}}, -[2]={{type=0,id=247,count=5},{type=2,id=2,count=4000},{type=5,id=5,count=2000}}, -[3]={{type=0,id=247,count=5},{type=2,id=2,count=5000},{type=5,id=5,count=3000}}, -}, - VIPDailyTitle = "超玩俱乐部会员每日礼包", - VIPDailyContent = "恭喜你领取了超玩俱乐部会员专属礼包", - GameVIPbuff = { -[1]={buffid=0}, -[2]={buffid=0}, -[3]={buffid=0} -}, - vipGiftDisplay = { -[1]={index=1,viplvl=1,rewards={{type=0,id=261,count=3},{type=0,id=421,count=3},{type=7,id=7,count=3},{type=0,id=247,count=3}}}, -[2]={index=2,viplvl=1,rewards={{type=0,id=261,count=3},{type=0,id=421,count=3},{type=7,id=7,count=3},{type=0,id=247,count=3}}}, -[3]={index=3,viplvl=3,rewards={{type=0,id=261,count=5},{type=0,id=269,count=10},{type=0,id=904,count=1},{type=0,id=914,count=1}}}, -}, - dailyGiftDisplay = { -[1]={index=1,viplvl=2,rewards={{type=0,id=247,count=5},{type=2,id=2,count=3000},{type=5,id=5,count=1000}}}, -[2]={index=2,viplvl=6,rewards={{type=0,id=247,count=5},{type=2,id=2,count=4000},{type=5,id=5,count=2000}}}, -[3]={index=3,viplvl=9,rewards={{type=0,id=247,count=5},{type=2,id=2,count=5000},{type=5,id=5,count=3000}}}, -}, -} \ No newline at end of file diff --git a/LogicServer/data/config/YYPlatform/YYMemberConfig.config b/LogicServer/data/config/YYPlatform/YYMemberConfig.config deleted file mode 100755 index 4a91c92..0000000 --- a/LogicServer/data/config/YYPlatform/YYMemberConfig.config +++ /dev/null @@ -1,38 +0,0 @@ ---P-平台福利YY.xlsx YY大厅特权 -YYMemberConfig={ - host = "proxy.udblogin.game.yy.com", - port = "80", - api = "/yy/lobbygift/query/queryInfo.do", - freshmanGift = {{type=0,id=247,count=5},{type=7,id=7,count=3},{type=0,id=261,count=2},{type=2,id=2,count=20000}}, - fgTitle = "YY大厅新手礼包", - fgContent = "恭喜你领取了YY大厅新手礼包", - loginGift = { -[1]={{type=0,id=269,count=1},{type=7,id=7,count=2},{type=2,id=2,count=10000}}, -[2]={{type=0,id=421,count=1},{type=7,id=7,count=3},{type=2,id=2,count=10000}}, -[3]={{type=0,id=261,count=1},{type=7,id=7,count=3},{type=2,id=2,count=10000}}, -[4]={{type=0,id=269,count=2},{type=7,id=7,count=4},{type=2,id=2,count=10000}}, -[5]={{type=0,id=421,count=2},{type=7,id=7,count=4},{type=2,id=2,count=10000}}, -[6]={{type=0,id=261,count=2},{type=7,id=7,count=5},{type=2,id=2,count=10000}}, -[7]={{type=0,id=421,count=3},{type=7,id=7,count=5},{type=2,id=2,count=10000}}, -}, - logTitle = "YY大厅登录礼包", - logContent = "你已通过YY大厅登录超过了%d天,领取了YY大厅登录礼包", - levelGift = { -[1]={lvl=42,awards={{type=0,id=247,count=2},{type=7,id=7,count=2},{type=2,id=2,count=20000}}}, -[2]={lvl=49,awards={{type=0,id=247,count=3},{type=7,id=7,count=2},{type=2,id=2,count=20000}}}, -[3]={lvl=55,awards={{type=0,id=247,count=4},{type=7,id=7,count=2},{type=2,id=2,count=20000}}}, -[4]={lvl=65,awards={{type=0,id=247,count=5},{type=0,id=853,count=2},{type=2,id=2,count=20000}}}, -[5]={lvl=75,awards={{type=0,id=247,count=6},{type=0,id=365,count=1},{type=2,id=2,count=20000}}}, -[6]={lvl=85,awards={{type=0,id=247,count=6},{type=0,id=365,count=1},{type=2,id=2,count=20000}}}, -[7]={lvl=95,awards={{type=0,id=247,count=6},{type=0,id=365,count=1},{type=2,id=2,count=20000}}}, -}, - lvgTitle = "YY大厅等级礼包", - nobleGift = { -[1]={{type=0,id=261,count=5},{type=0,id=854,count=3},{type=2,id=2,count=10000}}, -[2]={{type=0,id=261,count=5},{type=0,id=854,count=3},{type=2,id=2,count=10000}}, -[3]={{type=0,id=261,count=5},{type=0,id=854,count=3},{type=2,id=2,count=10000}}, -}, - ngTitle = "YY大厅贵族礼包", - lvgContent = "你的等级已达到了%d级,领取了YY大厅等级礼包", - ngContent = "你的身份为%s,领取了YY大厅贵族礼包", -} \ No newline at end of file diff --git a/LogicServer/data/config/YYPlatform/YYVIPConfig.config b/LogicServer/data/config/YYPlatform/YYVIPConfig.config deleted file mode 100755 index 10ea7dd..0000000 --- a/LogicServer/data/config/YYPlatform/YYVIPConfig.config +++ /dev/null @@ -1,28 +0,0 @@ ---P-平台福利YY.xlsx YY会员 -YYVIPConfig={ - host = "proxy.udblogin.game.yy.com", - port = "80", - api = "/query/yyVipInfo.do", - newServerGift = { -[1]={viplvl=1,title={type=16,id=7,count=1},gift={type=0,id=481,count=1}}, -[2]={viplvl=4,title={type=16,id=8,count=1},gift={type=0,id=482,count=1}}, -[3]={viplvl=7,title={type=16,id=9,count=1},gift={type=0,id=483,count=1}}, -}, - nsTitle = "YY会员新服豪礼", - nsContent = "领取了YY会员新服豪礼", - weeklyGift = { -[1]={yb=160,viplvl=1,gift={type=0,id=487,count=1}}, -[2]={yb=188,viplvl=4,gift={type=0,id=488,count=1}}, -[3]={yb=288,viplvl=7,gift={type=0,id=489,count=1}}, -}, - wgTitle = "YY会员专属每周礼包", - wgContent = "这是您购买的YY会员专属每周礼包,请收下", - dailyGift = { -[1]={yb=17,viplvl=1,item={type=0,id=484,count=1}}, -[2]={yb=20,viplvl=4,item={type=0,id=485,count=1}}, -[3]={yb=35,viplvl=7,item={type=0,id=486,count=1}}, -}, - dgTitle = "YY会员专属每日礼包", - dgContent = "这是您购买的YY会员专属每日礼包,请收下", - SPID = "dudu", -} \ No newline at end of file diff --git a/LogicServer/data/functions/Activity/ActivityType10011.lua b/LogicServer/data/functions/Activity/ActivityType10011.lua deleted file mode 100755 index f99508e..0000000 --- a/LogicServer/data/functions/Activity/ActivityType10011.lua +++ /dev/null @@ -1,274 +0,0 @@ -module("ActivityType10011", package.seeall) - ---[[ - 个人活动(玩法),YY大厅特权 - - 个人数据:YYHallAtv - { - yydata = 0 YY大厅身份 1平民2贵族3王室 - freshmanGift = 0/1 是否领取YY大厅新手礼包(0否,1是) - lastLoginTime = 0 上一次通过YY大厅登录的时间戳 - loginDay = 1 通过YY大厅登录的累计天数 - loginGift = 00000000 32位 是否领取某天的登录礼包 - levelGift = 00000000 32位 是否领取第n个等级礼包 - nobleGift = 00000000 32位 是否领取贵族礼包 1平民 2贵族 3王室 - } -]]-- - ---活动类型 -ActivityType = 10011 ---对应的活动配置 -ActivityConfig = YYMemberConfig -if ActivityConfig == nil then - assert(false) -end - -local HttpStatus = { - Success = "200", -- 成功 - ArgError = "302", -- 参数错误 - SignError = "304", -- 签名错误 - LinkLost = "305", -- 链接失效 - IpLimit = "306", -- IP受限 - AccountNotExits = "600", -- 账号不存在 - UnKnownedError = "299" -- 未知错误 -} - --- 服务接口 -Host = ActivityConfig.host or "proxy.udblogin.game.yy.com" -Port = ActivityConfig.port or "80" -Api = ActivityConfig.api or "/yy/lobbygift/query/queryInfo.do" - -function getData(pActor) - local var = Actor.getStaticVar(pActor) - if var.YYHallAtv== nil then - var.YYHallAtv = {} - end - return var.YYHallAtv -end - -function SendData(pActor,lvldata) - - --对于lvldata不是 1 2 3 这三个指定数值的直接返回 - -- if not (lvldata and (lvldata ==1 or lvldata == 2 or lvldata == 3 )) then - -- return - -- end - - local npack = DataPack.allocPacket(pActor, enActivityID, sYYHallData) - if npack then - local data = getData(pActor) - data.yydata = lvldata - DataPack.writeByte(npack, lvldata) --YY身份 1平民 2贵族 3王室 - DataPack.writeByte(npack, (data.freshmanGift or 0)) --是否已领取YY大厅新手礼包 0否1是 - DataPack.writeShort(npack, (data.loginDay or 1))--通过YY大厅登录的天数 - DataPack.writeUInt(npack, (data.loginGift or 0))--登录礼包的领取标记 32 位 - DataPack.writeUInt(npack, (data.levelGift or 0))--等级礼包的领取标记 32 位 - DataPack.writeUInt(npack, (data.nobleGift or 0))--贵族礼包的领取标记 32 位 - DataPack.flush(npack) - end -end - -function AfterCheckYYHall(paramPack,content,result) - local aid = paramPack[1] - local pActor = Actor.getActorById(aid) - if not pActor then - print("[AfterCheckYYHall][" .. aid .. "] 已离线") - return - end - print("[AfterCheckYYHall][" .. Actor.getName(pActor) .. "] content:"..content) - print("[AfterCheckYYHall]result:"..result) - - if result == 0 then - local data = string.match(content,"\"data\":(%d+)") - local status = string.match(content,"\"status\":(%d+)") - if status == HttpStatus.Success then - SendData(pActor,tonumber(data)) - end - end -end - --------------------------------------------------------------------- --- CPP回调 --------------------------------------------------------------------- - -function OnYYHallLogin(pActor) - local account = Actor.getAccount(pActor) - local aid = Actor.getActorId(pActor) - local now = os.time() - local gameflag = System.getGameFlag() or "DDCQ" - local key = System.getYYKey() - local sign = System.MD5(gameflag,account,"1001",now,key) - local req = Api..'?account='..account..'&game='..gameflag..'&taskId=1001&time='..now.."&sign="..string.upper(sign) - print("Require YYHallLogin[" .. Actor.getName(pActor) .. "] : ".. req) - AsyncWorkDispatcher.Add( - {'GetHttpContent',Host,Port,req}, - AfterCheckYYHall, - {aid} - ) - - -- 当天初始化 - local data = getData(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 -end - --------------------------------------------------------------------- --- 客户端请求协议回调 --------------------------------------------------------------------- - -function OnReqYYHallFreshManGift(pActor, packet) - local idx = DataPack.readByte(packet) - local awards = ActivityConfig.freshmanGift - local data = getData(pActor) - local aid = Actor.getActorId(pActor) - if data.lastLoginTime then - Actor.SendActivityLog(pActor,ActivityType,ActivityType,1) - if (data.freshmanGift == nil) or (data.freshmanGift == 0) then - data.freshmanGift = 1 - SendMail(aid, ActivityConfig.fgTitle or "YY大厅新手礼包", ActivityConfig.fgContent or "恭喜你领取了YY大厅新手礼包!", ActivityConfig.freshmanGift) - SendData(pActor,data.yydata) - end - Actor.SendActivityLog(pActor,ActivityType,ActivityType,2) - end -end - -function OnReqYYHallLoginGift(pActor, packet) - local idx = DataPack.readByte(packet) - if (idx > 30) or (idx == 0) then - return - end - if idx > #ActivityConfig.loginGift then - return - end - local awards = ActivityConfig.loginGift[idx] - idx = idx - 1 - local data = getData(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 and (data.loginDay > idx )then - Actor.SendActivityLog(pActor,ActivityType,ActivityType,1) - local aid = Actor.getActorId(pActor) - data.loginGift = System.setIntBit(data.loginGift, idx, true) - local mailcontent = string.format( ActivityConfig.logContent or "你已通过YY大厅登录超过了%d天,领取了YY大厅登录礼包!" , data.loginDay) - SendMail(aid, ActivityConfig.logTitle or "YY大厅登录礼包", mailcontent, awards) - SendData(pActor,data.yydata) - Actor.SendActivityLog(pActor,ActivityType,ActivityType,2) - end - end -end - -function OnReqYYHallLevelGift(pActor, packet) - local idx = DataPack.readByte(packet) - if idx > #ActivityConfig.levelGift then - return - end - local conf = ActivityConfig.levelGift[idx] - local awards = conf.awards - idx = idx - 1 - local data = getData(pActor) - if conf and data.lastLoginTime then - -- 领取检查 - if not data.levelGift then - data.levelGift = 0 - end - local flag = System.getIntBit(data.levelGift, idx) - if flag == 1 then - return - end - -- 等级检查 - local lvl = Actor.getIntProperty(pActor,PROP_CREATURE_LEVEL) - if lvl >= conf.lvl then - Actor.SendActivityLog(pActor,ActivityType,ActivityType,1) - local aid = Actor.getActorId(pActor) - data.levelGift = System.setIntBit(data.levelGift, idx, true) - local mailcontent = string.format( ActivityConfig.lvgContent or "你的等级已达到了%d级,领取了YY大厅等级礼包!" , conf.lvl) - SendMail(aid, ActivityConfig.lvgTitle or "YY大厅等级礼包", mailcontent, awards) - SendData(pActor,data.yydata) - Actor.SendActivityLog(pActor,ActivityType,ActivityType,2) - end - end -end - -YYIdentity = {[1]="平民",[2]="贵族",[3]="王室"} - -function OnReqYYHallNobleGift(pActor, packet) - local idx = DataPack.readByte(packet) - if idx > #ActivityConfig.nobleGift then - return - end - if idx > #YYIdentity then - return - end - local awards = ActivityConfig.nobleGift[idx] - idx = idx - 1 - local data = getData(pActor) - if awards and data.lastLoginTime then - -- 领取检查 - if not data.nobleGift then - data.nobleGift = 0 - end - local flag = System.getIntBit(data.nobleGift, idx) - if flag == 1 then - return - end - -- 身份检查 - if data.yydata > idx then - Actor.SendActivityLog(pActor,ActivityType,ActivityType,1) - local aid = Actor.getActorId(pActor) - data.nobleGift = System.setIntBit(data.nobleGift, idx, true) - local mailcontent = string.format( ActivityConfig.ngContent or "你的身份为%s,领取了YY大厅贵族礼包!" , YYIdentity[idx+1]) - SendMail(aid, ActivityConfig.ngTitle or "YY大厅等级礼包", mailcontent, awards) - SendData(pActor,data.yydata) - Actor.SendActivityLog(pActor,ActivityType,ActivityType,2) - end - end -end - -NetmsgDispatcher.Reg(enActivityID, cReqYYHallFreshManGift, OnReqYYHallFreshManGift) -NetmsgDispatcher.Reg(enActivityID, cReqYYHallLoginGift, OnReqYYHallLoginGift) -NetmsgDispatcher.Reg(enActivityID, cReqYYHallLevelGift, OnReqYYHallLevelGift) -NetmsgDispatcher.Reg(enActivityID, cReqYYHallNobleGift, OnReqYYHallNobleGift) - --------------------------------------------------------------------- --- 玩家 回调注册 --------------------------------------------------------------------- - --- 跨天 -function OnNewDayArrive(pActor,ndiffday) - local currMiniTime = System.getCurrMiniTime() - local data = getData(pActor) - if data.lastLoginTime then - if not System.isSameDay(data.lastLoginTime, System.getCurrMiniTime()) then - data.lastLoginTime = System.getCurrMiniTime() - data.loginDay = data.loginDay + 1 - end - - SendData(pActor,data.yydata) - end -end - -function OnUserLogout(pActor,actorId) - if pActor ==nil then return end - local data = getData(pActor) - data.yydata =nil -end - -ActorEventDispatcher.Reg(aeNewDayArrive, OnNewDayArrive, "ActivityType10011.lua") -ActorEventDispatcher.Reg(aeUserLogout, OnUserLogout, "ActivityType10011.lua") diff --git a/LogicServer/data/functions/Activity/ActivityType10012.lua b/LogicServer/data/functions/Activity/ActivityType10012.lua deleted file mode 100755 index c3407e7..0000000 --- a/LogicServer/data/functions/Activity/ActivityType10012.lua +++ /dev/null @@ -1,384 +0,0 @@ -module("ActivityType10012", package.seeall) - ---[[ - 个人活动(玩法),YY会员 - - 个人数据:YYVIPeople - { - isVip = true/false, 是否为YY会员 - grade = 0, vip等级 - endTime = 0, vip过期时间戳 - lastTime = 0 上一次初始化的时间戳 - newServerGift = 00000000 32位 是否领取第n个新服豪礼 - dailyGift = 00000000 32位 是否领取第n个每日礼包 - weeklyGift = 00000000 32位 是否领取第n个每周礼包 - } -]]-- - ---活动类型 -ActivityType = 10012 ---对应的活动配置 -ActivityConfig = YYVIPConfig -PlatformConfig = YYVIPConfig -local PfId = System.getPfId() - - -if ActivityConfig == nil then - assert(false) -end - -local HttpStatus = { - Success = "200", -- 成功 - ArgError = "302", -- 参数错误 - SignError = "304", -- 签名错误 - LinkLost = "305", -- 链接失效 - IpLimit = "306", -- IP受限 - AccountNotExits = "600", -- 账号不存在 - UnKnownedError = "299" -- 未知错误 -} - --- 服务接口 -Host = ActivityConfig.host or "proxy.udblogin.game.yy.com" -Port = ActivityConfig.port or "80" -Api = ActivityConfig.api or "/query/yyVipInfo.do" - -function getData(pActor) - local var = Actor.getStaticVar(pActor) - if var.YYVIPeople== nil then - var.YYVIPeople = {} - end - return var.YYVIPeople -end - -function SendData(pActor) - if PfId ~= nil and PlatformConfig.SPID ~= nil then - --print("[Tip] [YYVIP] SendData ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID) - if tostring(PfId) ~= tostring(PlatformConfig.SPID) then - - print("[Tip] [YYVIP] [非本平台活动]") - return --非本平台活动 - end - end - local npack = DataPack.allocPacket(pActor, enActivityID, sYYVipData) - if npack then - local data = getData(pActor) - DataPack.writeByte(npack, (data.isVip or 0)) -- 是否为VIP 0否1是 - DataPack.writeByte(npack, (data.grade or 1)) -- vip等级 - DataPack.writeInt64(npack, (data.endTime or 0)) -- 过期时间戳 - DataPack.writeUInt(npack, (data.newServerGift or 0))-- 32位 是否领取第n个新服豪礼 - DataPack.writeUInt(npack, (data.dailyGift or 0)) -- 32位 是否领取第n个每日礼包 - DataPack.writeUInt(npack, (data.weeklyGift or 0)) -- 32位 是否领取第n个每周礼包 - DataPack.flush(npack) - end -end - -function AfterCheckYYLogin(paramPack,content,result) - if PfId ~= nil and PlatformConfig.SPID ~= nil then - --print("[Tip] [YYVIP] SendData ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID) - if tostring(PfId) ~= tostring(PlatformConfig.SPID) then - - print("[Tip] [YYVIP] [非本平台活动]") - return --非本平台活动 - end - end - local aid = paramPack[1] - local pActor = Actor.getActorById(aid) - if not pActor then - print("[AfterCheckYYLogin][" .. aid .. "] 已离线") - return - end - print("[AfterCheckYYLogin][" .. Actor.getName(pActor) .. "] content:"..content) - print("[AfterCheckYYLogin]result:"..result) - - if result == 0 then - local status = string.match(content,"\"status\":(%d+)") - if (status == HttpStatus.Success) then - local isvip = string.match(content,"\"isVip\":(%a+)") - local grade = string.match(content,"\"grade\":(%d+)") - local endTime = string.match(content,"\"endTime\":(%a+)") - if isvip == "true" then - isvip = 1 - else - isvip = 0 - end - grade = tonumber(grade) - if endTime ~= "null" then - endTime = tonumber(endTime) - else - endTime = 0 - end - local data = getData(pActor) - data.isVip = isvip - data.grade = grade - data.endTime = endTime - SendData(pActor) - end - end -end - --------------------------------------------------------------------- --- CPP回调 --------------------------------------------------------------------- - -function OnYYLogin(pActor) - if PfId ~= nil and PlatformConfig.SPID ~= nil then - --print("[Tip] [YYVIP] SendData ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID) - if tostring(PfId) ~= tostring(PlatformConfig.SPID) then - - print("[Tip] [YYVIP] [非本平台活动]") - return --非本平台活动 - end - end - local account = Actor.getAccount(pActor) - local aid = Actor.getActorId(pActor) - local now = os.time() - local gameflag = System.getGameFlag() or "DDCQ" - local key = System.getYYKey() - local sign = System.MD5(gameflag,account,now,key) - local req = Api..'?game='..gameflag..'&account='..account..'&ts='..now.."&sign="..string.upper(sign) - print("Require OnYYLogin[" .. Actor.getName(pActor) .. "] : ".. req) - AsyncWorkDispatcher.Add( - {'GetHttpContent',Host,Port,req}, - AfterCheckYYLogin, - {aid} - ) - - -- 当天初始化 - local currMiniTime = System.getCurrMiniTime() - local data = getData(pActor) - if data.lastTime == nil then - data.lastTime = currMiniTime - data.newServerGift = 0 - data.dailyGift = 0 - data.weeklyGift = 0 - --print("第一天") - else - if not System.isSameDay(data.lastTime, currMiniTime) then - --print("跨一天") - if System.isSameWeek(data.lastTime, currMiniTime) then - --print("跨一周") - data.weeklyGift = 0 - end - data.lastTime = currMiniTime - data.dailyGift = 0 - end - end -end - --------------------------------------------------------------------- --- 客户端请求协议回调 --------------------------------------------------------------------- - -function OnReqYYVIPNewSrvGift(pActor, packet) - if PfId ~= nil and PlatformConfig.SPID ~= nil then - --print("[Tip] [YYVIP] SendData ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID) - if tostring(PfId) ~= tostring(PlatformConfig.SPID) then - - print("[Tip] [YYVIP] [非本平台活动]") - return --非本平台活动 - end - end - local idx = DataPack.readByte(packet) - if idx > (2 * #ActivityConfig.newServerGift) then - return - end - local confid = math.ceil(idx/2) - local conf = ActivityConfig.newServerGift[confid] - - local istitle = (idx%2 == 1) - - idx = idx - 1 - local data = getData(pActor) - - if conf and data.lastTime then - - -- 领取检查 - if not data.newServerGift then - data.newServerGift = 0 - end - local flag = System.getIntBit(data.newServerGift, idx) - print("newServerGift="..data.newServerGift.." flag="..flag) - if flag == 1 then - return - end - - -- 等级检查 - if data.grade < conf.viplvl then - return - end - - --检测格子 - if CommonFunc.Awards.CheckBagIsEnough(pActor,16,tmDefNoBagNum,tstUI) ~= true then - return - end - - -- 设置标志 - data.newServerGift = System.setIntBit(data.newServerGift, idx, true) - SendData(pActor) - - Actor.SendActivityLog(pActor,ActivityType,ActivityType,1) - if istitle then - local awards = {conf.title} - CommonFunc.Awards.Give(pActor, awards, GameLog.Log_Activity10012, "YYVIP NewSrvGift") - else - --获取 - local aid = Actor.getActorId(pActor) - local awards = {conf.gift} - SendMail(aid, ActivityConfig.nsTitle, ActivityConfig.nsContent, awards) - end - Actor.SendActivityLog(pActor,ActivityType,ActivityType,2) - end -end - -function OnReqYYVIPDailyGift(pActor, packet) - if PfId ~= nil and PlatformConfig.SPID ~= nil then - --print("[Tip] [YYVIP] SendData ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID) - if tostring(PfId) ~= tostring(PlatformConfig.SPID) then - - print("[Tip] [YYVIP] [非本平台活动]") - return --非本平台活动 - end - end - local idx = DataPack.readByte(packet) - if idx > #ActivityConfig.dailyGift then - return - end - local conf = ActivityConfig.dailyGift[idx] - idx = idx - 1 - local data = getData(pActor) - if conf and data.lastTime then - -- 领取检查 - if not data.dailyGift then - data.dailyGift = 0 - end - local flag = System.getIntBit(data.dailyGift, idx) - --print("dailyGift="..data.dailyGift.." flag="..flag) - if flag == 1 then - return - end - - -- 等级检查 - if data.grade < conf.viplvl then - return - end - - -- 元宝检查 - local consumes = {{type=4,id=4,count=conf.yb}} - if CommonFunc.Consumes.CheckActorSources(pActor, consumes, tstUI) ~= true then - return - end - - --消耗 - CommonFunc.Consumes.Remove(pActor, consumes, GameLog.Log_Activity10012, "YYVIP dailyGift | " .. ActivityType) - - -- 设置标志 - data.dailyGift = System.setIntBit(data.dailyGift, idx, true) - SendData(pActor) - - --获取 - local aid = Actor.getActorId(pActor) - local awards = {conf.item} - SendMail(aid, ActivityConfig.dgTitle, ActivityConfig.dgContent, awards) - Actor.SendActivityLog(pActor,ActivityType,ActivityType,1) - Actor.SendActivityLog(pActor,ActivityType,ActivityType,2) - end -end - -function OnReqYYVIPWeeklyGift(pActor, packet) - if PfId ~= nil and PlatformConfig.SPID ~= nil then - --print("[Tip] [YYVIP] SendData ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID) - if tostring(PfId) ~= tostring(PlatformConfig.SPID) then - - print("[Tip] [YYVIP] [非本平台活动]") - return --非本平台活动 - end - end - local idx = DataPack.readByte(packet) - if idx > #ActivityConfig.weeklyGift then - return - end - local conf = ActivityConfig.weeklyGift[idx] - idx = idx - 1 - local data = getData(pActor) - if conf and data.lastTime then - -- 领取检查 - if not data.weeklyGift then - data.weeklyGift = 0 - end - local flag = System.getIntBit(data.weeklyGift, idx) - --print("weeklyGift="..data.weeklyGift.." flag="..flag) - if flag == 1 then - return - end - - -- 等级检查 - if data.grade < conf.viplvl then - return - end - - --检测格子 - if CommonFunc.Awards.CheckBagIsEnough(pActor,16,tmDefNoBagNum,tstUI) ~= true then - return - end - - -- 元宝检查 - local consumes = {{type=4,id=4,count=conf.yb}} - if CommonFunc.Consumes.CheckActorSources(pActor, consumes, tstUI) ~= true then - return - end - - --消耗 - CommonFunc.Consumes.Remove(pActor, consumes, GameLog.Log_Activity10012, "YYVIP WeeklyGift | " .. ActivityType) - - -- 设置标志 - data.weeklyGift = System.setIntBit(data.weeklyGift, idx, true) - SendData(pActor) - - --获取 - CommonFunc.Awards.Give(pActor, awards, GameLog.Log_Activity10012, "YYVIP WeeklyGift | " .. ActivityType) - - --获取 - local aid = Actor.getActorId(pActor) - local awards = {conf.gift} - SendMail(aid, ActivityConfig.wgTitle, ActivityConfig.wgContent, awards) - - Actor.SendActivityLog(pActor,ActivityType,ActivityType,1) - Actor.SendActivityLog(pActor,ActivityType,ActivityType,2) - end -end - -NetmsgDispatcher.Reg(enActivityID, cReqYYVIPNewSrvGift, OnReqYYVIPNewSrvGift) -NetmsgDispatcher.Reg(enActivityID, cReqYYVIPDailyGift, OnReqYYVIPDailyGift) -NetmsgDispatcher.Reg(enActivityID, cReqYYVIPWeeklyGift, OnReqYYVIPWeeklyGift) - --------------------------------------------------------------------- --- 玩家 回调注册 --------------------------------------------------------------------- - --- 跨天 -function OnNewDayArrive(pActor,ndiffday) - if PfId ~= nil and PlatformConfig.SPID ~= nil then - --print("[Tip] [YYVIP] SendData ---------------------PfId:"..PfId.."--- SPID:"..PlatformConfig.SPID) - if tostring(PfId) ~= tostring(PlatformConfig.SPID) then - - print("[Tip] [YYVIP] [非本平台活动]") - return --非本平台活动 - end - end - local currMiniTime = System.getCurrMiniTime() - local data = getData(pActor) - if data.lastTime then - if not System.isSameDay(data.lastTime, currMiniTime) then - --print("跨一天") - if not System.isSameWeek(data.lastTime, currMiniTime) then - --print("跨一周") - data.weeklyGift = 0 - end - data.lastTime = currMiniTime - data.dailyGift = 0 - end - SendData(pActor) - end -end - -ActorEventDispatcher.Reg(aeNewDayArrive, OnNewDayArrive, "ActivityType10012.lua") diff --git a/LogicServer/data/functions/Activity/ActivityType10013.lua b/LogicServer/data/functions/Activity/ActivityType10013.lua deleted file mode 100755 index 3274e91..0000000 --- a/LogicServer/data/functions/Activity/ActivityType10013.lua +++ /dev/null @@ -1,289 +0,0 @@ -module("ActivityType10013", package.seeall) - ---[[ - 个人活动(玩法),超玩会员 - - 个人数据:SupperVIPeople - { - isVip = true/false 是否是会员 - lastTime = 0 上一次初始化的时间戳 - v1_v3Gift = 00000000 32位 是否领取第n个v1-v3礼包 - dailyGift = 00000000 32位 是否领取第n个每日礼包 - } -]]-- - ---活动类型 -ActivityType = 10013 ---对应的活动配置 -ActivityConfig = GameVIPConfig -if ActivityConfig == nil then - assert(false) -end - -local HttpStatus = -{ - Success = "200", -- 成功 - ArgError = "302", -- 参数错误 - SignError = "304", -- 签名错误 - LinkLost = "305", -- 链接失效 - IpLimit = "306", -- IP受限 - AccountNotExits = "600", -- 账号不存在 - UnKnownedError = "299", -- 未知错误 -} - --- 服务接口 -Host = ActivityConfig.host or "proxy.udblogin.game.yy.com" -Port = ActivityConfig.port or "80" -Api = ActivityConfig.api or "/query/cwVipInfo.do" - -function getData(pActor) - local var = Actor.getStaticVar(pActor) - if var.SupperVIPeople== nil then - var.SupperVIPeople = {} - end - return var.SupperVIPeople -end - -function SendData(pActor) - local npack = DataPack.allocPacket(pActor, enActivityID, sSupperVipData) - if npack then - local data = getData(pActor) - DataPack.writeUInt(npack, (data.v1_v3Gift or 0)) ---print("v1-v3 giftbit : "..(data.v1_v3Gift or 0 ) ) - DataPack.writeUInt(npack, (data.dailyGift or 0)) ---print("daily giftbit : "..(data.dailyGift or 0)) - DataPack.flush(npack) - end -end - -function AfterCheckSupperLogin(paramPack,content,result) - local aid = paramPack[1] - local pActor = Actor.getActorById(aid) - if not pActor then - --print("[AfterCheckSupperLogin][" .. aid .. "] 已离线") - return - end - --print("[AfterCheckSupperLogin][" .. Actor.getName(pActor) .. "] content:"..content) - --print("[AfterCheckSupperLogin]result:"..result) - - if Actor.getEntityType(pActor) ~= enActor then - return - end - - --先清buff - for i = 1 , #ActivityConfig.GameVIPbuff do - Actor.delBuffById(pActor, (ActivityConfig.GameVIPbuff[i].buffid or 0)) - end - - local data = getData(pActor) - - if result == 0 then - local status = string.match(content,"\"status\":(%d+)") - if status == HttpStatus.Success then - local vipLevel = string.match(content,"\"vipLevel\":(%d+)") - vipLevel = tonumber(vipLevel) - Actor.setUIntProperty(pActor,PROP_ACTOR_SUPPER_PLAY_LVL,vipLevel) - Actor.updateActorEntityProp(pActor) - --local grade = string.match(content,"\"grade\":(%d+)") - --local endTime = string.match(content,"\"endTime\":(%a+)") - data.isVip = 1 - - --加超玩特权buff - if(vipLevel >= 9) then - Actor.addBuffById(pActor, (ActivityConfig.GameVIPbuff[3].buffid or 0)) - elseif (vipLevel >= 6) then - Actor.addBuffById(pActor, (ActivityConfig.GameVIPbuff[2].buffid or 0)) - elseif (vipLevel >= 2) then - Actor.addBuffById(pActor, (ActivityConfig.GameVIPbuff[1].buffid or 0)) - end - - else - data.isVip = 0 - Actor.setUIntProperty(pActor,PROP_ACTOR_SUPPER_PLAY_LVL,0) - Actor.updateActorEntityProp(pActor) - end - - end - SendData(pActor) -end - --------------------------------------------------------------------- --- CPP回调 --------------------------------------------------------------------- - -function OnSupperLogin(pActor) - local account = Actor.getAccount(pActor) - local aid = Actor.getActorId(pActor) - local now_milli = os.time()*1000 - local gameflag = System.getGameFlag() or "DDCQ" - local key = System.getYYKey() - local sign = System.MD5(gameflag,account,now_milli,key) - local req = Api..'?game='..gameflag..'&account='..account..'&ts='..now_milli.."&sign="..string.upper(sign) - --print("Require OnSupperLogin[" .. Actor.getName(pActor) .. "] : ".. req) - AsyncWorkDispatcher.Add( - {'GetHttpContent',Host,Port,req}, - AfterCheckSupperLogin, - {aid} - ) - - -- 当天初始化 - local currMiniTime = System.getCurrMiniTime() - local data = getData(pActor) - if data.lastTime == nil then - data.lastTime = currMiniTime - --print("第一天") - else - if not System.isSameDay(data.lastTime, currMiniTime) then - data.lastTime = currMiniTime - end - end -end - --------------------------------------------------------------------- --- 客户端请求协议回调 --------------------------------------------------------------------- - ---v1-v3等级礼包 -function OnReqSuperVipV1_V3(pActor, packet) - local idx = DataPack.readByte(packet) - if idx > #ActivityConfig.vipGift or idx <= 0 then - return - end - local conf = ActivityConfig.vipGift[idx] - local myLevel = Actor.getIntProperty(pActor, PROP_ACTOR_SUPPER_PLAY_LVL) - - --一级玩家增加领取范围 - if myLevel ==1 then - myLevel = 2 - end - - local data = getData(pActor) - - if data.isVip == 0 then - return - end - if conf and data.lastTime then - -- 领取检查 - if not data.v1_v3Gift then - data.v1_v3Gift = 0 - end - local flag = System.getIntBit(data.v1_v3Gift, idx-1) - if flag == 1 then - Actor.sendTipmsg(pActor, "|C:0xf56f00&T:奖励已领取|", tstUI) - return - end - -- 等级检查 - if myLevel < idx then - return - end - - --消耗 - --CommonFunc.Consumes.Remove(pActor, consumes, GameLog.Log_Activity10013, "super Player v1-v3") - - --记录日志 - Actor.SendActivityLog(pActor,ActivityType,ActivityType,1) - - --获取 - local aid = Actor.getActorId(pActor) - local awards = conf - SendMail(aid, ActivityConfig.VIPTitle, ActivityConfig.VIPContent, awards) - - --记录日志 - Actor.SendActivityLog(pActor,ActivityType,ActivityType,2) - -- 设置标志 - data.v1_v3Gift = System.setIntBit(data.v1_v3Gift, idx-1, true) - SendData(pActor) - end - -end - - --- 每日礼包,初中高级 -function OnReqSuperVipDaily(pActor, packet) - local idx = DataPack.readByte(packet) - if idx > #ActivityConfig.dailyGift or idx <= 0 then - return - end - local conf = ActivityConfig.dailyGift[idx] - - local myLevel = Actor.getIntProperty(pActor, PROP_ACTOR_SUPPER_PLAY_LVL) - - local data = getData(pActor) - - if data.isVip == 0 then - return - end - - if conf and data.lastTime then - -- 领取检查 - if not data.dailyGift then - data.dailyGift = 0 - end - local flag = System.getIntBit(data.dailyGift, idx-1) - if flag == 1 then - Actor.sendTipmsg(pActor, "|C:0xf56f00&T:奖励已领取|", tstUI) - return - end - - -- 等级检查 - if myLevel < ActivityConfig.vipMap[idx] then - return - end - - --记录日志 - Actor.SendActivityLog(pActor,ActivityType,ActivityType,1) - - --获取 - local aid = Actor.getActorId(pActor) - local awards = conf - SendMail(aid, ActivityConfig.VIPDailyTitle, ActivityConfig.VIPDailyContent, awards) - - --记录日志 - Actor.SendActivityLog(pActor,ActivityType,ActivityType,2) - - -- 设置标志 - data.dailyGift = System.setIntBit(data.dailyGift, idx-1, true) - - SendData(pActor) - end - -end - -NetmsgDispatcher.Reg(enActivityID, cReqSuperVipV1_V3, OnReqSuperVipV1_V3) -NetmsgDispatcher.Reg(enActivityID, cReqSuperVipDaily, OnReqSuperVipDaily) - --------------------------------------------------------------------- --- 玩家 回调注册 --------------------------------------------------------------------- - --- 跨天 -function OnNewDayArrive(pActor,ndiffday) - local currMiniTime = System.getCurrMiniTime() - local data = getData(pActor) - if data.lastTime then - if not System.isSameDay(data.lastTime, currMiniTime) then - --print("跨一天") - data.lastTime = currMiniTime - data.dailyGift = 0 - end - SendData(pActor) - end -end - -function OnUserLogout(pActor,actorId) - --local pActor = Actor.getActorById(actorId) - - --离线就删除buff - --没有对会员时间处理,上线是超玩就加buff,离线就删buff - for i = 1 , #ActivityConfig.GameVIPbuff do - Actor.delBuffById(pActor, (ActivityConfig.GameVIPbuff[i].buffid or 0)) - end - -end - - - - -ActorEventDispatcher.Reg(aeNewDayArrive, OnNewDayArrive, "ActivityType10013.lua") -ActorEventDispatcher.Reg(aeUserLogout, OnUserLogout, "ActivityType10013.lua") - diff --git a/LogicServer/data/functions/Activity/Activitys.txt b/LogicServer/data/functions/Activity/Activitys.txt index ac0d4d4..5f6f160 100755 --- a/LogicServer/data/functions/Activity/Activitys.txt +++ b/LogicServer/data/functions/Activity/Activitys.txt @@ -35,13 +35,9 @@ require("Activity.ActivityType10005") --个人活动:月份签到 require("Activity.ActivityType10006") --个人活动:登录基金 require("Activity.ActivityType10009") --个人活动:达标活动 require("Activity.ActivityType10010") --个人活动:寻宝活动 -require("Activity.ActivityType10011") --玩法:YY大厅特权 -require("Activity.ActivityType10012") --玩法:YY会员 -require("Activity.ActivityType10013") --玩法:超玩会员 require("Activity.ActivityType10014") --玩法:微信礼包 require("Activity.ActivityType10015") --全局个人活动:每周固定时间的礼包活动 require("Activity.ActivityType10017") --兑换活动 -require("Activity.ActivityQQHall") --QQ大厅 require("Activity.ActivityType10019") -- require("Activity.ActivityLuckyTree") -- require("Activity.ActivityOnlineMin") -- diff --git a/LogicServer/data/functions/GameConfigs.txt b/LogicServer/data/functions/GameConfigs.txt index 60ebd16..85a82aa 100755 --- a/LogicServer/data/functions/GameConfigs.txt +++ b/LogicServer/data/functions/GameConfigs.txt @@ -65,11 +65,6 @@ --#include "data/config/OnlineTime/OnlineTimeReward.config" once --累计在线 --#include "data/config/OnlineTime/OnlineTimeconst.config" once --在线 ---平台活动 ---#include "data/config/YYPlatform/YYMemberConfig.config" once ---#include "data/config/YYPlatform/YYVIPConfig.config" once ---#include "data/config/YYPlatform/GameVIPConfig.config" once - -- 套装 --#include "data/config/SuitConfig.config" once