changefd some methods

This commit is contained in:
plane000
2018-07-24 13:59:30 +01:00
parent 3f74792e84
commit c67293f535
3 changed files with 8 additions and 15 deletions

View File

@@ -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]);
}

View File

@@ -12,7 +12,6 @@ namespace Networking_Tools {
public List<string> WebTools;
public void Load() {
DNSTools = new List<string>() {
"getips",
"getdnsend"
@@ -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);
}
}
}

View File

@@ -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;