using System; using System.Collections.Generic; using System.Linq; using System.Text; using DuckEmulator.HabboHotel.Outside.Clients; using System.Timers; using DuckEmulator.Security; namespace DuckEmulator.HabboHotel.Outside.Misc { class PixelManager { internal const int REFRESH_MILISEC = (1000 * 60 * 5); // 5 mins internal const int PIXEL_COUNT = 50; internal SecurityTimer Timer; internal DateTime LastUpdated = DateTime.Now; internal PixelManager() { Timer = new SecurityTimer(REFRESH_MILISEC, Interval); Timer.Release(); } private void Interval() { if (DuckEnvironment.ClientManager != null) { LastUpdated = DateTime.Now; foreach (Client Client in DuckEnvironment.ClientManager.Clients.Values.ToList()) { Client.GetHabbo().UpdatePixels(PIXEL_COUNT, true); if (Client.GetHabbo().Credits < 2000) { Client.GetHabbo().UpdateCredits(100, true); } } } } internal void Dispose() { if (Timer != null) { Timer = null; } } } }