def send_channel_message(sender, channel, message, lang): packet = ChatManager._get_message_packet(sender.guid, sender.chat_flags, message, ChatMsgs.CHAT_MSG_CHANNEL, lang, channel=channel) ChannelManager.broadcast_to_channel(sender, channel, packet)
def handle(world_session, socket, reader): channel = PacketReader.read_string(reader.data, 0).strip().capitalize() offset = len(channel) + 1 skip_pass = len(reader.data) == offset + 1 password = '' if skip_pass else PacketReader.read_string( reader.data, offset, 0).strip() ChannelManager.set_password(channel, world_session.player_mgr, password) return 0
def handle_add_mod(world_session, socket, reader): channel = PacketReader.read_string(reader.data, 0).strip().capitalize() offset = len(channel) + 1 has_player = len(reader.data) == offset + 1 player_name = '' if has_player else PacketReader.read_string(reader.data, offset, 0).strip()[:-1] target_player_mgr = WorldSessionStateHandler.find_player_by_name(player_name) if target_player_mgr: ChannelManager.add_mod(channel, world_session.player_mgr, target_player_mgr) else: ChatManager.send_system_message(world_session, f'No player named [{player_name}] is currently playing.') return 0
def handle(world_session, socket, reader): channel = PacketReader.read_string(reader.data, 0).strip().capitalize() ChannelManager.get_owner(channel, world_session.player_mgr) return 0
def handle_moderate(world_session, socket, reader): channel = PacketReader.read_string(reader.data, 0).strip().capitalize() ChannelManager.toggle_moderation(channel, world_session.player_mgr) return 0
def handle(world_session, socket, reader): channel = PacketReader.read_string(reader.data, 0).capitalize() ChannelManager.leave_channel(world_session.player_mgr, channel) return 0