| | |
| | | import SkillShell
|
| | | import BuffSkill
|
| | | import PlayerControl
|
| | | import EventShell
|
| | | import PlayerRequest
|
| | | import ChEquip
|
| | | import SkillCommon
|
| | |
| | | import AttackCommon
|
| | | import ChItem
|
| | | import PlayerGMOper
|
| | | import GameLogInfo
|
| | | import PlayerMissionCollect
|
| | | import ItemCommon
|
| | | import OperControlManager
|
| | | import ShareDefine
|
| | | import PlayerAutoCheckOnline
|
| | | import PlayerGameWallow
|
| | | import ReadChConfig
|
| | | import PlayerViewCacheTube
|
| | | import PlayerDienstgrad
|
| | | import PlayerVip
|
| | | import IpyGameDataPY
|
| | |
| | | import PetControl
|
| | | import ItemControler
|
| | | import PlayerGuaji
|
| | | import PlayerTJG
|
| | | import AICommon
|
| | | import PlayerSuccess
|
| | | import CrossPlayerData
|
| | |
| | | import PlayerFlashSale
|
| | | import PlayerChatBox
|
| | | import PlayerFace
|
| | | import PlayerWing
|
| | | import ChEquip
|
| | | import PlayerYinji
|
| | | import PlayerActivity
|
| | | import PlayerBackup
|
| | |
| | |
|
| | | if prepareState == IPY_GameWorld.pstDig:
|
| | | #挖宝状态
|
| | | EventShell.EventResponse_OnDig(curPlayer)
|
| | | pass
|
| | |
|
| | | elif prepareState == IPY_GameWorld.pstSkill:
|
| | | SkillShell.SkillPrepareEnd(curPlayer, tick)
|
| | |
| | |
|
| | | elif prepareState == IPY_GameWorld.pstTownPortal:
|
| | | #战斗中回城成功
|
| | | ChItem.UseTownPortal(curPlayer)
|
| | | pass
|
| | |
|
| | | elif prepareState == IPY_GameWorld.pstMissionCollecting:
|
| | | #任务采集
|
| | | PlayerMissionCollect.EndMissionCollect(curPlayer, tick)
|
| | | pass
|
| | |
|
| | | elif prepareState == ShareDefine.Def_PstTrans:
|
| | |
|
| | |
| | | if not TransCostAfterPrepare(curPlayer):
|
| | | return
|
| | |
|
| | | PlayerControl.PlayerResetWorldPos(curPlayer, mapID, posX, posY, False)
|
| | | PlayerControl.PlayerResetWorldPos(curPlayer, mapID, posX, posY)
|
| | | #PlayerControl.NotifyCode(curPlayer, "Map_Deliver_Succeed", [mapID])
|
| | |
|
| | | #重置玩家状态
|
| | |
| | | # @return 返回值, 无意义
|
| | | # @remarks C++封包触发, 全局定时器, 处理玩家状态
|
| | | def __Func_ProcessState(tick):
|
| | | timeClock = time.clock()
|
| | | #2009-07-01断言tick >=0 ,服务器tick为DWord,超过24天未重启硬件,将导致逻辑不可预知
|
| | | if tick < 0 :
|
| | | GameWorld.Log('###服务器运行时间超过24天 tick = %s' % (tick))
|
| | |
| | | if curPlayer.GetID() == 0:
|
| | | continue
|
| | |
|
| | | ProcessPlayerState(curPlayer, tick) |
| | | |
| | | #记录玩家逻辑处理总耗时
|
| | | GameLogInfo.LogInfo_PlayerLogicTime(timeClock)
|
| | | ProcessPlayerState(curPlayer, tick)
|
| | | |
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | #副本相关时间处理
|
| | | PlayerFB.DoPlayerFBTimeProcess(curPlayer, tick)
|
| | |
|
| | | #玩家数据缓存定时同步
|
| | | PlayerViewCacheTube.ProcessCache(curPlayer, tick)
|
| | | |
| | | #脱机计算
|
| | | #PlayerTJG.ProcessPlayerTJG(curPlayer, tick)
|
| | | #挂机收益
|
| | | PlayerGuaji.ProcessGuaji(curPlayer)
|
| | |
|
| | |
| | | # return
|
| | | #===============================================================================
|
| | | return
|
| | | #---------------------------------------------------------------------
|
| | | ##GM开关活动, 地图服务器给经验
|
| | | # @param curPlayer 玩家实例
|
| | | # @param tick 时间戳
|
| | | # @return 返回值无意义
|
| | | # @remarks GM开关活动, 地图服务器给经验
|
| | | def ProcessMapGiveExp(curPlayer, tick):
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | #经验倍率
|
| | | exp_Multiple = 0
|
| | | if gameWorld.IsEventActive(ChConfig.Def_GY_GM_GameID_MapGiveExp_Ten):
|
| | | exp_Multiple = 10
|
| | | elif gameWorld.IsEventActive(ChConfig.Def_GY_GM_GameID_MapGiveExp_Fifty):
|
| | | exp_Multiple = 50
|
| | | else:
|
| | | #无活动
|
| | | return
|
| | | |
| | | mapExpTick = curPlayer.GetTickByType(ChConfig.TYPE_Player_Tick_GiveMapExp)
|
| | | |
| | | if mapExpTick == 0:
|
| | | #第一次设定当前时间
|
| | | curPlayer.SetTickByType(ChConfig.TYPE_Player_Tick_GiveMapExp, tick)
|
| | | return
|
| | | |
| | | if tick - mapExpTick < ChConfig.TYPE_Player_Tick_Time[ChConfig.TYPE_Player_Tick_GiveMapExp]:
|
| | | #没有到刷新间隔
|
| | | return
|
| | | |
| | | curPlayer.SetTickByType(ChConfig.TYPE_Player_Tick_GiveMapExp, tick) |
| | | |
| | | reExp = 0
|
| | | |
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | | #玩家经验增加 参考经验 * 经验倍率
|
| | | playerControl.AddExp(reExp * exp_Multiple)
|
| | | |
| | | return
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | ##清空玩家连续击杀数量
|
| | | # @param curPlayer 玩家实例
|
| | | # @param tick 时间戳
|