This commit is contained in:
fabjuuuh
2020-09-23 15:37:23 +02:00
parent 5db3f28deb
commit 8c45d5eccd
2 changed files with 20 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using Client;
using Newtonsoft;
using Newtonsoft.Json;
@@ -124,12 +125,25 @@ namespace Server
{
Console.WriteLine("Data " + packet);
dynamic json = JsonConvert.DeserializeObject(packet);
//json.
if (json.data.name == json.data.password)
{
dynamic payload = new
{
data = new
{
status = "ok"
}
};
Message.Message message = new Message.Message(Message.Identifier.LOGIN, JsonConvert.SerializeObject(payload));
Write(message.Serialize());
}
}
private void Write(string data)
{
byte[] bytes = DataParser.getMessage(Encoding.ASCII.GetBytes(data), 0x01);
stream.Write(bytes, 0, bytes.Length);
stream.Flush();
}
}
}