Esempio n. 1
0
        /// <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);
        }
Esempio n. 2
0
 public void OnLeaveRoom()
 {
     try
     {
         if (GlobalClass.RecordRoomVisits)
         {
             using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
             {
                 adapter.ExecuteQuery(string.Concat(new object[]
                 {
                     "UPDATE user_roomvisits SET exit_timestamp = UNIX_TIMESTAMP() WHERE room_id = '",
                     CurrentRoomId,
                     "' AND user_id = '",
                     Id,
                     "' ORDER BY entry_timestamp DESC LIMIT 1"
                 }));
             }
         }
     }
     catch { }
     this.CurrentRoomId = 0;
     if (Messenger != null)
     {
         Messenger.OnStatusChanged(false);
     }
 }
Esempio n. 3
0
        internal void InitMessenger()
        {
            GameClient Client = GetClient();

            if (Client == null)
            {
                return;
            }
            Messenger.OnStatusChanged(false);

            Client.SendMessage(Messenger.SerializeFriends());
            Client.SendMessage(Messenger.SerializeRequests());
        }
Esempio n. 4
0
        internal void InitMessenger()
        {
            GameClient Client = GetClient();

            if (Client == null)
            {
                return;
            }
            Messenger.OnStatusChanged(false);

            Client.SendMessage(Messenger.SerializeFriends());
            Client.SendMessage(Messenger.SerializeRequests());

            // TODO: Change spanishfuck into locale message
            if (Messenger.requests.Count > FirewindEnvironment.friendRequestLimit)
            {
                Client.SendNotif("Tienes más de " + FirewindEnvironment.friendRequestLimit + " peticiones de amigos, por lo que solo hemos cargado " + FirewindEnvironment.friendRequestLimit + " y las próximas serán cargadas una vez aceptes estas y reinicies sesión!");
            }
        }