def __init__(self, action=None, response=None, notify=None, react={}): self._action = mapping('game_action') if action: self._action.extend(action) self._response = mapping('game_response') if response: self._response.extend(response) self._notify = mapping('game_notify') if notify: self._notify.extend(notify) rmap = GAME_REACTION.copy() rmap.update(react) self._reactor = Reactor(rmap) self._queue = deque() self._qlock = Lock() self._clisten = socket(AF_INET, SOCK_STREAM) self._clisten.setblocking(0) self._clisten.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) self._nlisten = socket(AF_INET, SOCK_STREAM) self._nlisten.setblocking(0) self._nlisten.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) self._poll = poll() self._clients = set() self._idle = {} # map of idle clients by their fileno self._anotifys = {} # map of anonymous notify sockets by their claim key
def __init__(self, action=None, response=None, notify=None): amap = mapping('game_action') if action: amap.extend(action) rmap = mapping('game_response') if response: rmap.extend(response) nmap = mapping('game_notify') if notify: nmap.extend(notify) self.control = Stream(send=amap, recv=rmap) self.notify = Stream(recv=nmap) self._handlers = deque() self._poll = poll() self.debugs = [] self.nhook = self.ndebug self.destroyed = False
def __init__(self, data): super().__init__(mapping("world_action"), mapping("world_response"), mapping("world_notify"), WORLD_REACTION) self._data = data self._units = {}
def __init__(self, data): super().__init__(mapping('realm_action'), mapping('realm_response'), mapping('realm_notify'), REALM_REACTION) self._data = data self._avatars = {}
def __init__(self): super().__init__(mapping('world_action'), mapping('world_response'), mapping('world_notify'))
def __init__(self): super().__init__(mapping("realm_action"), mapping("realm_response"), mapping("realm_notify"))