This commit is contained in:
fabjuuuh
2020-09-25 13:43:00 +02:00
parent d0071bd13c
commit cf9341a93e
2 changed files with 26 additions and 1 deletions

View File

@@ -14,12 +14,14 @@ namespace Server
private byte[] buffer = new byte[1024];
private byte[] totalBuffer = new byte[1024];
private int totalBufferReceived = 0;
private SaveData saveData;
public string Username { get; set; }
public Client(Communication communication, TcpClient tcpClient)
{
this.saveData = new SaveData();
this.communication = communication;
this.tcpClient = tcpClient;
this.stream = this.tcpClient.GetStream();
@@ -75,11 +77,12 @@ namespace Server
Array.Copy(message, 5, jsonArray, 0, message.Length - 5);
dynamic json = JsonConvert.DeserializeObject(Encoding.ASCII.GetString(jsonArray));
Console.WriteLine(json);
saveData.WriteData(Encoding.ASCII.GetString(jsonArray));
}
else if (message[4] == 0x02)
{
Console.WriteLine(message);
}