예제 #1
0
파일: Habbo.cs 프로젝트: xXSicilyXx/Yupi
        /// <summary>
        ///     Initializes the messenger.
        /// </summary>
        internal void InitMessenger()
        {
            GameClient client = GetClient();

            if (client == null)
            {
                return;
            }

            client.SendMessage(_messenger.SerializeCategories());
            client.SendMessage(_messenger.SerializeFriends());
            client.SendMessage(_messenger.SerializeRequests());

            if (Yupi.OfflineMessages.ContainsKey(Id))
            {
                List <OfflineMessage> list = Yupi.OfflineMessages[Id];
                foreach (OfflineMessage current in list)
                {
                    client.SendMessage(_messenger.SerializeOfflineMessages(current));
                }
                Yupi.OfflineMessages.Remove(Id);
                OfflineMessage.RemoveAllMessages(Yupi.GetDatabaseManager().GetQueryReactor(), Id);
            }

            if (_messenger.Requests.Count > Yupi.FriendRequestLimit)
            {
                client.SendNotif(Yupi.GetLanguage().GetVar("user_friend_request_max"));
            }

            _messenger.OnStatusChanged(false);
        }
예제 #2
0
        internal void InitMessenger()
        {
            var Client = GetClient();

            if (Client == null || Messenger == null || Messenger.requests == null)
            {
                return;
            }

            OtanixEnvironment.GetGame().GetClientManager().QueueConsoleUpdate(Client);
            friendsCount = Messenger.myFriends;

            Client.SendMessage(Messenger.SerializeFriendsCategories(Client.GetHabbo()));
            Client.SendMessage(Messenger.SerializeFriends(Client.GetHabbo()));
            Client.SendMessage(Messenger.SerializeRequests(Client));
            Messenger.SerializeOfflineMessages(Client);
        }