|  |  |  | 
|---|
|  |  |  | import PlayerFreeGoods | 
|---|
|  |  |  | import ShopItemManage | 
|---|
|  |  |  | import PlayerRecover | 
|---|
|  |  |  | import Operate_EquipSuitCompose | 
|---|
|  |  |  | import GameLogic_IceLode | 
|---|
|  |  |  | import PlayerEquipDecompose | 
|---|
|  |  |  | import PlayerCoat | 
|---|
|  |  |  | import PlayerGreatMaster | 
|---|
|  |  |  | 
|---|
|  |  |  | import PlayerFlashSale | 
|---|
|  |  |  | import PlayerFlashGiftbag | 
|---|
|  |  |  | import PlayerCostRebate | 
|---|
|  |  |  | import PlayerActTotalRecharge | 
|---|
|  |  |  | import PlayerSpringSale | 
|---|
|  |  |  | import PlayerFairyCeremony | 
|---|
|  |  |  | import ChNetSendPack | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #消费返利 | 
|---|
|  |  |  | PlayerCostRebate.OnPlayerLogin(curPlayer) | 
|---|
|  |  |  | #累计充值 | 
|---|
|  |  |  | PlayerActTotalRecharge.OnPlayerLogin(curPlayer) | 
|---|
|  |  |  | #限时特惠 | 
|---|
|  |  |  | PlayerSpringSale.OnPlayerLogin(curPlayer) | 
|---|
|  |  |  | #限时礼包 | 
|---|
|  |  |  | 
|---|
|  |  |  | #仙魔之争 | 
|---|
|  |  |  | GameLogic_XMZZ.OnXMZZLogin(curPlayer) | 
|---|
|  |  |  | PlayerOnlinePrize.OnPlayerLogin(curPlayer) | 
|---|
|  |  |  | GameLogic_SealDemon.NotifyFMTDouble(curPlayer) | 
|---|
|  |  |  | #装备分解 | 
|---|
|  |  |  | PlayerEquipDecompose.PlayerLogin(curPlayer) | 
|---|
|  |  |  | #防沉迷 | 
|---|
|  |  |  | 
|---|
|  |  |  | curPlayer.SendDBQueryRecharge() | 
|---|
|  |  |  | # 小助手 | 
|---|
|  |  |  | SyncLittleHelper(curPlayer) | 
|---|
|  |  |  | # 聊天气泡框 | 
|---|
|  |  |  | SyncChatBubbleBoxState(curPlayer) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | curPlayer.SetState(0)   # 脱机挂恢复为正常上线 | 
|---|
|  |  |  | curPlayer.SetFacePic(0) # 通知数据库是否保存还是下线,做一次恢复,1为保存 0为正常下线 | 
|---|
|  |  |  | 
|---|
|  |  |  | itemManager = curPlayer.GetItemManager() | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for packIndex in ChConfig.Def_PlayerLoginInitPackIndexList: | 
|---|
|  |  |  | itemManager.GetPack(packIndex).Sync_Refresh() | 
|---|
|  |  |  |  | 
|---|
|  |  |  | rolePack = itemManager.GetPack(packIndex) | 
|---|
|  |  |  | rolePack.Sync_Refresh() | 
|---|
|  |  |  |  | 
|---|
|  |  |  | # 刷下装备评分,仓库可以暂不处理,取出装备后登录触发刷新 | 
|---|
|  |  |  | for i in xrange(rolePack.GetCount()): | 
|---|
|  |  |  | curItem = rolePack.GetAt(i) | 
|---|
|  |  |  | if curItem.IsEmpty(): | 
|---|
|  |  |  | continue | 
|---|
|  |  |  | newScore = ItemCommon.CalcEquipGS(curItem) | 
|---|
|  |  |  | hisScore = ItemCommon.GetEquipGearScore(curItem) | 
|---|
|  |  |  | if hisScore != newScore: | 
|---|
|  |  |  | ItemCommon.SetEquipGearScore(curItem, newScore) | 
|---|
|  |  |  | GameWorld.Log("登录更新装备评分: packType=%s,i=%s,hisScore=%s,newScore=%s,itemID=%s,guid=%s" | 
|---|
|  |  |  | % (packIndex, i, hisScore, newScore, curItem.GetItemTypeID(), curItem.GetGUID()), curPlayer.GetPlayerID()) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for packIndex in ChConfig.Def_VPackCnt_Dict.keys(): | 
|---|
|  |  |  | ItemControler.Sync_VPackItem_Refresh(curPlayer, packIndex) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | curPlayer.SetSetting(setting) | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #// A2 30 设置聊天气泡框 #tagCMSetChatBubbleBox | 
|---|
|  |  |  | # | 
|---|
|  |  |  | #struct    tagCMSetChatBubbleBox | 
|---|
|  |  |  | #{ | 
|---|
|  |  |  | #    tagHead         Head; | 
|---|
|  |  |  | #    BYTE        BubbleBoxType;    //气泡框类型 | 
|---|
|  |  |  | #}; | 
|---|
|  |  |  | def OnSetChatBubbleBox(index, clientData, tick): | 
|---|
|  |  |  | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index) | 
|---|
|  |  |  | useBoxID = clientData.BubbleBoxType | 
|---|
|  |  |  | GameWorld.DebugLog("设置使用的聊天气泡框ID: useBoxID=%s" % useBoxID, curPlayer.GetPlayerID()) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ipyData = IpyGameDataPY.GetIpyGameData("ChatBubbleBox", useBoxID) | 
|---|
|  |  |  | if not ipyData: | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | curBoxState = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_ChatBubbleBoxState, useBoxID) | 
|---|
|  |  |  | if not curBoxState: | 
|---|
|  |  |  | needLV = ipyData.GetNeedLV() | 
|---|
|  |  |  | if needLV and curPlayer.GetLV() < needLV: | 
|---|
|  |  |  | GameWorld.DebugLog("    等级不足,无法使用该气泡框!needLV=%s" % needLV, curPlayer.GetPlayerID()) | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | needVIPLVGift = ipyData.GetNeedVIPLVGift() # 兼容已购买VIP礼包的老号用 | 
|---|
|  |  |  | if needVIPLVGift: | 
|---|
|  |  |  | record = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_VipAwardRecord) | 
|---|
|  |  |  | hasBuy = record & pow(2, needVIPLVGift) | 
|---|
|  |  |  | if not hasBuy: | 
|---|
|  |  |  | GameWorld.DebugLog("    未购买VIP礼包,无法使用该气泡框!needVIPLVGift=%s" % needVIPLVGift, curPlayer.GetPlayerID()) | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | PlayerControl.SetChatBubbleBox(curPlayer, useBoxID) | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def DoActivateChatBubbleBox(curPlayer, boxID): | 
|---|
|  |  |  | ## 激活聊天气泡框 | 
|---|
|  |  |  | ipyData = IpyGameDataPY.GetIpyGameData("ChatBubbleBox", boxID) | 
|---|
|  |  |  | if not ipyData: | 
|---|
|  |  |  | return | 
|---|
|  |  |  | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_ChatBubbleBoxState, boxID, 1) | 
|---|
|  |  |  | SyncChatBubbleBoxState(curPlayer) | 
|---|
|  |  |  | return True | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def SyncChatBubbleBoxState(curPlayer): | 
|---|
|  |  |  | ## 同步聊天气泡框状态 | 
|---|
|  |  |  | boxState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ChatBubbleBoxState % 0) | 
|---|
|  |  |  | if not boxState: | 
|---|
|  |  |  | return | 
|---|
|  |  |  | boxStatePack = ChPyNetSendPack.tagMCChatBubbleBoxState() | 
|---|
|  |  |  | boxStatePack.BoxState = boxState | 
|---|
|  |  |  | NetPackCommon.SendFakePack(curPlayer, boxStatePack) | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #// A2 29 设置小助手 #tagCMSetLittleHelper | 
|---|
|  |  |  | # | 
|---|
|  |  |  | #struct    tagCMSetLittleHelper | 
|---|
|  |  |  | 
|---|
|  |  |  | #    DWORD        Value3;    // 自定义值3 | 
|---|
|  |  |  | #    DWORD        Value4;    // 自定义值4 | 
|---|
|  |  |  | #    DWORD        Value5;    // 自定义值5 | 
|---|
|  |  |  | #    DWORD        Value6;    // 自定义值6 | 
|---|
|  |  |  | #}; | 
|---|
|  |  |  | def OnSetLittleHelper(index, clientData, tick): | 
|---|
|  |  |  | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index) | 
|---|
|  |  |  | 
|---|
|  |  |  | #@return 返回值无意义 | 
|---|
|  |  |  | #@remarks 客户端封包响应 //03 10 退出副本#tagCExitFB | 
|---|
|  |  |  | def __Func_ExitFB(curPlayer, tick): | 
|---|
|  |  |  | if GameWorld.GetMap().GetMapFBType() == IPY_GameWorld.fbtNull: | 
|---|
|  |  |  | if GameWorld.GetMap().GetMapFBType() == IPY_GameWorld.fbtNull and curPlayer.GetMapID() not in IpyGameDataPY.GetFuncEvalCfg("MapLine", 4): | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  | GameWorld.Log('玩家 = %s , 主动离开副本' % (curPlayer.GetName()) , curPlayer.GetID()) | 
|---|
|  |  |  | 
|---|
|  |  |  | # 领取消费返利奖励 | 
|---|
|  |  |  | elif rewardType == ChConfig.Def_RewardType_CostRebate: | 
|---|
|  |  |  | PlayerCostRebate.OnGetCostRebateAward(curPlayer, dataEx) | 
|---|
|  |  |  | # 领取累计充值奖励 | 
|---|
|  |  |  | elif rewardType == ChConfig.Def_RewardType_TotalRecharge: | 
|---|
|  |  |  | PlayerActTotalRecharge.OnGetTotalRechargeAward(curPlayer, dataEx) | 
|---|
|  |  |  | # 领取boss复活活动奖励 | 
|---|
|  |  |  | elif rewardType == ChConfig.Def_RewardType_BossReborn: | 
|---|
|  |  |  | PlayerBossReborn.GetBossRebornActionAward(curPlayer, dataEx) | 
|---|
|  |  |  | 
|---|
|  |  |  | # 领取许愿池奖励 | 
|---|
|  |  |  | elif rewardType == ChConfig.Def_RewardType_WishingWell: | 
|---|
|  |  |  | PlayerWishingWell.DoGetWishingAward(curPlayer) | 
|---|
|  |  |  | # 功能开启奖励 | 
|---|
|  |  |  | elif rewardType == ChConfig.Def_RewardType_OpenFunc: | 
|---|
|  |  |  | GameFuncComm.GetFuncOpenAward(curPlayer, dataEx) | 
|---|
|  |  |  | # 冰晶矿脉星级奖励 | 
|---|
|  |  |  | elif rewardType == ChConfig.Def_RewardType_IceLodeStar: | 
|---|
|  |  |  | GameLogic_IceLode.GetIceLodeStarAward(curPlayer, dataEx) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | # | 
|---|
|  |  |  | #    # 充值豪礼奖励 | 
|---|