From cb9bd14ca769a6f4d8d237a3a78624e1f587b5ac Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期一, 03 九月 2018 19:35:30 +0800
Subject: [PATCH] fix:3218 【后端】进盟前获得的仙盟红包,在进盟后补给玩家进行发放
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamilyRedPacket.py | 36 +++++++++++++++++++++++++++---------
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py | 2 ++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py | 1 +
3 files changed, 30 insertions(+), 9 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 2d324ce..97bd58d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3737,6 +3737,7 @@
#仙盟红包
Def_PDict_FamilyRedPacketGoldLimit = "FmlRedPacketGoldLimit" # 仙盟钻石红包已发额度
+Def_PDict_FamilyRedPacketCache = "FamilyRedPacketCache%s" # 仙盟红包待发放记录参数索引
Def_PDict_OSRedPacketGrabMoney = "OSRedPacketGrabMoney" # 开服红包已抢数量
Def_PDict_OSRedPacketCanGrabCnt = "OSRedPacketCanGrabCnt" # 开服红包可抢次数
Def_PDict_OSRedPacketStartTime = "OSRedPacketStartTime" #开服红包开始倒计时时间
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py
index 771b91a..1c74150 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamily.py
@@ -28,6 +28,7 @@
import GameLogic_FamilyWar
import ChMapToGamePyPack
import PlayerFamilyTech
+import PlayerFamilyRedPacket
import SkillCommon
import BuffSkill
import ItemCommon
@@ -152,6 +153,7 @@
PlayerFamilyTech.Sync_PlayerFamilyTechLV(curPlayer)
DelAddFamilyRecord(curPlayer)
GameLogic_FamilyWar.DoCheckChampionFamilyTitle(curPlayer)
+ PlayerFamilyRedPacket.CreatCacheRedPacktet(curPlayer)
return
## 退出家族触发事件
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamilyRedPacket.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamilyRedPacket.py
index 368ac60..ba856a3 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamilyRedPacket.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamilyRedPacket.py
@@ -52,26 +52,44 @@
__NotifyGoldLimt(curPlayer)
return
+def CreatCacheRedPacktet(curPlayer):
+ #加入仙盟后,发放待发的红包
+ ipyMgr = IpyGameDataPY.IPY_Data()
+ for i in xrange(ipyMgr.GetFamilyRedPackCount()):
+ ipyData = ipyMgr.GetFamilyRedPackByIndex(i)
+ redPacketID = ipyData.GetID()
+ if GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_FamilyRedPacketCache, redPacketID):
+ CreatRedPacketByID(curPlayer, redPacketID)
+ GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_FamilyRedPacketCache, redPacketID, 0)
+ return
+
+
def CreatRedPacketByID(curPlayer, redPacketID, state=State_NoSend, data=0):
#根据红包ID生成红包
ipyData = IpyGameDataPY.GetIpyGameData('FamilyRedPack', redPacketID)
if not ipyData:
return
- DoCreatFamilyRedPacket(curPlayer, ipyData.GetGetType(), ipyData.GetMoneyType(), ipyData.GetMoneyNum(), ipyData.GetPacketCnt(), state, '', data)
- return
-
-## 生成红包
-def DoCreatFamilyRedPacket(curPlayer, getType, moneyType=2, awardNum=100, packetCnt=10, state=State_NoSend, wishInfo='', data=0):
-# if not curPlayer.GetFamilyID():
-# #没家族
-# return
-
+ getType = ipyData.GetGetType()
if getType == IpyGameDataPY.GetFuncCfg('OpenServerRedPacketType'):
oscDay = IpyGameDataPY.GetFuncCfg('OpenServerRedPacketCfg')
openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay)
if openServerDay >= oscDay:
GameWorld.DebugLog(' 发开服红包,活动已过,不可发送!')
return
+ else:
+ if not curPlayer.GetFamilyID():
+ #没家族 先存起来,等进仙盟时再补发
+ GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_FamilyRedPacketCache, redPacketID, 1)
+ return
+
+ DoCreatFamilyRedPacket(curPlayer, getType, ipyData.GetMoneyType(), ipyData.GetMoneyNum(), ipyData.GetPacketCnt(), state, '', data)
+ return
+
+## 生成红包
+def DoCreatFamilyRedPacket(curPlayer, getType, moneyType=2, awardNum=100, packetCnt=10, state=State_NoSend, wishInfo='', data=0):
+
+
+
playerID = curPlayer.GetPlayerID()
packetCnt = min(packetCnt, awardNum)
--
Gitblit v1.8.0