本文整理匯總了Python中app.scense.core.PlayersManager.PlayersManager.startAllTimer方法的典型用法代碼示例。如果您正苦於以下問題:Python PlayersManager.startAllTimer方法的具體用法?Python PlayersManager.startAllTimer怎麽用?Python PlayersManager.startAllTimer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app.scense.core.PlayersManager.PlayersManager
的用法示例。
在下文中一共展示了PlayersManager.startAllTimer方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: leaveScene_610
# 需要導入模塊: from app.scense.core.PlayersManager import PlayersManager [as 別名]
# 或者: from app.scense.core.PlayersManager.PlayersManager import startAllTimer [as 別名]
def leaveScene_610(dynamicId,characterId):
'''離開場景'''
player = PlayersManager().getPlayerByID(characterId)
if not player:
return None,0
player.stopAllTimer()
playerDumps = cPickle.dumps(player)
player.startAllTimer()
placeId = player.baseInfo.getTown()
return playerDumps,placeId
示例2: enterInstance1
# 需要導入模塊: from app.scense.core.PlayersManager import PlayersManager [as 別名]
# 或者: from app.scense.core.PlayersManager.PlayersManager import startAllTimer [as 別名]
def enterInstance1(player,dynamicId,characterId,instanceId,famId):
'''進入副本
@param dynamicId: int 角色動態Id
@param characterId: int 角色Id
@param instanceId: int 副本Id
'''
player=PlayersManager().getPlayerByID(characterId)
if not player:
return {'result':False,'message':Lg().g(18)}
if player.baseInfo.getState==1: #角色在副本中
return {'result':False,'message':Lg().g(114)}
player.startAllTimer()
Instan1= InstanceManager().addInstance(instanceId,famId) #把副本添加到副本管理器中,返回副本管理器中的這個副本實例
scenename = Instan1._name
chatnoderemote.callRemote('JoinRoom',characterId,famId,scenename)
# Instan1.setTag(famId)
if not Instan1:
return {'result':False,'message':u'沒有id為%d的副本'%instanceId}
activationInstance(Instan1, player) #激活副本
enterplay(player,instanceId,Instan1) #角色進入副本操作
data = {'placeId':Instan1.getSceneResourceidByid(Instan1._inSceneid)}
player.baseInfo.setInstanceid(instanceId)
return {'result':True,'message':u'進入副本成功','data':data} #返回副本初始Id