changefd some methods
This commit is contained in:
@@ -3,11 +3,11 @@ using System.Linq;
|
||||
|
||||
namespace Networking_Tools {
|
||||
class CLI_Tools {
|
||||
public string[] ParseInput(string arr) => arr.ToLower().Split(' ');
|
||||
public static string[] ParseInput(string arr) => arr.ToLower().Split(' ');
|
||||
|
||||
public string[] TrimFirst(string[] arr) => arr.Where(w => w != arr[0]).ToArray();
|
||||
public static string[] TrimFirst(string[] arr) => arr.Where(w => w != arr[0]).ToArray();
|
||||
|
||||
public void PrintArray(string[] arr) {
|
||||
public static void PrintArray(string[] arr) {
|
||||
for (int i = 0; i < arr.Length; i++) {
|
||||
Console.WriteLine(arr[i]);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ namespace Networking_Tools {
|
||||
public List<string> WebTools;
|
||||
|
||||
public void Load() {
|
||||
|
||||
DNSTools = new List<string>() {
|
||||
"getips",
|
||||
"getdnsend"
|
||||
@@ -26,7 +25,7 @@ namespace Networking_Tools {
|
||||
Console.SetCursorPosition(0, 0);
|
||||
startHeight = Console.WindowHeight;
|
||||
startWidth = Console.WindowWidth;
|
||||
MainMenu();
|
||||
MainMenu();
|
||||
}
|
||||
|
||||
public void MainMenu() {
|
||||
@@ -34,7 +33,7 @@ namespace Networking_Tools {
|
||||
Console.WriteLine("Networking Tools by Benjamin Kyd");
|
||||
Connectivity_Test test = new Connectivity_Test();
|
||||
while (true) {
|
||||
if (test.checkConnection("www.plane000.co.uk")) {
|
||||
if (test.checkConnection("www.google.com")) {
|
||||
Console.Write("> ");
|
||||
getInput();
|
||||
} else {
|
||||
@@ -46,12 +45,10 @@ namespace Networking_Tools {
|
||||
}
|
||||
|
||||
private void getInput() {
|
||||
CLI_Tools cli = new CLI_Tools();
|
||||
|
||||
var input = Console.ReadLine().Trim();
|
||||
|
||||
string[] parsed = cli.ParseInput(input);
|
||||
string[] trimmed = cli.TrimFirst(parsed);
|
||||
string[] parsed = CLI_Tools.ParseInput(input);
|
||||
string[] trimmed = CLI_Tools.TrimFirst(parsed);
|
||||
string[] response = new string[0];
|
||||
|
||||
switch (parsed[0]) {
|
||||
@@ -78,7 +75,7 @@ namespace Networking_Tools {
|
||||
break;
|
||||
}
|
||||
|
||||
cli.PrintArray(response);
|
||||
CLI_Tools.PrintArray(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,10 +17,6 @@ io.on('connection', (socket) => {
|
||||
console.log(`${utils.currenttime()} new client connected at ${ip}`)
|
||||
|
||||
socket.on('outward', async function(data) {
|
||||
if (ip == '86.11.58.84' || ip == '178.128.34.116') {
|
||||
socket.emit('receive', 'gey lol');
|
||||
return;
|
||||
}
|
||||
|
||||
// let rate = await rateLimit(socket);
|
||||
// if (rate == -1) return;
|
||||
|
||||
Reference in New Issue
Block a user