154 lines
5.7 KiB
C#
154 lines
5.7 KiB
C#
// Decompiled with JetBrains decompiler
|
|
// Type: Raton.Forms.ClientForms.Monitor.ratonChat
|
|
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
|
|
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
|
|
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
|
|
|
|
using Raton.Classes;
|
|
using RatonAccessTool.Controls;
|
|
using Server.Connection;
|
|
using Stuff;
|
|
using System;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.Drawing.Imaging;
|
|
using System.IO;
|
|
using System.Windows.Forms;
|
|
|
|
#nullable disable
|
|
namespace Raton.Forms.ClientForms.Monitor;
|
|
|
|
public class ratonChat : Form
|
|
{
|
|
private IContainer components;
|
|
private ColumnHeader columnHeader1;
|
|
private Timer timer1;
|
|
private TextBox textBox1;
|
|
public ImageList imageList1;
|
|
public AeroListView aeroListView1;
|
|
|
|
public string Username { get; set; }
|
|
|
|
public SillyClient SillyClient { get; set; }
|
|
|
|
public ratonChat()
|
|
{
|
|
this.InitializeComponent();
|
|
DarkMode.Start((Form) this);
|
|
}
|
|
|
|
private void ratonChat_Load(object sender, EventArgs e) => this.timer1.Start();
|
|
|
|
private static byte[] ImageToByteArray(Image image)
|
|
{
|
|
using (MemoryStream memoryStream = new MemoryStream())
|
|
{
|
|
image.Save((Stream) memoryStream, ImageFormat.Png);
|
|
return memoryStream.ToArray();
|
|
}
|
|
}
|
|
|
|
private void ratonChat_FormClosing(object sender, FormClosingEventArgs e)
|
|
{
|
|
Pack pack = new Pack();
|
|
pack.SetString("Packet", "CloseChat");
|
|
this.SillyClient.Send(pack.Pacc());
|
|
}
|
|
|
|
private void timer1_Tick(object sender, EventArgs e)
|
|
{
|
|
if (this.SillyClient != null && this.SillyClient.isConnected())
|
|
return;
|
|
this.Close();
|
|
}
|
|
|
|
private void textBox1_Enter(object sender, EventArgs e) => this.textBox1.Clear();
|
|
|
|
private void textBox1_KeyDown(object sender, KeyEventArgs e)
|
|
{
|
|
if (e.KeyCode != Keys.Return)
|
|
return;
|
|
byte[] byteArray = ratonChat.ImageToByteArray(this.imageList1.Images[1]);
|
|
ListViewItem listViewItem = new ListViewItem($"[{this.Username}]: {this.textBox1.Text}");
|
|
listViewItem.ImageIndex = 1;
|
|
this.aeroListView1.Items.Add(listViewItem);
|
|
listViewItem.EnsureVisible();
|
|
Pack pack = new Pack();
|
|
pack.SetString("Packet", "ChatMessage");
|
|
pack.Set("img", byteArray);
|
|
pack.SetString("Message", $"[{this.Username}]: {this.textBox1.Text}");
|
|
this.SillyClient.Send(pack.Pacc());
|
|
e.SuppressKeyPress = true;
|
|
this.textBox1.Clear();
|
|
}
|
|
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
if (disposing && this.components != null)
|
|
this.components.Dispose();
|
|
base.Dispose(disposing);
|
|
}
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
this.components = (IContainer) new System.ComponentModel.Container();
|
|
ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (ratonChat));
|
|
AeroListView.ListViewColumnSorter viewColumnSorter = new AeroListView.ListViewColumnSorter();
|
|
this.imageList1 = new ImageList(this.components);
|
|
this.timer1 = new Timer(this.components);
|
|
this.textBox1 = new TextBox();
|
|
this.aeroListView1 = new AeroListView();
|
|
this.columnHeader1 = new ColumnHeader();
|
|
this.SuspendLayout();
|
|
this.imageList1.ImageStream = (ImageListStreamer) componentResourceManager.GetObject("imageList1.ImageStream");
|
|
this.imageList1.TransparentColor = Color.Transparent;
|
|
this.imageList1.Images.SetKeyName(0, "uservro.jpg");
|
|
this.timer1.Tick += new EventHandler(this.timer1_Tick);
|
|
this.textBox1.BorderStyle = BorderStyle.FixedSingle;
|
|
this.textBox1.Dock = DockStyle.Bottom;
|
|
this.textBox1.Location = new Point(0, 469);
|
|
this.textBox1.MaxLength = 280;
|
|
this.textBox1.Name = "textBox1";
|
|
this.textBox1.Size = new Size(717, 21);
|
|
this.textBox1.TabIndex = 1;
|
|
this.textBox1.Text = "Click here to type a message, then press the enter to your client";
|
|
this.textBox1.Enter += new EventHandler(this.textBox1_Enter);
|
|
this.textBox1.KeyDown += new KeyEventHandler(this.textBox1_KeyDown);
|
|
this.aeroListView1.BorderStyle = BorderStyle.FixedSingle;
|
|
this.aeroListView1.Columns.AddRange(new ColumnHeader[1]
|
|
{
|
|
this.columnHeader1
|
|
});
|
|
this.aeroListView1.Dock = DockStyle.Fill;
|
|
this.aeroListView1.FullRowSelect = true;
|
|
this.aeroListView1.HeaderStyle = ColumnHeaderStyle.None;
|
|
this.aeroListView1.HideSelection = false;
|
|
this.aeroListView1.Location = new Point(0, 0);
|
|
viewColumnSorter.Order = SortOrder.None;
|
|
viewColumnSorter.SortColumn = 0;
|
|
this.aeroListView1.LvwColumnSorter = viewColumnSorter;
|
|
this.aeroListView1.Name = "aeroListView1";
|
|
this.aeroListView1.Size = new Size(717, 490);
|
|
this.aeroListView1.SmallImageList = this.imageList1;
|
|
this.aeroListView1.TabIndex = 0;
|
|
this.aeroListView1.UseCompatibleStateImageBehavior = false;
|
|
this.aeroListView1.View = View.Details;
|
|
this.columnHeader1.Text = "Username";
|
|
this.columnHeader1.Width = 715;
|
|
this.AutoScaleDimensions = new SizeF(7f, 14f);
|
|
this.AutoScaleMode = AutoScaleMode.Font;
|
|
this.ClientSize = new Size(717, 490);
|
|
this.Controls.Add((Control) this.textBox1);
|
|
this.Controls.Add((Control) this.aeroListView1);
|
|
this.Font = new Font("Microsoft JhengHei UI", 8.25f, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
|
|
this.Icon = (Icon) componentResourceManager.GetObject("$this.Icon");
|
|
this.Name = nameof (ratonChat);
|
|
this.StartPosition = FormStartPosition.CenterScreen;
|
|
this.Text = nameof (ratonChat);
|
|
this.FormClosing += new FormClosingEventHandler(this.ratonChat_FormClosing);
|
|
this.Load += new EventHandler(this.ratonChat_Load);
|
|
this.ResumeLayout(false);
|
|
this.PerformLayout();
|
|
}
|
|
}
|