def __init__(self):
     KBEngine.Entity.__init__(self)
     GameObject.__init__(self)
     Motion.__init__(self)
     Flags.__init__(self)
     State.__init__(self)
     Combat.__init__(self)
Example #2
0
	def onRestore(self):
		"""
		KBEngine method.
		entity的cell部分实体被恢复成功
		"""
		GameObject.onRestore(self)
		self.addTimer(1, 0, SCDefine.TIMER_TYPE_SPAWN)
	def __init__(self):
		KBEngine.Entity.__init__(self)
		NPCObject.__init__(self)
		GameObject.__init__(self)

		DEBUG_MSG("[CellApp] Weapon::__init__: called, attackId: %i" % self.attackId)
		self.territoryControllerID = 0	
Example #4
0
	def onLoseCell(self):
		"""
		KBEngine method.
		entity的cell部分实体丢失
		"""
		KBEngine.globalData["SpaceMgr"].onSpaceLoseCell(self.spaceUTypeB, self.spaceKey)
		GameObject.onLoseCell(self)
Example #5
0
	def __init__(self):
		KBEngine.Base.__init__(self)
		GameObject.__init__(self)
		
		self._spaceAllocs = {}
		self.addTimer(3, 1, wtimer.TIMER_TYPE_CREATE_SPACES)
		self.initAlloc()
		KBEngine.globalData["SpaceMgr"] = self
Example #6
0
	def __init__(self):
		GameObject.__init__(self) 
		Flags.__init__(self) 
		State.__init__(self) 
		Combat.__init__(self) 
		Spell.__init__(self) 
		Teleport.__init__(self) 
		Dialog.__init__(self) 
Example #7
0
	def onGetCell(self):
		"""
		KBEngine method.
		entity的cell部分实体被创建成功
		"""
		self.addTimer(0.1, 0.1, wtimer.TIMER_TYPE_SPACE_SPAWN_TICK)
		KBEngine.globalData["SpaceMgr"].onSpaceGetCell(self.spaceUTypeB, self, self.spaceKey)
		GameObject.onGetCell(self)
Example #8
0
	def __init__(self):
		KBEngine.Entity.__init__(self)
		GameObject.__init__(self)
		self.isReady = False
		self.clubs = {}
		self.executor = Executor()
		self.loadClubs()
		x42.ClubStub = self
Example #9
0
	def onGetCell(self):
		"""
		KBEngine method.
		entity的cell部分实体被创建成功
		"""
		self.addTimer(0.1, 0.1, wtimer.TIMER_TYPE_SPACE_SPAWN_TICK)
		KBEngine.globalData["SpaceMgr"].onSpaceGetCell(self.spaceUTypeB, self, self.spaceKey)
		GameObject.onGetCell(self)
Example #10
0
    def __init__(self):
        KBEngine.Base.__init__(self)
        GameObject.__init__(self)

        self._spaceAllocs = {}
        self.addTimer(3, 1, wtimer.TIMER_TYPE_CREATE_SPACES)
        self.initAlloc()
        KBEngine.globalData["SpaceMgr"] = self
Example #11
0
    def onLoseCell(self):
        """
		KBEngine method.
		entity的cell部分实体丢失
		"""
        KBEngine.globalData["Spaces"].onSpaceLoseCell(self.spaceUTypeB,
                                                      self.spaceKey)
        GameObject.onLoseCell(self)
 def __init__(self):
     Ouroboros.Entity.__init__(self)
     GameObject.__init__(self)
     Motion.__init__(self)
     Flags.__init__(self)
     State.__init__(self)
     Combat.__init__(self)
     AnimationState.__init__(self)
Example #13
0
 def __init__(self):
     GameObject.__init__(self)
     Flags.__init__(self)
     State.__init__(self)
     Combat.__init__(self)
     Spell.__init__(self)
     Dialog.__init__(self)
     Teleport.__init__(self)
    def onTimer(self, tid, userArg):
        """
		KBEngine method.
		引擎回调timer触发
		"""
        #DEBUG_MSG("%s::onTimer: %i, tid:%i, arg:%i" % (self.getScriptName(), self.id, tid, userArg))
        GameObject.onTimer(self, tid, userArg)
        Spell.onTimer(self, tid, userArg)
