Exemplo n.º 1
0
    def create(self, id, name, size):
        if size > sujeongku.MAX_ROOM_SIZE or size < sujeongku.MIN_ROOM_SIZE or id in self.user_room:
            return -1

        with self.__room_lock:
            self.room_last_id = self.room_last_id + 1
            self.rooms[self.room_last_id] = (name, size)
            self.room_game[self.room_last_id] = sujeongku.game(size)
            self.room_size[self.room_last_id] = size
            self.room_player[self.room_last_id] = set()
            self.room_spectator[self.room_last_id] = set()

        self.join(id, self.room_last_id)
        return self.room_last_id
Exemplo n.º 2
0
    def __init__(self, conn):
        super(handler, self).__init__()
        self.__conn = conn

        self.game = sujeongku.game()
        self.players = list()
        self.symbols = dict()

        self.id = protocol.INVALID_ID
        self.rooms = list()
        self.rooms_idx = list()
        self.playing = False
        self.room_name = ""
        self.on_room = False
        self.highscore = list()

        self.__symbol_list = "ⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ"
        self.__symbol_self = "☢"

        self.__keep_running = True
Exemplo n.º 3
0
    def __init__(self, conn):
        super(handler, self).__init__()
        self.__conn = conn

        self.game = sujeongku.game()
        self.players = list()
        self.symbols = dict()

        self.id = protocol.INVALID_ID
        self.rooms = list()
        self.rooms_idx = list()
        self.playing = False
        self.room_name = ""
        self.on_room = False
        self.highscore = list()

        self.__symbol_list = "ⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ"
        self.__symbol_self = "☢"

        self.__keep_running = True