xdh
2018-10-31 530971bfbab8b0bab8fe7a13c4b84e68935b6e46
4436 【后端】【1.2.0】功能预告界面修改,新增可领取奖励
9个文件已修改
103 ■■■■ 已修改文件
PySysDB/PySysDBPY.h 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/OpenFunc.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/GameFuncComm.py 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PySysDB/PySysDBPY.h
@@ -1331,4 +1331,12 @@
    BYTE        IsBind;    //是否绑定
    DWORD        Weight;    //权重
    DWORD        Mark;    //排序用标识
};
//功能预告表
struct tagFunctionForecast
{
    DWORD        _FuncID;    //功能ID
    dict        Award;    //属性类型
};
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -12171,6 +12171,7 @@
    _fields_ = [
                  ("FuncID", c_ubyte),    # 功能ID
                  ("State", c_ubyte),    # 是否开启
                  ("AwardState", c_ubyte),    # 是否已领奖励
                  ]
    def __init__(self):
@@ -12185,6 +12186,7 @@
    def Clear(self):
        self.FuncID = 0
        self.State = 0
        self.AwardState = 0
        return
    def GetLength(self):
@@ -12196,11 +12198,13 @@
    def OutputString(self):
        DumpString = '''//A3 02 功能开通状态 //tagMCFuncOpenStateList:
                                FuncID:%d,
                                State:%d
                                State:%d,
                                AwardState:%d
                                '''\
                                %(
                                self.FuncID,
                                self.State
                                self.State,
                                self.AwardState
                                )
        return DumpString
@@ -17200,7 +17204,6 @@
                  ("Value3", c_int),    # 自定义值3
                  ("Value4", c_int),    # 自定义值4
                  ("Value5", c_int),    # 自定义值5
                  ("Value6", c_int),    # 自定义值6
                  ]
    def __init__(self):
@@ -17219,7 +17222,6 @@
        self.Value3 = 0
        self.Value4 = 0
        self.Value5 = 0
        self.Value6 = 0
        return
    def GetLength(self):
@@ -17235,8 +17237,7 @@
                                Value2:%d,
                                Value3:%d,
                                Value4:%d,
                                Value5:%d,
                                Value6:%d
                                Value5:%d
                                '''\
                                %(
                                self.SetNum,
@@ -17244,8 +17245,7 @@
                                self.Value2,
                                self.Value3,
                                self.Value4,
                                self.Value5,
                                self.Value6
                                self.Value5
                                )
        return DumpString
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3305,6 +3305,7 @@
Def_Player_Dict_FBHistoryMaxLine = "FBHistoryMaxLine_%s"  # 副本历史最高通关, 参数为副本ID
Def_Player_Dict_RefurbishGoodBookPlayerLv = "RefurbishGoodBookPlayerLv_97"  # 刷新天书任务时的玩家等级
Def_Player_Dict_GameFuncFirstTouch = "GameFuncFirstTouch_%s"  # 服务端功能首次触发开启状态; 参数, key编号
Def_Player_Dict_GameFuncAwardState = "GameFuncAwardState_%s"  # 服务端功能开启领奖状态; 参数, key编号
Def_Player_Dict_MissionFinish = "MissionFinish_%s"  # 任务是否完成; 参数, 任务ID, 只会记录部分需要记录的任务ID 
Def_Player_Dict_FamilyArrestAwardState = "ArrestAwardState_103"  # 家族悬赏奖励领取情况
Def_Player_Dict_OtherDayLogin = "OtherDayLogin_105"  # 非同一天二次登陆
@@ -5021,7 +5022,8 @@
Def_RewardType_FCParty, # 仙界盛典全民来嗨14
Def_RewardType_DownLoad, # 分包下载奖励15
Def_RewardType_WishingWell, # 许愿池奖励16
)= range(17)
Def_RewardType_OpenFunc, # 功能开启奖励17
)= range(18)
#boss复活相关活动定义
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -12171,6 +12171,7 @@
    _fields_ = [
                  ("FuncID", c_ubyte),    # 功能ID
                  ("State", c_ubyte),    # 是否开启
                  ("AwardState", c_ubyte),    # 是否已领奖励
                  ]
    def __init__(self):
@@ -12185,6 +12186,7 @@
    def Clear(self):
        self.FuncID = 0
        self.State = 0
        self.AwardState = 0
        return
    def GetLength(self):
@@ -12196,11 +12198,13 @@
    def OutputString(self):
        DumpString = '''//A3 02 功能开通状态 //tagMCFuncOpenStateList:
                                FuncID:%d,
                                State:%d
                                State:%d,
                                AwardState:%d
                                '''\
                                %(
                                self.FuncID,
                                self.State
                                self.State,
                                self.AwardState
                                )
        return DumpString
@@ -17200,7 +17204,6 @@
                  ("Value3", c_int),    # 自定义值3
                  ("Value4", c_int),    # 自定义值4
                  ("Value5", c_int),    # 自定义值5
                  ("Value6", c_int),    # 自定义值6
                  ]
    def __init__(self):
@@ -17219,7 +17222,6 @@
        self.Value3 = 0
        self.Value4 = 0
        self.Value5 = 0
        self.Value6 = 0
        return
    def GetLength(self):
@@ -17235,8 +17237,7 @@
                                Value2:%d,
                                Value3:%d,
                                Value4:%d,
                                Value5:%d,
                                Value6:%d
                                Value5:%d
                                '''\
                                %(
                                self.SetNum,
@@ -17244,8 +17245,7 @@
                                self.Value2,
                                self.Value3,
                                self.Value4,
                                self.Value5,
                                self.Value6
                                self.Value5
                                )
        return DumpString
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/OpenFunc.py
@@ -45,6 +45,7 @@
                
            for keyNum in xrange(8):
                PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_GameFuncFirstTouch % keyNum, 0)
                PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_GameFuncAwardState % keyNum, 0)
                
            needLV, needMagicWeaponIDList, needRealmLV, needMissionIDList = __GetOpenFuncLimit([])
            for missionID in needMissionIDList:
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
@@ -1557,6 +1557,7 @@
        return 0
    #任务
    EventShell.EventRespons_FBEvent(curPlayer, 'fbhelp')
    EventShell.EventRespons_FBEvent(curPlayer, 'fbhelp_%s'%mapID)
    # 每日活动
    PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_FBHelp)
    addHelpPoint = helpPoint * addFBCnt
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -1058,6 +1058,11 @@
                        ("DWORD", "Weight", 0),
                        ("DWORD", "Mark", 0),
                        ),
                "FunctionForecast":(
                        ("DWORD", "FuncID", 1),
                        ("dict", "Award", 0),
                        ),
                }