Example #15
0
    def __init__(self):
        KBEngine.Entity.__init__(self)
        GameObject.__init__(self)

        self.cellData["roomKeyC"] = self.roomKey

        # 请求在cellapp上创建cell空间
        self.createCellEntityInNewSpace(None)
Example #16
0
	def onTimer(self, tid, userArg):
		"""
		KBEngine method.
		引擎回调timer触发
		"""
		#DEBUG_MSG("%s::onTimer: %i, tid:%i, arg:%i" % (self.getScriptName(), self.id, tid, userArg))
		GameObject.onTimer(self, tid, userArg)
		Spell.onTimer(self, tid, userArg)
    def onLoseCell(self):
        """
		Ouroboros method.
		The entity part of the cell is lost
		"""
        Ouroboros.globalData["Spaces"].onSpaceLoseCell(self.spaceUTypeB,
                                                       self.spaceKey)
        GameObject.onLoseCell(self)
Example #18
0
    def __init__(self):
        GameObject.__init__(self)
        iRoomRules.__init__(self)

        self.owner_uid = 0
        self.agent = None
        self.roomID = None

        # 状态0:未开始游戏, 1:某一局游戏中
        self.state = 0

        # 存放该房间内的玩家mailbox
        self.players_dict = {}
        self.players_list = [None] * const.ROOM_PLAYER_NUMBER
        self.origin_players_list = [None] * const.ROOM_PLAYER_NUMBER

        # 上局庄家
        self.last_dealer_idx = 0
        # 庄家index
        self.dealer_idx = 0
        # 当前控牌的玩家index
        self.current_idx = 0
        # 对当前打出的牌可以进行操作的玩家的index, 服务端会限时等待他的操作
        self.wait_idx = None
        self.wait_op = None
        # 房间基础轮询timer
        self._poll_timer = None
        # 玩家操作限时timer
        self._op_timer = None
        # 一局游戏结束后, 玩家准备界面等待玩家确认timer
        self._next_game_timer = None

        #财神
        self.kingTile = 0
        #打出财神的玩家idx
        self.discardKingTileIdx = -2

        self.current_round = 0
        self.all_discard_tiles = []
        # 最后一位出牌的玩家
        self.last_player_idx = -1
        # 房间开局所有操作的记录(aid, src, des, tile)
        self.op_record = []
        # 确认继续的玩家
        self.confirm_next_idx = []

        # 解散房间操作的发起者
        self.dismiss_room_from = -1
        # 解散房间操作开始的时间戳
        self.dismiss_room_ts = 0
        # 解散房间操作投票状态
        self.dismiss_room_state_list = [0, 0, 0, 0]
        self.dismiss_timer = None
        #目前老庄数
        self.curOldDealNum = self.startOldDealNum

        # self.addTimer(const.ROOM_EXIST_TIME, 0, const.TIMER_TYPE_ROOM_EXIST)
        self.roomOpenTime = time.time()
	def onGetCell(self):
		"""
		KBEngine method.
		entity的cell部分实体被创建成功
		"""
		DEBUG_MSG("Space::onGetCell: %i" % self.id)
		self.addTimer(0.1, 0.1, SCDefine.TIMER_TYPE_SPACE_SPAWN_TICK)
		KBEngine.globalData["Spaces"].onSpaceGetCell(self.spaceUTypeB, self, self.spaceKey)
		GameObject.onGetCell(self)
Example #20
0
	def __init__(self):
		GameObject.__init__(self)
		self.createInNewSpace(None)
		
		self.spaceUTypeB = self.cellData["spaceUType"]
		
		# 这个地图上创建的entity总数
		self.tmpCreateEntityDatas = list(d_spaces.datas[self.spaceUTypeB].get("entities", []))
		self.avatars = {}
