def send_create_room_req( sock, name ): msg = messages_pb2.ClientToServerMsg() msg.create_room_req.room_config.name = name msg.create_room_req.room_config.password_protected = False msg.create_room_req.room_config.chair_count = 8 msg.create_room_req.room_config.bot_count = 4 # add rounds for i in range(0,3): round = msg.create_room_req.room_config.rounds.add() round.booster_round_config.clockwise = True round.booster_round_config.time = 30 bundle = round.booster_round_config.card_bundles.add() bundle.set_code = "10E" bundle.method = messages_pb2.RoomConfiguration.CardBundle.METHOD_BOOSTER bundle.set_replacement = True txrx.send_msg( sock, msg )
def send_create_room_req(sock, name): msg = messages_pb2.ClientToServerMsg() msg.create_room_req.room_config.name = name msg.create_room_req.room_config.password_protected = False msg.create_room_req.room_config.chair_count = 8 msg.create_room_req.room_config.bot_count = 4 # add rounds for i in range(0, 3): round = msg.create_room_req.room_config.rounds.add() round.booster_round_config.clockwise = True round.booster_round_config.time = 30 bundle = round.booster_round_config.card_bundles.add() bundle.set_code = "10E" bundle.method = messages_pb2.RoomConfiguration.CardBundle.METHOD_BOOSTER bundle.set_replacement = True txrx.send_msg(sock, msg)
def send_player_card_selection_req(sock, pack_id, card): msg = messages_pb2.ClientToServerMsg() msg.player_card_selection_req.pack_id = pack_id msg.player_card_selection_req.card.name = card.name msg.player_card_selection_req.card.set_code = card.set_code txrx.send_msg(sock, msg)
def send_player_ready_ind(sock, ready): msg = messages_pb2.ClientToServerMsg() msg.player_ready_ind.ready = ready txrx.send_msg(sock, msg)
def send_join_room_req(sock, room_id): msg = messages_pb2.ClientToServerMsg() msg.join_room_req.room_id = room_id txrx.send_msg(sock, msg)
def send_login_req(sock, name): msg = messages_pb2.ClientToServerMsg() msg.login_req.name = name txrx.send_msg(sock, msg)
def send_room_chat_message_ind(sock, text): msg = messages_pb2.ClientToServerMsg() msg.chat_message_ind.scope = messages_pb2.CHAT_SCOPE_ROOM msg.chat_message_ind.text = text txrx.send_msg(sock, msg)
def send_keep_alive_ind(sock): msg = messages_pb2.ClientToServerMsg() msg.keep_alive_ind.SetInParent() # this is how to set an empty message txrx.send_msg(sock, msg)
def send_player_card_selection_req( sock, pack_id, card ): msg = messages_pb2.ClientToServerMsg() msg.player_card_selection_req.pack_id = pack_id msg.player_card_selection_req.card.name = card.name msg.player_card_selection_req.card.set_code = card.set_code txrx.send_msg( sock, msg )
def send_player_ready_ind( sock, ready ): msg = messages_pb2.ClientToServerMsg() msg.player_ready_ind.ready = ready txrx.send_msg( sock, msg )
def send_join_room_req( sock, room_id ): msg = messages_pb2.ClientToServerMsg() msg.join_room_req.room_id = room_id txrx.send_msg( sock, msg )
def send_login_req( sock, name ): msg = messages_pb2.ClientToServerMsg() msg.login_req.name = name txrx.send_msg( sock, msg )
def send_room_chat_message_ind( sock, text ): msg = messages_pb2.ClientToServerMsg() msg.chat_message_ind.scope = messages_pb2.CHAT_SCOPE_ROOM msg.chat_message_ind.text = text txrx.send_msg( sock, msg )
def send_keep_alive_ind( sock ): msg = messages_pb2.ClientToServerMsg() msg.keep_alive_ind.SetInParent() # this is how to set an empty message txrx.send_msg( sock, msg )