using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using DuckEmulator.HabboHotel.Outside.Clients; using Database_Manager.Database.Session_Details.Interfaces; namespace DuckEmulator.GUI.Actions.Broadcast { partial class Pixels : Form { internal Pixels() { InitializeComponent(); if (!DuckEnvironment.Started) { button1.Enabled = false; } } private void button1_Click(object sender, EventArgs e) { if (int.Parse(textBox1.Text) <= 0) return; if (Online.Checked) { DuckEnvironment.SocketListener.GetFactory().GenerateClients.ForEach(UpdatePixels); } else { using (IQueryAdapter Adapter = DuckEnvironment.GetAdapter()) { Adapter.runFastQuery("UPDATE users SET pixels = pixels + " + int.Parse(textBox1.Text) + ""); } } MessageBox.Show("Send succesfully credits!"); } internal void UpdatePixels(Client Client) { if (Client == null) return; if (Client.GetHabbo() == null) return; Client.GetHabbo().UpdatePixels(int.Parse(textBox1.Text), true); } private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar > 31 && (e.KeyChar < '0' || e.KeyChar > '9')) { e.Handled = true; } } } }