Example #21
0
	def __init__(self):
		shyloo.Base.__init__(self)
		GameObject.__init__(self)
		
		# 初始化空间分配器
		self.initAlloc()
		
		# 向全局共享数据中注册这个管理器的entityCall以便在所有逻辑进程中可以方便的访问
		shyloo.globalData["Spaces"] = self
Example #22
0
 def __init__(self):
     Ouroboros.Entity.__init__(self)
     GameObject.__init__(self)
     Flags.__init__(self)
     State.__init__(self)
     Combat.__init__(self)
     AuraBox.__init__(self)
     AbilityBox.__init__(self)
     AnimationState.__init__(self)
Example #23
0
	def __init__(self):
		GameObject.__init__(self)
		self.createInNewSpace(None)
		
		self.spaceUTypeB = self.cellData["spaceUType"]
		
		# 这个地图上创建的entity总数
		self.tmpCreateEntityDatas = list(d_spaces.datas[self.spaceUTypeB].get("entities", []))
		self.avatars = {}
Example #24
0
    def __init__(self):
        NPCObject.__init__(self)
        State.__init__(self)
        AbilityBox.__init__(self)
        AuraBox.__init__(self)
        Combat.__init__(self)
        GameObject.__init__(self)

        self.onEnable()
Example #25
0
    def __init__(self):
        KBEngine.Entity.__init__(self)
        GameObject.__init__(self)

        # 初始化空间分配器
        self.initAlloc()

        # 向全局共享数据中注册这个管理器的entityCall以便在所有逻辑进程中可以方便的访问
        KBEngine.globalData["Spaces"] = self
Example #26
0
    def __init__(self):
        KBEngine.Base.__init__(self)
        GameObject.__init__(self)

        # 初始化空间分配器
        self.initAlloc()

        # 向全局共享数据中注册这个管理器的mailbox以便在所有逻辑进程中可以方便的访问
        KBEngine.globalData["Spaces"] = self
Example #27
0
	def onGetCell(self):
		"""
		shyloo method.
		entity的cell部分实体被创建成功
		"""
		DEBUG_MSG("Space::onGetCell: %i" % self.id)
		self.addTimer(0.1, 0.1, "onTimer", SCDefine.TIMER_TYPE_SPACE_SPAWN_TICK)
		shyloo.globalData["Spaces"].onSpaceGetCell(self.spaceUTypeB, self, self.spaceKey)
		GameObject.onGetCell(self)
Example #28
0
    def __init__(self):
        KBEngine.Base.__init__(self)
        GameObject.__init__(self)

        # 初始化空间分配器
        self.initAlloc()

        # 向全局共享数据中注册这个管理器的mailbox以便在所有逻辑进程中可以方便的访问
        KBEngine.globalData["Spaces"] = self
Example #29
0
    def onTimer(self, tid, userArg):

        if userArg == SCDefine.TIMER_TYPE_WEAPON_DURATION:
            self.startDestroyTimer()

        if userArg == SCDefine.TIMER_TYPE_WEAPON_IN_WORLD:
            self.onEnterWorld()

        GameObject.onTimer(self, tid, userArg)
Example #30
0
    def __init__(self):
        KBEngine.Entity.__init__(self)
        GameObject.__init__(self)

        self.addTimer(1, 0, SCDefine.TIMER_TYPE_HEARDBEAT)  # 心跳timer, 每1秒一次

        if self.getCurrSpace().className == "SpaceCenter":
            self.mapID = 0
            self.getCurrSpace().onGateSpawn(self)
Example #31
0
    def onTimer(self, tid, userArg):
        """
		KBEngine method.
		引擎回调timer触发
		"""
        #DEBUG_MSG("%s::onTimer: %i, tid:%i, arg:%i" % (self.className, self.id, tid, userArg))
        if SCDefine.TIMER_TYPE_HEARDBEAT == userArg:
            self.onHeardTimer()

        GameObject.onTimer(self, tid, userArg)
