Beispiel #1
0
        internal void SerializeOfflineMessages(GameClient Session)
        {
            List <MessengerChatInfo> mci = MessengerChat.GetMessagesByUserId(Session.GetHabbo().Id);

            if (mci == null)
            {
                return;
            }

            foreach (MessengerChatInfo m in mci)
            {
                Session.GetHabbo().GetMessenger().SendInstantMessageOffline(m.UserID, m.Message, m.timeSended);
            }

            MessengerChat.ClearMessageToId(Session.GetHabbo().Id);
        }
Beispiel #2
0
        internal void SendInstantMessage(uint ToId, string Message)
        {
            if (GetClient() != null && GetClient().GetHabbo() != null && OtanixEnvironment.GetGame().GetPrisaoManager().estaPreso(GetClient().GetHabbo().Id))
            {
                GetClient().SendNotif(LanguageLocale.GetValue("prisao.chatamigos"));
                return;
            }

            if (GetClient() != null && GetClient().GetHabbo() != null && !GetClient().GetHabbo().passouPin)
            {
                GetClient().SendNotif("Você precisa digitar o pin staff");
                return;
            }

            if (ToId == EmuSettings.CHAT_USER_ID)
            {
                if (!GetClient().GetHabbo().HasFuse("fuse_chat_staff")) // no inyections
                {
                    return;
                }

                ServerMessage InstantMessage = new ServerMessage(Outgoing.InstantChat);
                InstantMessage.AppendUInt(EmuSettings.CHAT_USER_ID);
                InstantMessage.AppendString(GetClient().GetHabbo().Username + ": " + Message);
                InstantMessage.AppendInt32(0);
                OtanixEnvironment.GetGame().GetClientManager().QueueBroadcaseMessage(InstantMessage, "fuse_chat_staff", UserId);

                return;
            }

            if (!FriendshipExists(ToId))
            {
                DeliverInstantMessageError(6, ToId);
                return;
            }

            var Client = OtanixEnvironment.GetGame().GetClientManager().GetClientByUserID(ToId);

            if (Client == null || Client.GetHabbo() == null || Client.GetHabbo().GetMessenger() == null)
            {
                // DeliverInstantMessageError(5, ToId);
                MessengerChat.AddMessageToId(UserId, ToId, Message);
                return;
            }

            if (OtanixEnvironment.GetGame().GetMuteManager().HasMuteExpired(GetClient().GetHabbo().Id) > 0)
            {
                DeliverInstantMessageError(4, ToId);
                return;
            }

            if (OtanixEnvironment.GetGame().GetMuteManager().HasMuteExpired(Client.GetHabbo().Id) > 0)
            {
                DeliverInstantMessageError(3, ToId); // No return, as this is just a warning.
            }

            if (Message == "")
            {
                return;
            }

            SpyChatMessage.SaveUserLog(UserId, 0, ToId, Message);
            Client.GetHabbo().GetMessenger().DeliverInstantMessage(Message, UserId);
        }