Skip to content

Commit 5268fe9

Browse files
committed
Revert "added compression to packages before send or after recived"
This reverts commit d9beb78.
1 parent d9beb78 commit 5268fe9

5 files changed

Lines changed: 17 additions & 121 deletions

File tree

ServQLTerminal/Program.cs

Lines changed: 15 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3-
using ServQLClient;
3+
using SQLiteCLIENT;
44

55
namespace ServQLTerminal
66
{
@@ -9,14 +9,6 @@ class Program
99
public static Connection connection { get; set; }
1010
public static Client client { get; set; }
1111

12-
public static void ClearLine()
13-
{
14-
15-
Console.CursorLeft = 0;
16-
Console.Write(new String(' ',50));
17-
Console.CursorLeft = 0;
18-
19-
}
2012
public static string getPassword()
2113
{
2214
string result = string.Empty;
@@ -50,47 +42,20 @@ public static string getPassword()
5042
}
5143
static void Main(string[] args)
5244
{
53-
bool header = false;
5445
Console.WriteLine("ServQL Client");
55-
int cursor = 0;
56-
if (args.Length == 1) connection = new Connection(args[0]);
46+
if (args.Length == 1) connection = new Connection(args[1]);
5747
else
5848
{
5949
Console.Write("IP: ");
6050
connection = new Connection(Console.ReadLine());
61-
cursor = Console.CursorTop;
62-
Console.WriteLine("Connecting...");
63-
}
64-
try
65-
{
66-
client = new Client(connection);
67-
68-
}catch(Exception E)
69-
{
70-
Console.CursorTop = cursor;
71-
ClearLine();
72-
Console.WriteLine($"Error connecting to {connection.ip}");
73-
return;
7451
}
52+
client = new Client(connection);
53+
7554
String username = string.Empty;
7655
string password = string.Empty;
7756
while (!client.isLoged)
7857
{
79-
try
80-
{
81-
connection.Open();
82-
}
83-
catch (Exception e)
84-
{
85-
Console.CursorTop = cursor;
86-
ClearLine();
87-
Console.WriteLine($"Error connecting to {connection.ip}");
88-
return;
89-
}
90-
91-
92-
Console.CursorTop = cursor;
93-
ClearLine();
58+
connection.Open();
9459
Console.Write("Username: ");
9560
username = Console.ReadLine();
9661
Console.Write("Password: ");
@@ -107,7 +72,7 @@ static void Main(string[] args)
10772
string command;
10873
string cArgs;
10974
string[] commandSplited;
110-
Package.Response response = null;
75+
Client.Package.Response response;
11176
string prefix = "";
11277
while (true)
11378
{
@@ -117,7 +82,7 @@ static void Main(string[] args)
11782
{
11883
prefix = "exec";
11984
}
120-
else if (command == "exit")
85+
else if(command == "exit")
12186
{
12287
if (prefix == "") break;
12388
else prefix = "";
@@ -126,66 +91,25 @@ static void Main(string[] args)
12691
{
12792
if (prefix == "")
12893
{
129-
commandSplited = command.Split();
130-
command = commandSplited[0];
131-
cArgs = string.Join(' ', commandSplited);
132-
cArgs = cArgs.Remove(0, command.Length).Trim();
94+
commandSplited = command.Split();
95+
command = commandSplited[0];
96+
cArgs = string.Join(' ', commandSplited);
97+
cArgs = cArgs.Remove(0, command.Length).Trim();
13398

13499
}
135100
else
136101
{
137102
cArgs = command;
138103
command = prefix;
139104
}
140-
switch (command)
141-
{
142-
case "open":
143-
response = client.OpenDb(cArgs);
144-
break;
145-
case "close":
146-
response = client.CloseDb();
147-
break;
148-
case "list":
149-
150-
if (cArgs == "")
151-
{
152-
header = false;
153-
response = client.GetDBsI();
154-
155-
}
156-
else
157-
{
158-
response = client.sendCommand(command, cArgs);
159-
160-
}
161-
break;
162-
default:
163-
header = true;
164-
response = client.sendCommand(command, cArgs);
165-
break;
166-
167-
}
168-
}
169-
if (response != null)
170-
{
171-
if (response?.Result == "ERROR") Console.WriteLine("ERROR");
105+
response = client.sendCommand(command,cArgs);
106+
if (response?.Result == "ERROR" || response == null) Console.WriteLine("ERROR");
172107
else
173108
{
174-
foreach (string[] data in response.Data)
175-
{
176-
Console.WriteLine(String.Join(" , ", data));
177-
if (header)
178-
{
179-
Console.WriteLine(new string('-',data.Length + 2));
180-
header = false;
181-
}
182-
183-
}
109+
foreach (string data in response.Data) Console.WriteLine(data);
184110
}
185-
response = null;
186-
}
187111

188-
112+
}
189113
}
190114

191115

ServQLTerminal/Properties/PublishProfiles/ARM.pubxml

Lines changed: 0 additions & 18 deletions
This file was deleted.

ServQLTerminal/Properties/PublishProfiles/ARM.pubxml.user

Lines changed: 0 additions & 6 deletions
This file was deleted.

ServQLTerminal/ServQLTerminal.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>netcoreapp3.1</TargetFramework>
66
</PropertyGroup>
77

8-
<ItemGroup>
9-
<PackageReference Include="SmazSharp" Version="0.1.0" />
10-
</ItemGroup>
11-
128
<ItemGroup>
139
<Reference Include="ServQLClient">
1410
<HintPath>..\..\ServQL Client\ServQLClient\bin\Release\netcoreapp3.1\ServQLClient.dll</HintPath>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4-
<_LastSelectedProfileId>C:\Users\alber\Source\Repos\ServQL Terminal\ServQLTerminal\Properties\PublishProfiles\Windows.pubxml</_LastSelectedProfileId>
4+
<_LastSelectedProfileId>C:\Users\alber\source\repos\ServQLTerminal\ServQLTerminal\Properties\PublishProfiles\Windows.pubxml</_LastSelectedProfileId>
55
</PropertyGroup>
66
</Project>

0 commit comments

Comments
 (0)