private EChannelBroadcastError Broadcast_To_Channel( EPersistenceID player_id, EChannelID channel_id, string chat_message ) { CChatPlayer player = Get_Player_By_Persistence_ID( player_id ); if ( player == null ) { return EChannelBroadcastError.None; } CServerChatChannel channel = Get_Channel_By_Channel_ID( channel_id ); if ( channel == null ) { return EChannelBroadcastError.UnknownChannel; } EChannelBroadcastError error = channel.Check_Broadcast_Status( player_id ); if ( error != EChannelBroadcastError.None ) { return error; } CPlayerChatMessage chat_msg = new CPlayerChatMessage( channel_id, player.Name, chat_message ); channel.Members.Where( member_id => !Is_Ignoring_Player( member_id, player_id ) ).Apply( pid => Send_Message_To_Player( chat_msg, pid ) ); return EChannelBroadcastError.None; }
private void On_Player_Chat( CPlayerChatMessage message ) { CClientChatChannel channel = Get_Channel_By_Channel_ID( message.ChannelID ); string channel_name = null; if ( channel == null ) { channel_name = "???"; } else { channel_name = channel.ChannelName; } string chat_line = Build_Chat_Line( channel_name, message.PlayerName, message.ChatMessage, channel.ChannelNumber ); CSharedResource.Output_Text( chat_line ); }