| | |
| | | import FunctionNPCCommon
|
| | | import PlayerGMOper
|
| | | import ReadChConfig
|
| | | import PetControl
|
| | | import OperControlManager
|
| | | import ShareDefine
|
| | | import NetPackCommon
|
| | |
| | | import PlayerLVAward
|
| | | import PlayerGoldGift
|
| | | import PlayerSignDay
|
| | | import PlayerPet
|
| | | import PlayerPrestigeSys
|
| | | import PlayerFamily
|
| | | import PlayerLoginDayAward
|
| | |
| | | import PlayerWishingWell
|
| | | import PlayerSuccess
|
| | | import PlayerFreeGoods
|
| | | import PlayerCrossRealmPK
|
| | | import PlayerCrossChampionship
|
| | | import GameFuncComm
|
| | | import PlayerFamilyTaofa
|
| | | import PlayerWeekParty
|
| | | import PlayerFeastWeekParty
|
| | | import PlayerFeastLogin
|
| | | import PlayerFeastWish
|
| | | import PlayerActLogin
|
| | | import PlayerTreasure
|
| | | import PlayerRune
|
| | | import IpyGameDataPY
|
| | | import EventReport
|
| | | import PassiveBuffEffMng
|
| | | import PlayerFlashSale
|
| | | import PlayerFlashGiftbag
|
| | | import PlayerDailyGiftbag
|
| | | import PlayerCostRebate
|
| | | import PlayerActBuyOne
|
| | | import PlayerActGrowupBuy
|
| | | import PlayerActCollectWords
|
| | | import PlayerActTotalRecharge
|
| | | import PlayerActRechargePrize
|
| | | import PlayerActLianqi
|
| | | import PlayerActGodGift
|
| | | import PlayerActFamilyCTGAssist
|
| | | import PlayerActRechargeRebateGold
|
| | | import PlayerActManyDayRecharge
|
| | | import PlayerActSingleRecharge
|
| | | import PlayerSpringSale
|
| | | import PlayerCrossYaomoBoss
|
| | | import PlayerLuckyCloudBuy
|
| | | import PlayerLuckyTreasure
|
| | | import CrossActCTGBillboard
|
| | | import CrossActAllRecharge
|
| | | import PlayerFuncSysPrivilege
|
| | | import PlayerActTurntable
|
| | | import PlayerTongTianLing
|
| | | import OpenServerActivity
|
| | | import CrossRealmPlayer
|
| | | import ChNetSendPack
|
| | | import PlayerArena
|
| | | import PyGameData
|
| | | import PlayerCoin
|
| | | import PlayerCharm
|
| | | import PlayerDogz
|
| | | import PlayerCoat
|
| | | import PlayerFB
|
| | | import PlayerFaQi
|
| | | import SkillShell
|
| | |
| | | import PlayerActTask
|
| | | import PlayerMail
|
| | | import DBDataMgr
|
| | | import PlayerViewCache
|
| | | import UpdatePlayerName
|
| | | import GameServerRefresh
|
| | | import IPY_ServerDefine
|
| | | import IPY_PlayerDefine
|
| | | import CommFunc
|
| | | from PyMongoDB import RecvPackToMapDB
|
| | | import GMT_BroadCast
|
| | | import PyMongoMain
|
| | | import PlayerTalk
|
| | | import PlayerHero
|
| | |
| | | import PlayerMingge
|
| | | import TurnAttack
|
| | | import PlayerHJG
|
| | | import DBFamily
|
| | | import CrossPlayer
|
| | | import CrossMsg
|
| | | import CrossMgr
|
| | | import ChEquip
|
| | |
|
| | | import datetime
|
| | |
| | | __Sync_ClientBuff(curPlayer)
|
| | |
|
| | | PlayerState.Sync_PKBossState(curPlayer)
|
| | | |
| | | if PlayerControl.GetCrossMapID(curPlayer):
|
| | | CrossRealmPlayer.DoExitCrossRealm(curPlayer)
|
| | | |
| | | PetControl.DoLogic_PetLoadMapOK(curPlayer)
|
| | |
|
| | | # 恢复视野,刷新自己的视野
|
| | | curPlayer.SetVisible(True)
|
| | |
| | | def DoPlayerLogin(curPlayer, tick):
|
| | | #这里只做初始化逻辑
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_LoadMapIsLogin, 1)
|
| | | CrossPlayer.GetCrossPlayerMgr().RegistPlayer(curPlayer.GetPlayerID())
|
| | |
|
| | | #通知时间
|
| | | Sync_PyServerDataTimeToClient(curPlayer)
|
| | |
| | |
|
| | | DataRecordPack.DR_PlayerLogin(curPlayer)
|
| | | EventReport.WriteEvent_login(curPlayer)
|
| | | #---玩家上线, 宠物逻辑处理---
|
| | | #PetControl.DoLogic_PetInfo_OnLogin(curPlayer, tick)
|
| | | return
|
| | |
|
| | | leaveServerSecond = PlayerControl.GetPlayerLeaveServerSecond(curPlayer)
|
| | |
| | | SyncGuideState(curPlayer)
|
| | |
|
| | | #上线检查一次装备属性
|
| | | ItemControler.OnPlayerLogin(curPlayer) |
| | | #更新服务器组ID
|
| | | PlayerControl.UpdPlayerServerGroupID(curPlayer)
|
| | | ItemControler.OnPlayerLogin(curPlayer)
|
| | |
|
| | | #上线学习技能
|
| | | #SkillCommon.PlayerLoginCheckLearnSkill(curPlayer)
|
| | |
| | |
|
| | | #PKģʽ
|
| | | #SyncPKModel(curPlayer)
|
| | | |
| | | #---玩家上线, 宠物逻辑处理---
|
| | | #PetControl.DoLogic_PetInfo_OnLogin(curPlayer, tick)
|
| | | #PlayerPet.OnPlayerPetLogin(curPlayer)
|
| | |
|
| | | # 通知等级奖励领取记录
|
| | | PlayerLVAward.Sync_LVAwardGetRecordInfo(curPlayer)
|
| | |
| | |
|
| | | PlayerFamily.OnPlayerLogin(curPlayer, tick)
|
| | |
|
| | | # ʱװ
|
| | | PlayerCoat.OnLogin_Coat(curPlayer)
|
| | | |
| | | # 跨服PK
|
| | | PlayerCrossRealmPK.DoPlayerLogin(curPlayer)
|
| | | PlayerCrossChampionship.DoPlayerLogin(curPlayer)
|
| | | |
| | | # 幸运云购
|
| | | PlayerLuckyCloudBuy.OnPlayerLogin(curPlayer)
|
| | | |
| | | # 竞技场
|
| | | PlayerArena.OnLogin(curPlayer)
|
| | |
|
| | |
| | | PlayerControl.NotifyUseMoneyTotal(curPlayer)
|
| | | #通知基础属性
|
| | | #NotifyPlayerBasePoint(curPlayer)
|
| | | |
| | | #跨服充值排行
|
| | | CrossActCTGBillboard.OnPlayerLogin(curPlayer)
|
| | | #跨服全民充值
|
| | | CrossActAllRecharge.OnPlayerLogin(curPlayer)
|
| | | #消费返利
|
| | | PlayerCostRebate.OnPlayerLogin(curPlayer)
|
| | | #累计充值
|
| | | PlayerActTotalRecharge.OnPlayerLogin(curPlayer)
|
| | | #累计充值返利仙玉
|
| | | PlayerActRechargeRebateGold.OnPlayerLogin(curPlayer)
|
| | | #充值返利
|
| | | PlayerActRechargePrize.OnPlayerLogin(curPlayer)
|
| | | #成长必买
|
| | | PlayerActGrowupBuy.OnPlayerLogin(curPlayer)
|
| | | #限时特惠
|
| | |
| | | #集字活动
|
| | | PlayerActCollectWords.OnPlayerLogin(curPlayer)
|
| | | ChItem.Sync_ItemDayUseCnt(curPlayer)
|
| | | # 符印登录通知
|
| | | PlayerRune.PlayerRuneLogin(curPlayer)
|
| | | # 商店物品购买次数登录通知
|
| | | FunctionNPCCommon.ShopItemOnLogin(curPlayer)
|
| | | # 通知设置的被动功法
|
| | | #PassiveBuffEffMng.OnLoginGFPassive(curPlayer)
|
| | | # 极品白拿
|
| | | PlayerFreeGoods.OnLogin(curPlayer)
|
| | | # 周狂欢活动
|
| | | PlayerWeekParty.OnLogin(curPlayer)
|
| | | # 购买次数礼包活动
|
| | | PlayerActBuyCountGift.OnPlayerLogin(curPlayer)
|
| | | # 任务活动
|
| | |
| | | PlayerActLunhuidian.OnPlayerLogin(curPlayer)
|
| | | # 登录活动
|
| | | PlayerActLoginNew.OnPlayerLogin(curPlayer)
|
| | | # 节日巡礼活动
|
| | | PlayerFeastWeekParty.OnLogin(curPlayer)
|
| | | # 节日登录活动
|
| | | PlayerFeastLogin.OnPlayerLogin(curPlayer)
|
| | | # 节日祝福活动
|
| | |
| | | PlayerFB.OnLogin(curPlayer)
|
| | | #技能专精信息
|
| | | #SkillShell.NotifyElementSkillInfo(curPlayer)
|
| | | #通天令
|
| | | PlayerTongTianLing.OnPlayerLogin(curPlayer)
|
| | | #创角奖励
|
| | | Sync_CreateRoleAwardInfo(curPlayer)
|
| | | #自定义奖励
|
| | |
| | |
|
| | | else:
|
| | | PyMongoMain.GetUserCtrlDB().OnPlayerLogin(curPlayer)
|
| | | GMT_BroadCast.OnPlayerLogin(curPlayer)
|
| | | PlayerHero.OnPlayerLogin(curPlayer)
|
| | | PlayerMail.OnPlayerLogin(curPlayer)
|
| | | PlayerHJG.OnPlayerLogin(curPlayer)
|
| | |
| | | PlayerMingge.OnPlayerLogin(curPlayer)
|
| | | OpenServerActivity.OnPlayerLogin(curPlayer)
|
| | | PlayerPreset.OnPlayerLogin(curPlayer)
|
| | | CrossPlayer.OnPlayerLogin(curPlayer)
|
| | |
|
| | | __OnFixVersion(curPlayer) # 修正线上玩家数据用,暂时放最后
|
| | | # 上线查询一次充值订单
|
| | | # curPlayer.SendDBQueryRecharge() 不查了,由在线轮询触发即可
|
| | | SyncOnlineStateToCross(curPlayer, 1)
|
| | |
|
| | | # 通知GameServer地图最终登录成功了
|
| | | isMixServerFirstLogin = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_MixServerFirstLogin)
|
| | | msg = str([isMixServerFirstLogin])
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(curPlayer.GetID(), 0, 0, "PlayerRealLoginOK", msg, len(msg))
|
| | | return
|
| | |
|
| | | #def C2S_PlayerLoginOK(playerID):
|
| | | # ## 跨服登录成功后续处理
|
| | | # curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
|
| | | # if not curPlayer:
|
| | | # return
|
| | | # |
| | | # PlayerFamily.CrossServer_PlayerLogin(curPlayer)
|
| | | # return
|
| | |
|
| | | def __OnFixVersion(curPlayer):
|
| | | ''' 修正线上玩家数据内容
|
| | |
| | |
|
| | | # 最终强制设置为最新版本号
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FixVersion, sysFixVersion)
|
| | | return
|
| | |
|
| | | def GetSyncCrossServerIDAndFuncInfo():
|
| | | ## 获取需要同步给的目标跨服服务器ID及相关额外的功能信息
|
| | | dataEx = {}
|
| | | serverIDList = []
|
| | | |
| | | # 公会
|
| | | if DBFamily.IsFamilyCross():
|
| | | crossFamilyServerID = DBDataMgr.GetFamilyMgr().GetCurCrossServerID()
|
| | | if crossFamilyServerID > 0:
|
| | | dataEx["crossFamilyServerID"] = crossFamilyServerID
|
| | | if crossFamilyServerID not in serverIDList:
|
| | | serverIDList.append(crossFamilyServerID)
|
| | | |
| | | # 其他跨服功能
|
| | | |
| | | return serverIDList, dataEx
|
| | |
|
| | | def OnPlayerBaseInfoChange(curPlayer, refreshType=0):
|
| | | '''玩家基础信息变更同步更新其他功能,可以视为同步到以前的GameServer
|
| | | 除了相关基础值变化同步外,上下线状态变更也会附带基础信息的同步
|
| | | '''
|
| | | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | crossPlayerMgr = CrossPlayer.GetCrossPlayerMgr()
|
| | | crossPlayer = crossPlayerMgr.FindCrossPlayer(playerID)
|
| | | if not crossPlayer:
|
| | | return
|
| | | |
| | | # 公会成员
|
| | | PlayerFamily.RefreshFamilyMember(crossPlayer)
|
| | | |
| | | # 相关排行榜
|
| | | if refreshType == IPY_PlayerDefine.CDBPlayerRefresh_PlayerName:
|
| | | PlayerBillboard.UpdatePlayerBillboardName(curPlayer)
|
| | | |
| | | # 社交名待更新
|
| | | |
| | | # --------------------------------------------------------------
|
| | | |
| | | # 同步给相关跨服
|
| | | tick = GameWorld.GetGameWorld().GetTick()
|
| | | lastSyncTick = curPlayer.GetDictByKey("S2C_PlayerBaseInfo")
|
| | | if lastSyncTick and (tick - lastSyncTick) <= 2000:
|
| | | # 短时间内只同步一次
|
| | | return
|
| | | curPlayer.SetDict("S2C_PlayerBaseInfo", tick)
|
| | | |
| | | if refreshType == IPY_PlayerDefine.CDBPlayerRefresh_LV:
|
| | | if curPlayer.GetLV() < 20:
|
| | | return
|
| | | |
| | | serverIDList = GetSyncCrossServerIDAndFuncInfo()[0]
|
| | | if not serverIDList:
|
| | | return
|
| | | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | baseInfo = PlayerViewCache.GetPlayerBaseViewInfo(playerID, curPlayer)
|
| | | dataMsg = {"baseInfo":baseInfo}
|
| | | CrossMsg.SendToCrossServer(ShareDefine.S2C_PlayerBaseInfo, dataMsg, serverIDList, playerID)
|
| | | return
|
| | |
|
| | | def S2C_PlayerBaseInfo(dataMsg, fromServerID, playerID):
|
| | | isOnline = True
|
| | | baseInfo = dataMsg["baseInfo"]
|
| | | UpdCrossPlayerFromMainServer(fromServerID, playerID, baseInfo, isOnline)
|
| | | return
|
| | |
|
| | | def UpdCrossPlayerFromMainServer(fromServerID, playerID, baseInfo, isOnline):
|
| | | ## 更新CrossPlayer根据游戏服同步的信息
|
| | | # @return: crossPlayer
|
| | | crossPlayerMgr = CrossPlayer.GetCrossPlayerMgr()
|
| | | crossPlayer = crossPlayerMgr.FindCrossPlayer(playerID)
|
| | | if not crossPlayer:
|
| | | crossPlayer = crossPlayerMgr.RegistPlayer(playerID) # 跨服不存在该玩家信息,直接注册,不用管是否在线
|
| | | |
| | | # 信息更新
|
| | | curCache = PlayerViewCache.UpdPlayerBaseViewInfo(playerID, baseInfo, not isOnline)
|
| | | crossPlayer.UpdByViewCache(curCache, fromServerID)
|
| | | |
| | | # 公会成员更新
|
| | | PlayerFamily.RefreshFamilyMember(crossPlayer)
|
| | | |
| | | # 如果是离线的处理
|
| | | if not isOnline:
|
| | | PlayerViewCache.OnCrossPlayerLogout(crossPlayer)
|
| | | crossPlayerMgr.DeletePlayer(playerID)
|
| | | |
| | | return crossPlayer
|
| | |
|
| | | def SyncOnlinePlayerToCross(toCrossServerID):
|
| | | ## 重新同步在线玩家,确保目标服务器有跨服玩家基础数据,一般用于重连跨服、或某些跨服功能开启时重新同步确保目标服务器有本服在线玩家基本数据信息
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | for i in xrange(playerManager.OnlineCount()):
|
| | | curPlayer = playerManager.OnlineAt(i)
|
| | | if not GameWorld.IsNormalPlayer(curPlayer):
|
| | | continue
|
| | | SyncOnlineStateToCross(curPlayer, 1, False, toCrossServerID)
|
| | | return
|
| | |
|
| | | def SyncOnlineStateToCross(curPlayer, isOnline, isLoginout=True, toCrossServerID=0):
|
| | | ## 同步玩家在线状态给相关跨服
|
| | | # @param isLoginout: 是否上下线的,重新连上跨服时也会重新同步
|
| | | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | |
| | | # 游戏服、跨服通用,当做以前GameServer的Player处理
|
| | | crossPlayerMgr = CrossPlayer.GetCrossPlayerMgr()
|
| | | # 离线直接清除
|
| | | if not isOnline:
|
| | | crossPlayerMgr.DeletePlayer(playerID)
|
| | | |
| | | serverIDList, dataEx = GetSyncCrossServerIDAndFuncInfo()
|
| | | if not serverIDList:
|
| | | # 没有需要同步的跨服不处理
|
| | | return
|
| | | |
| | | if toCrossServerID:
|
| | | if toCrossServerID not in serverIDList:
|
| | | return
|
| | | serverIDList = [toCrossServerID] # 如果有指定,指同步给该服
|
| | | |
| | | baseInfo = PlayerViewCache.GetPlayerBaseViewInfo(playerID, curPlayer)
|
| | | dataMsg = {"isOnline":isOnline, "isLoginout":isLoginout, "baseInfo":baseInfo}
|
| | | dataMsg.update(dataEx)
|
| | | CrossMsg.SendToCrossServer(ShareDefine.S2C_OnlineState, dataMsg, serverIDList, playerID)
|
| | | return
|
| | |
|
| | | def S2C_OnlineState(dataMsg, fromServerID, playerID):
|
| | | '''收到游戏服玩家在线状态同步
|
| | | 跨服收到在线状态同步时都视为在跨服上线,需要处理跨服在线/上线的逻辑
|
| | | 不然在跨服维护游戏服不维护的情况下,等跨服重开后,游戏服重新同步在线玩家,此时如果跨服不处理登录逻辑,会少同步封包
|
| | | 如公会,跨服维护之后登录的玩家会取不到公会数据,等跨服重开后,需视为登录重新同步
|
| | | 与跨服重连一样的道理,都是重新同步所有信息
|
| | | '''
|
| | | isOnline = dataMsg["isOnline"]
|
| | | #isLoginout = dataMsg["isLoginout"] # 如果个别跨服功能有需要对真实上下线做特殊处理的可使用该参数判断
|
| | | baseInfo = dataMsg["baseInfo"]
|
| | | |
| | | crossPlayer = UpdCrossPlayerFromMainServer(fromServerID, playerID, baseInfo, isOnline)
|
| | | |
| | | # 其他跨服功能处理,暂时仅上下线时处理
|
| | | curServerID = GameWorld.GetGameWorld().GetServerID()
|
| | | #if isLoginout:
|
| | | # 公会
|
| | | if "crossFamilyServerID" in dataMsg:
|
| | | crossFamilyServerID = dataMsg["crossFamilyServerID"]
|
| | | if curServerID == crossFamilyServerID:
|
| | | if isOnline:
|
| | | PlayerFamily.OnCrossPlayerLogin(crossPlayer)
|
| | | else:
|
| | | PlayerFamily.OnCrossPlayerLogout(crossPlayer)
|
| | | |
| | | # 最后处理缓存,先放在更新中处理删除,有问题再放后面
|
| | | #if not isOnline:
|
| | | # PlayerViewCache.OnCrossPlayerLogout(crossPlayer)
|
| | | # CrossPlayer.GetCrossPlayerMgr().DeletePlayer(playerID)
|
| | | |
| | | # 最后同步处理跨服登录成功
|
| | | #if isLoginout and isOnline:
|
| | | # CrossMsg.SendToClientServer(ShareDefine.C2S_PlayerLoginOK, {}, [fromServerID], playerID)
|
| | | return
|
| | |
|
| | | ## 玩家扩展信息同步
|
| | |
| | | #检查更新总战斗力
|
| | | #PlayerBillboard.UpdatePlayerFPTotalBillboard(curPlayer, True)
|
| | |
|
| | | #清除在本地图离线记录信息
|
| | | PlayerControl.RemoveLeaveServerPlayerInfo(curPlayer.GetPlayerID())
|
| | | |
| | | PyGameData.g_needRefreshMapServerState = True # 有玩家登录地图时设置需要刷新
|
| | | return
|
| | |
|
| | |
| | | # GameObj.SetHPFull(curSummon)
|
| | | #===========================================================================
|
| | |
|
| | | #初始化宠物 通知客户端
|
| | | PetControl.Sync_PetInfo_ChangeMap(curPlayer, tick)
|
| | |
|
| | | #通知GameServer自己现在的地图
|
| | | #curPlayer.Sync_GameServer_MapID()
|
| | |
|
| | |
| | |
|
| | | #如果登录的副本,执行进入副本逻辑, 因为有时间响应, 必须在EndLoadMap之后...
|
| | | FBLogic.DoEnterFBLogic(curPlayer, tick)
|
| | | |
| | | #触发切换地图宠物逻辑
|
| | | PetControl.DoLogic_PetLoadMapOK(curPlayer)
|
| | |
|
| | | #---检查是否卡障碍---
|
| | | curMap = GameWorld.GetMap()
|
| | |
| | |
|
| | | curPlayer.ChangePos(sendPack_DestX, sendPack_DestY)
|
| | | #curPlayer.SetClientMoveTick(sendPack_WorldTick)
|
| | | |
| | | fightPet = curPlayer.GetPetMgr().GetFightPet()
|
| | | #无出战宠物
|
| | | if fightPet == None:
|
| | | return
|
| | | |
| | | if GameWorld.GetDist(fightPet.GetPosX(), fightPet.GetPosY(), sendPack_DestX, sendPack_DestY) <= 4:
|
| | | #战斗中不频繁移动
|
| | | return
|
| | |
|
| | | #出战宠物同时移动
|
| | | PetControl.FightPetFollowMove(curPlayer, sendPack_StartX, sendPack_StartY)
|
| | | |
| | | |
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | # 在UpdatePos 调用间隔内多次调用move会使 m_StartMoveTick 重置,导致无法移动
|
| | | # 而在 CheckMovePos -> PlayerRefreshPos -> __FixPlayerPos -> ChangePos 造成移动的现象
|
| | | curPlayer.Move(client_DestX, client_DestY)
|
| | |
|
| | | #出战宠物同时移动
|
| | | #PetControl.FightPetFollowMove(curPlayer, client_DestX, client_DestY, client_StartX, client_StartY)
|
| | | return
|
| | |
|
| | | ##移动点检查, checkObj 是移动对象(在人镖合一状态下, 输入为骠车
|
| | |
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PlayerKey_CrossRegisterMap, 0)
|
| | |
|
| | | #下线召回宠物
|
| | | PetControl.ReCallFightPet(curPlayer)
|
| | | |
| | | #离线session
|
| | | EventReport.WriteEvent_session(curPlayer)
|
| | |
|
| | | #最后同步跨服服务器
|
| | | SyncOnlineStateToCross(curPlayer, 0)
|
| | | #需放最后
|
| | | PlayerOnline.OnPlayerLogoff(curPlayer)
|
| | | return
|
| | |
| | | elif rebornType == ChConfig.rebornType_MainCity:
|
| | | #直接取db中配置的复活点
|
| | | PlayerControl.PlayerResetWorldPos(curPlayer, gameMap.GetRebornMapID(), gameMap.GetRebornMapX(), gameMap.GetRebornMapY())
|
| | | #重新召唤宠物
|
| | | PlayerPet.AutoSummonPet(curPlayer)
|
| | |
|
| | | #复活成功,重置状态
|
| | | PlayerControl.ChangePlayerAction(curPlayer, IPY_GameWorld.paNull)
|
| | |
| | | # WORD LineID;
|
| | | #};
|
| | | def OnEnterCrossServer(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | PlayerControl.PlayerEnterCrossServer(curPlayer, clientData.DataMapID, clientData.LineID)
|
| | | #curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | return
|
| | |
|
| | | #===============================================================================
|
| | |
| | | # 领取极品白拿
|
| | | elif rewardType == ChConfig.Def_RewardType_FreeGoods:
|
| | | PlayerFreeGoods.OnGetFreeGoods(curPlayer, dataEx)
|
| | | # 领取消费返利奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_CostRebate:
|
| | | PlayerCostRebate.OnGetCostRebateAward(curPlayer, dataEx, dataExStr)
|
| | | # 领取累计充值奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_TotalRecharge:
|
| | | PlayerActTotalRecharge.OnGetTotalRechargeAward(curPlayer, dataEx, dataExStr)
|
| | |
| | | # 领取许愿池奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_WishingWell:
|
| | | PlayerWishingWell.DoGetWishingAward(curPlayer)
|
| | | # 领取周狂欢活动奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_WeekPartyAct:
|
| | | PlayerWeekParty.GetWeekPartyActionAward(curPlayer, dataEx, dataExStr)
|
| | | # 领取周狂欢积分奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_WeekPartyPoint:
|
| | | PlayerWeekParty.GetWeekPartyPointAward(curPlayer, dataEx, dataExStr)
|
| | | # 领取登录奖励活动奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_ActLoginAwardAct:
|
| | | PlayerActLogin.GetLoginAwardActionAward(curPlayer, dataEx, dataExStr)
|
| | | # 领取节日巡礼活动奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_FeastWeekPartyAct:
|
| | | PlayerFeastWeekParty.GetFeastWeekPartyActionAward(curPlayer, dataEx, dataExStr)
|
| | | # 领取节日巡礼积分奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_FeastWeekPartyPoint:
|
| | | PlayerFeastWeekParty.GetFeastWeekPartyPointAward(curPlayer, dataEx, dataExStr)
|
| | | # 领取节日登录奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_FeastLogin:
|
| | | PlayerFeastLogin.GetFeastLoginAward(curPlayer, dataEx)
|
| | |
| | | # 领取任务活动奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_ActTask:
|
| | | PlayerActTask.OnGetActTaskAward(curPlayer, dataEx, dataExStr)
|
| | | # 领取跨服充值排行活动达标奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_CACTGBillboardDabiao:
|
| | | CrossActCTGBillboard.GetDabiaoAward(curPlayer, dataEx)
|
| | | # 跨服全民充值奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_CAAllRecharge:
|
| | | CrossActAllRecharge.GetCrossActAllRechargeAward(curPlayer, dataEx)
|
| | | # 跨服妖魔boss伤害奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_CrossYaomoBossHurt:
|
| | | PlayerCrossYaomoBoss.GetCrossYaomoBossHurtAward(curPlayer, dataEx, tick)
|
| | | # 买一送多活动免费奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_BuyOne:
|
| | | PlayerActBuyOne.GetBuyOneFreeAward(curPlayer, dataEx, dataExStr)
|
| | |
| | | # @param curPlayer
|
| | | # @param tick 时间戳
|
| | | # @return None
|
| | | def Sync_PyServerDataTimeToClient(curPlayer):
|
| | | def Sync_PyServerDataTimeToClient(curPlayer=None):
|
| | | # 服务器时间
|
| | | serverTime = GameWorld.GetCurrentTime()
|
| | | if not serverTime:
|
| | |
| | | serverDateTime.Minute = serverTime.minute
|
| | | serverDateTime.Second = serverTime.second
|
| | | serverDateTime.MicSecond = serverTime.microsecond
|
| | | serverDateTime.CrossServerTime = GameWorld.GetCrossServerTimeStr()
|
| | | serverDateTime.CrossServerTime = GameWorld.ChangeTimeNumToStr(CrossMgr.GetSSServerMgr().GetCrossTime())
|
| | |
|
| | | # 通知客户端同步时间
|
| | | NetPackCommon.SendFakePack(curPlayer, serverDateTime)
|
| | | if curPlayer:
|
| | | NetPackCommon.SendFakePack(curPlayer, serverDateTime)
|
| | | else:
|
| | | NetPackCommon.SendFackPackOnline(serverDateTime)
|
| | | return
|
| | |
|
| | | ## 通知开服天数
|
| | |
| | | curPlayer.ChangePos(sendPack_SeverPosX, sendPack_SeverPosY)
|
| | | PyNotifyPlayerMove(curPlayer, moveDir, clientPosX, clientPosY, sendPack_SeverPosX, sendPack_SeverPosY, moveType)
|
| | | curPlayer.SetClientMoveTick(sendPack_WorldTick)
|
| | | |
| | | # 后面必须返回True
|
| | | fightPet = curPlayer.GetPetMgr().GetFightPet()
|
| | | if fightPet:
|
| | | #出战宠物同时移动
|
| | | if moveType == 0 or tick - fightPet.GetActionTick() > 300:
|
| | | |
| | | PetControl.FightPetFollowMove(curPlayer,sendPack_SeverPosX, sendPack_SeverPosY)
|
| | | fightPet.SetCurAction(IPY_GameWorld.laNPCNull)
|
| | | |
| | | return True
|
| | |
|
| | |
|