Example #32
0
    def onTimer(self, tid, userArg):
        """
		shyloo method.
		引擎回调timer触发
		"""
        #DEBUG_MSG("%s::onTimer: %i, tid:%i, arg:%i" % (self.getScriptName(), self.id, tid, userArg))
        if SCDefine.TIMER_TYPE_HEARDBEAT == userArg:
            self.onHeardTimer()

        GameObject.onTimer(self, tid, userArg)
Example #33
0
	def __init__(self):
		KBEngine.Proxy.__init__(self)
		GameObject.__init__(self)
		Teleport.__init__(self)
		
		self.accountEntity = None
		self.cellData["dbid"] = self.databaseID
		self.nameB = self.cellData["name"]
		self.spaceUTypeB = self.cellData["spaceUType"]
		self.inventory = InventoryMgr(self)
Example #34
0
    def onTimer(self, tid, userArg):
        """
        KBEngine method.
        引擎回调timer触发
        """
        # DEBUG_MSG("%s::onTimer: %i, tid:%i, arg:%i" % (self.getScriptName(), self.id, tid, userArg))
        if SCDefine.TIMER_TYPE_DESTROY == userArg:
            self.onDestroyTimer()

        GameObject.onTimer(self, tid, userArg)
Example #35
0
	def __init__(self):
		KBEngine.Entity.__init__(self)
		GameObject.__init__(self)
		
		resPath = d_spaces.datas.get(self.spaceUType)['resPath']
		KBEngine.addSpaceGeometryMapping(self.spaceID, None, resPath)

		DEBUG_MSG('created space[%d] entityID = %i, res = %s.' % (self.spaceUType, self.id, resPath))
		
		KBEngine.globalData["space_%i" % self.spaceID] = self.base
Example #36
0
 def __init__(self):
     KBEngine.Entity.__init__(self)
     GameObject.__init__(self)
     Teleport.__init__(self)
     # 设置每秒允许的最快速度, 超速会被拉回去
     #self.topSpeed = self.moveSpeed + 5.0
     # self.topSpeedY = 10.0
     # 如果为7说明在UE4地图中,那么为了配合demo的移动速度,我们将限制设置得更大一些
     if self.spaceUType == 7:
         self.topSpeed = 0
    def __init__(self):
        Ouroboros.Entity.__init__(self)
        GameObject.__init__(self)

        # Initial space allocator
        self.initAlloc()

        # Register this manager's entityCall with global shared data for easy access in all logical processes
        Ouroboros.globalData["Spaces"] = self
        DEBUG_MSG("Spaces::init")
	def onTimer(self, tid, userArg):
		"""
		KBEngine method.
		引擎回调timer触发
		"""
		DEBUG_MSG("[BaseApp] %s::onTimer: %i, tid:%i, arg:%i" % (self.getScriptName(), self.id, tid, userArg))
		if SCDefine.TIMER_TYPE_SPACE_SPAWN_TICK == userArg:
			self.spawnOnTimer(tid)
		
		GameObject.onTimer(self, tid, userArg)
	def onTimer(self, tid, userArg):
		"""
		Ouroboros method.
		Engine callback timer trigger
		"""
		#DEBUG_MSG("%s::onTimer: %i, tid:%i, arg:%i" % (self.getScriptName(), self.id, tid, userArg))
		if ServerConstantsDefine.TIMER_TYPE_SPAWN == userArg:
			self.spawnTimer()

		GameObject.onTimer(self, tid, userArg)
Example #40
0
	def __init__(self):
		KBEngine.Entity.__init__(self)
		GameObject.__init__(self)
		Flags.__init__(self) 
		State.__init__(self) 
		SkillBox.__init__(self) 
		Combat.__init__(self) 
		Spell.__init__(self) 
		Dialog.__init__(self)
		Teleport.__init__(self)
Example #41
0
	def onTimer(self, tid, userArg):
		"""
		KBEngine method.
		引擎回调timer触发
		"""
		#DEBUG_MSG("%s::onTimer: %i, tid:%i, arg:%i" % (self.getScriptName(), self.id, tid, userArg))
		if SCDefine.TIMER_TYPE_CREATE_SPACES == userArg:
			self.createSpaceOnTimer(tid)
		
		GameObject.onTimer(self, tid, userArg)
