Example #1
0
        public void Whisper(Habbo session, string message, ChatBubbleStyle bubble, RoomEntity target, int count = -1)
        {
            if (!Validate(ref message) || TryHandleCommand(message) || !bubble.CanUse(session.Info))
            {
                return;
            }

            session.RoomEntity.Wake();

            ChatMessage entry = CreateMessage(session, message, bubble);

            entry.Whisper = true;
            // TODO Save Whisper target
            // TODO Save Chatlog

            session.Router.GetComposer <WhisperMessageComposer>().Compose(session, entry, count);

            if (target != null)
            {
                target.HandleChatMessage(session.RoomEntity, targetSession =>
                {
                    targetSession.Router.GetComposer <WhisperMessageComposer>()
                    .Compose(targetSession, entry, count);
                });
            }

            // TODO Trigger Wired
        }
Example #2
0
        private void Chat(Habbo session, string message, ChatBubbleStyle bubble, Action <Habbo, ChatMessage> composer)
        {
            if (!Validate(ref message) || TryHandleCommand(message) || !bubble.CanUse(session.Info))
            {
                return;
            }

            session.RoomEntity.Wake();

            ChatMessage entry = CreateMessage(session, message, bubble);

            session.Info.Preferences.ChatBubbleStyle = bubble;
            // TODO Save Preferences
            // TODO Save Chatlog
            session.Room.EachEntity(
                entity => { entity.HandleChatMessage(session.RoomEntity, user => composer(user, entry)); }
                );

            // TODO Trigger Wired
        }