Esempio n. 1
0
	def __init__(self):
		from Driver import LoginListener
		import threading
		import CommandEngine
		
		Engine.__init__(self)
		
		attributes = {
			'openConnectionsSemaphore'	: threading.BoundedSemaphore(3),
			'newConnectionSemaphore'	: threading.BoundedSemaphore(1),
			'closedConnectionSemaphore' : threading.BoundedSemaphore(1),
			'connectionList'			: [],
			'newConnections'			: [],
			'closedConnections'			: []
		}
		
		for key in attributes.keys():
			self.attributes[key] = attributes[key]


		self.addEventHandlerByNameWithAdjusters('Engine.EventHandlers.ConnectionEngine.PlayerLoginHandler', None)
		self.addEventHandlerByNameWithAdjusters('Engine.EventHandlers.ConnectionEngine.PlayerLogoutHandler', None)
		
		ConnectionEngine.instance = self
		
		LoginListener.addEventSubscriber(self)
		CommandEngine.addEventSubscriber(self)
Esempio n. 2
0
	def __init__(self):
		import Driver.ConnectionListUpdater
		import CommandEngine
		
		Engine.__init__(self)
		
		attributes = {
			'roomMap'	: {},
			'roomList'	: []
		}
		
		for key in attributes.keys():
			self.attributes[key] = attributes[key]
		
		self.addEventHandlerByNameWithAdjusters('Engine.EventHandlers.RoomEngine.PlayerLoginEventHandler', None)
		self.addEventHandlerByNameWithAdjusters('Engine.EventHandlers.RoomEngine.PlayerLogoutEventHandler', None)
		
		RoomEngine.instance = self
		
		for subscriber in RoomEngine.subscribers:
			self.addEventSubscriber(subscriber)
			
		RoomEngine.subscribers = []
		
		self.buildWorld()
		
		Driver.ConnectionListUpdater.addEventSubscriber(self)
		CommandEngine.addEventSubscriber(self)
Esempio n. 3
0
    def __init__(self):
        Engine.__init__(self)

        import CommandEngine
        import threading
        import Driver.ConnectionListUpdater

        attributes = {
            'playerSetSemaphore': threading.BoundedSemaphore(1),
            'playerMap': {},
            'playerList': [],
            'npcMap': {}
        }

        for key in attributes.keys():
            self.attributes[key] = attributes[key]

        ActorEngine.instance = self

        self.addEventHandlerByNameWithAdjusters(
            'Engine.EventHandlers.ActorEngine.PlayerLoginEventHandler', None)
        self.addEventHandlerByNameWithAdjusters(
            'Engine.EventHandlers.ActorEngine.PlayerLogoutEventHandler', None)
        self.addEventHandlerByNameWithAdjusters(
            'Engine.EventHandlers.ActorEngine.BroadcastEventHandler', None)

        for subscriber in ActorEngine.subscribers:
            self.addEventSubscriber(subscriber)

        ActorEngine.subscribers = []

        Driver.ConnectionListUpdater.addEventSubscriber(self)
        CommandEngine.addEventSubscriber(self)
Esempio n. 4
0
    def __init__(self):
        from Driver import LoginListener
        import threading
        import CommandEngine

        Engine.__init__(self)

        attributes = {
            'openConnectionsSemaphore': threading.BoundedSemaphore(3),
            'newConnectionSemaphore': threading.BoundedSemaphore(1),
            'closedConnectionSemaphore': threading.BoundedSemaphore(1),
            'connectionList': [],
            'newConnections': [],
            'closedConnections': []
        }

        for key in attributes.keys():
            self.attributes[key] = attributes[key]

        self.addEventHandlerByNameWithAdjusters(
            'Engine.EventHandlers.ConnectionEngine.PlayerLoginHandler', None)
        self.addEventHandlerByNameWithAdjusters(
            'Engine.EventHandlers.ConnectionEngine.PlayerLogoutHandler', None)

        ConnectionEngine.instance = self

        LoginListener.addEventSubscriber(self)
        CommandEngine.addEventSubscriber(self)
Esempio n. 5
0
    def __init__(self):
        import Driver.ConnectionListUpdater
        import CommandEngine

        Engine.__init__(self)

        attributes = {'roomMap': {}, 'roomList': []}

        for key in attributes.keys():
            self.attributes[key] = attributes[key]

        self.addEventHandlerByNameWithAdjusters(
            'Engine.EventHandlers.RoomEngine.PlayerLoginEventHandler', None)
        self.addEventHandlerByNameWithAdjusters(
            'Engine.EventHandlers.RoomEngine.PlayerLogoutEventHandler', None)

        RoomEngine.instance = self

        for subscriber in RoomEngine.subscribers:
            self.addEventSubscriber(subscriber)

        RoomEngine.subscribers = []

        self.buildWorld()

        Driver.ConnectionListUpdater.addEventSubscriber(self)
        CommandEngine.addEventSubscriber(self)
Esempio n. 6
0
	def __init__(self):
		Engine.__init__(self)
		
		import CommandEngine
		import threading
		import Driver.ConnectionListUpdater
		
		attributes = {
			'playerSetSemaphore'	: threading.BoundedSemaphore(1),
			'playerMap'				: {},
			'playerList'			: [],
			'npcMap'				: {}
		}
		
		for key in attributes.keys():
			self.attributes[key] = attributes[key]
			
		ActorEngine.instance = self
	
		self.addEventHandlerByNameWithAdjusters('Engine.EventHandlers.ActorEngine.PlayerLoginEventHandler', None)
		self.addEventHandlerByNameWithAdjusters('Engine.EventHandlers.ActorEngine.PlayerLogoutEventHandler', None)
		self.addEventHandlerByNameWithAdjusters('Engine.EventHandlers.ActorEngine.BroadcastEventHandler', None)
		
		
		for subscriber in ActorEngine.subscribers:
			self.addEventSubscriber(subscriber)
			
		ActorEngine.subscribers = []
		
		
		Driver.ConnectionListUpdater.addEventSubscriber(self)
		CommandEngine.addEventSubscriber(self)