Example #42
0
	def __init__(self):
		KBEngine.Entity.__init__(self)
		GameObject.__init__(self)
		
		resPath = d_spaces.datas.get(self.spaceUType)['resPath']
		KBEngine.addSpaceGeometryMapping(self.spaceID, None, resPath)

		DEBUG_MSG('created space[%d] entityID = %i, res = %s.' % (self.spaceUType, self.id, resPath))
		
		KBEngine.globalData["space_%i" % self.spaceID] = self.base
Example #43
0
    def __init__(self):
        GameObject.__init__(self)
        self.createInNewSpace(None)

        self.spaceUTypeB = self.cellData["spaceUType"]

        # 这个地图上创建的entity总数
        self.tmpCreateEntityDatas = copy.deepcopy(
            d_spaces_spawns.datas.get(self.spaceUTypeB, ()))
        self.avatars = {}
Example #44
0
    def onTimer(self, tid, userArg):
        """
		KBEngine method.
		引擎回调timer触发
		"""
        #DEBUG_MSG("%s::onTimer: %i, tid:%i, arg:%i" % (self.getScriptName(), self.id, tid, userArg))
        if SCDefine.TIMER_TYPE_SPACE_SPAWN_TICK == userArg:
            self.spawnOnTimer(tid)

        GameObject.onTimer(self, tid, userArg)
Example #45
0
	def onTimer(self, tid, userArg):
		"""
		KBEngine method.
		引擎回调timer触发
		"""
		#DEBUG_MSG("%s::onTimer: %i, tid:%i, arg:%i" % (self.getScriptName(), self.id, tid, userArg))
		if SCDefine.TIMER_TYPE_SPAWN == userArg:
			self.spawnTimer()
		
		GameObject.onTimer(self, tid, userArg)
Example #46
0
    def __init__(self):
        KBEngine.Proxy.__init__(self)
        GameObject.__init__(self)
        Teleport.__init__(self)

        self.accountEntity = None
        self.cellData["dbid"] = self.databaseID
        self.nameB = self.cellData["name"]
        self.spaceUTypeB = self.cellData["spaceUType"]
        self._destroyTimer = 0
Example #47
0
    def onTimer(self, tid, userArg):
        """
		KBEngine method.
		引擎回调timer触发
		"""
        #DEBUG_MSG("%s::onTimer: %i, tid:%i, arg:%i" % (self.getScriptName(), self.id, tid, userArg))
        if SCDefine.TIMER_TYPE_CREATE_SPACES == userArg:
            self.createSpaceOnTimer(tid)

        GameObject.onTimer(self, tid, userArg)
Example #48
0
	def __init__(self):
		GameObject.__init__(self) 
		Flags.__init__(self) 
		State.__init__(self) 
		Motion.__init__(self) 
		Combat.__init__(self) 
		Spell.__init__(self) 
		Teleport.__init__(self) 
		Dialog.__init__(self) 
		
		# 设置每秒允许的最快速度, 超速会被拉回去
		self.topSpeed = 10.0
	def __init__(self):
		KBEngine.Base.__init__(self)
		GameObject.__init__(self)
		self.createInNewSpace(None)
		
		self.spaceUTypeB = self.cellData["spaceUType"]		
		self.spaceResName = d_spaces.datas.get(self.spaceUTypeB)['resPath']
		
		# 这个地图上创建的entity总数
		self.tmpCreateEntityDatas = copy.deepcopy(d_spaces_spawns.datas.get(self.spaceUTypeB, ()))
		
		self.avatars = {}
	def __init__(self):
		KBEngine.Entity.__init__(self)
		GameObject.__init__(self)
		
		# 一个space代表的是一个抽象的空间,这里向这个抽象的空间添加了几何资源数据,如果数据是3D场景的
		# 该space中使用navigate寻路使用的是3D的API,如果是2D的几何数据navigate使用的是astar寻路
		resPath = d_spaces.datas.get(self.spaceUType)['resPath']
		KBEngine.addSpaceGeometryMapping(self.spaceID, None, resPath)

		DEBUG_MSG('created space[%d] entityID = %i, res = %s.' % (self.spaceUType, self.id, resPath))
		
		KBEngine.globalData["space_%i" % self.spaceID] = self.base
