remove: Console.WriteLine calls

This commit is contained in:
Timothy Schenk 2023-08-11 11:53:14 +02:00
parent 1de07e546a
commit fc6e21e2d8

View file

@ -64,24 +64,24 @@ public class AuthSession : TcpSession
protected override void OnReceived(byte[] buffer, long offset, long size)
{
Console.WriteLine($"Length: {size} & offset: {offset}");
this._logger.LogDebug("Length: {Size} & offset: {Offset}", size, offset);
Span<byte> decryptedBuffer = new byte[size];
// xor every value after the first 8 bytes
var dataBuffer = this.Decrypt(new ArraySegment<byte>(buffer, 8, (int)size - 8).ToArray());
Console.WriteLine("Length " + BitConverter.ToUInt16(buffer, 0));
this._logger.LogDebug("Length {length}", BitConverter.ToUInt16(buffer, 0));
var opCode = BitConverter.ToUInt16(buffer.ToArray(), 2);
Console.WriteLine("Packet Op Code: " + opCode);
Console.WriteLine("Some Value: " + buffer[4]);
this._logger.LogDebug("Packet Op Code: {OpCode}", opCode);
this._logger.LogDebug("Some Value: {RandomValue}" + buffer[4]);
var clientAliveTime = BitConverter.ToUInt16(buffer.ToArray(), 5);
Console.WriteLine("Client Alive time: " + clientAliveTime);
Console.WriteLine("Might be a flag:" + buffer[7]);
this._logger.LogDebug("Client Alive time: {ClientAliveTime}", clientAliveTime);
this._logger.LogDebug("Might be a flag: {Flag}", buffer[7]);
Console.WriteLine("Full buffer: " + Encoding.ASCII.GetString(dataBuffer.ToArray()));
this._logger.LogDebug("Full buffer: {Buffer}", Encoding.ASCII.GetString(dataBuffer.ToArray()));
var rawPacket = new RawPacket((OperationCode)opCode, dataBuffer, clientAliveTime, buffer[0],
buffer[3], this.Id, this);
var rawPacket = new RawPacket((OperationCode)opCode, dataBuffer, clientAliveTime, buffer[7],
buffer[4], this.Id, this);
Task.Run(() => this._mediator.Send(rawPacket));
this._logger.LogInformation("Connection from: {@RemoteEndpoint}", this.Socket.RemoteEndPoint?.ToString());
base.OnReceived(decryptedBuffer.ToArray(), offset, decryptedBuffer.Length);