@@ -3211,6 +3216,17 @@
    def GetIsBind(self): return self.IsBind # 是否绑定
    def GetWeight(self): return self.Weight # 权重
    def GetMark(self): return self.Mark # 排序用标识
# 功能预告表
class IPY_FunctionForecast():
    def __init__(self):
        self.FuncID = 0
        self.Award = {}
        return
    def GetFuncID(self): return self.FuncID # 功能ID
    def GetAward(self): return self.Award # 属性类型
def Log(msg, playerID=0, par=0):
@@ -3430,6 +3446,8 @@
        self.ipyActWishingWellLen = len(self.ipyActWishingWellCache)
        self.ipyWishingWellCache = self.__LoadFileData("WishingWell", IPY_WishingWell)
        self.ipyWishingWellLen = len(self.ipyWishingWellCache)
        self.ipyFunctionForecastCache = self.__LoadFileData("FunctionForecast", IPY_FunctionForecast)
        self.ipyFunctionForecastLen = len(self.ipyFunctionForecastCache)
        Log("IPY_FuncConfig count=%s" % len(self.ipyFuncConfigDict))
        Log("IPY_DataMgr InitOK!")
        return
@@ -3790,6 +3808,8 @@
    def GetActWishingWellByIndex(self, index): return self.ipyActWishingWellCache[index]
    def GetWishingWellCount(self): return self.ipyWishingWellLen
    def GetWishingWellByIndex(self, index): return self.ipyWishingWellCache[index]
    def GetFunctionForecastCount(self): return self.ipyFunctionForecastLen
    def GetFunctionForecastByIndex(self, index): return self.ipyFunctionForecastCache[index]
IPYData = IPY_DataMgr()
def IPY_Data(): return IPYData
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -5050,7 +5050,9 @@
    # 领取许愿池奖励
    elif rewardType == ChConfig.Def_RewardType_WishingWell:
        PlayerWishingWell.DoGetWishingAward(curPlayer)
    # 功能开启奖励
    elif rewardType == ChConfig.Def_RewardType_OpenFunc:
        GameFuncComm.GetFuncOpenAward(curPlayer, dataEx)
#
#    # 充值豪礼奖励
#    elif rewardType == ShareDefine.Def_RewardType_GoldGift:
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/GameFuncComm.py
@@ -41,8 +41,9 @@
import PlayerFreeGoods
import FunctionNPCCommon
import PlayerGreatMaster
import IPY_GameWorld
import ItemCommon
import ItemControler
# 功能开启需执行的函数{功能ID:执行函数, ...} 函数需返回是否激活成功, 功能开启有需要处理功能逻辑的这里增加函数调用配置即可
@@ -154,6 +155,33 @@
    
    return ipyData.GetLimitLV()
def GetFuncOpenAward(curPlayer, funcID):
    ## 领取功能开启奖励
    ipyData = IpyGameDataPY.GetIpyGameData('FunctionForecast', funcID)
    if not ipyData:
        return
    getState = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_GameFuncAwardState, funcID)
    if getState:
        return
    awardDict = ipyData.GetAward()
    job = curPlayer.GetJob()
    itemList = awardDict.get(str(job))
    if not itemList:
        return
    # 检查背包
    needSpace = len(itemList)
    packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
    if needSpace > packSpace:
        PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
        return
    GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_GameFuncAwardState, funcID, 1)
    # 给物品
    for itemID, itemCount in itemList:
        ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, 1, [IPY_GameWorld.rptItem])
    Sync_FuncOpenState(curPlayer, [funcID])
    return
def Sync_FuncOpenState(curPlayer, syncFuncIDList=[], isSyncUnOpen=False):
    ## 通知功能首次触发情况
    if not syncFuncIDList:
@@ -174,6 +202,7 @@
        funcOpenState.Clear()
        funcOpenState.FuncID = funcID
        funcOpenState.State = openState
        funcOpenState.AwardState = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_GameFuncAwardState, funcID)
        funcStatePack.FuncStateList.append(funcOpenState)
    funcCount = len(funcStatePack.FuncStateList) 
    funcStatePack.FuncCount = funcCount