Example #51
0
	def __init__(self):
		GameObject.__init__(self)
		self.createInNewSpace(None)
		
		self.spaceUTypeB = self.cellData["spaceUType"]
		
		self.spaceResName = d_spaces.datas.get(self.spaceUTypeB)['resPath']
		
		# 这个地图上创建的entity总数
		self.tmpCreateEntityDatas = []
		self.avatars = {}
		self.createSpawnPointDatas()
Example #52
0
    def __init__(self):
        GameObject.__init__(self)

        resPath = d_spaces.datas.get(self.spaceUType)["resPath"]

        if resPath == "":
            resPath = "../../res/Media/Scenes/Scene1"
            KBEngine.addSpaceGeometryMapping(self.spaceID, None, resPath)
        else:
            KBEngine.addSpaceGeometryMapping(self.spaceID, None, resPath)

        DEBUG_MSG("created space[%d] entityID = %i, res = %s." % (self.spaceUType, self.id, resPath))

        KBEngine.globalData["space_%i" % self.spaceID] = self.base
Example #53
0
	def __init__(self):
		KBEngine.Entity.__init__(self)
		GameObject.__init__(self) 
		Flags.__init__(self) 
		State.__init__(self) 
		Motion.__init__(self) 
		SkillBox.__init__(self) 
		Combat.__init__(self) 
		Spell.__init__(self) 
		Teleport.__init__(self) 
		Dialog.__init__(self) 
		
		# 设置每秒允许的最快速度, 超速会被拉回去
		self.topSpeed = self.moveSpeed + 5.0
Example #54
0
	def __init__(self):
		KBEngine.Proxy.__init__(self)
		GameObject.__init__(self)
		Teleport.__init__(self)

		# 如果登录是一个副本, 无论如何登录都放置在主场景上
		spacedatas = d_spaces.datas [self.cellData["spaceUType"]]
		avatar_inittab = d_avatar_inittab.datas[self.roleType]

		if "Duplicate" in spacedatas["entityType"]:
			self.cellData["spaceUType"] = avatar_inittab["spaceUType"]
			self.cellData["direction"] = (0, 0, avatar_inittab["spawnYaw"])
			self.cellData["position"] = avatar_inittab["spawnPos"]
		
		self.accountEntity = None
		self.cellData["dbid"] = self.databaseID
		self.nameB = self.cellData["name"]
		self.spaceUTypeB = self.cellData["spaceUType"]
		
		self._destroyTimer = 0
Example #55
0
	def __init__(self):
		GameObject.__init__(self)
Example #56
0
	def __init__(self):
		GameObject.__init__(self)
		Motion.__init__(self)
Example #57
0
	def __init__(self):
		KBEngine.Entity.__init__(self)
		GameObject.__init__(self)
Example #58
0
	def __init__(self):
		GameObject.__init__(self)
		DEBUG_MSG('created space[%d] entityID = %i.' % (self.spaceUType, self.id))
		
		KBEngine.addSpaceGeometryMapping(self.spaceID, None, "../../res/Media/Scenes/Scene1")
		KBEngine.globalData["space_%i" % self.spaceID] = self.base
Example #59
0
	def __init__(self):
		GameObject.__init__(self)
		self.createCellEntity(self.createToCell)
Example #60
0
	def __init__(self):
		GameObject.__init__(self)
		DEBUG_MSG('created space[%d] entityID = %i.' % (self.spaceUType, self.id))
		#self.addSpaceGeometryMapping(self.spaceID, self.spaceName)

		KBEngine.globalData["space_%i" % self.spaceID] = self.base