Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
Commands.Core: Compliance with Impostor 1.3.0 (Announcement Server is…
Browse files Browse the repository at this point in the history
… now disabled by default)

BlackTea:Naming scheme fixes
Plugin.Test: Compliance with Impostor 1.3.0
  • Loading branch information
dimaguy committed Mar 4, 2021
1 parent 1c5111f commit d2db4fb
Show file tree
Hide file tree
Showing 5 changed files with 385 additions and 355 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Impostor.Commands.Core.Client
public class BlackTeaTransport
{
public ClientWebSocket Socket { get; private set; }
private BlackTeaSharp cryptographicFunction { get; set; }
private BlackTeaSharp CryptographicFunction { get; set; }
public string Key { get; private set; }
public Action<BaseMessage> OnReceived { get; set; }
private ArraySegment<byte> ReceiveBuffer { get; set; }
Expand All @@ -20,7 +20,7 @@ public class BlackTeaTransport
public BlackTeaTransport(ClientWebSocket socket, string key, Action<BaseMessage> received)
{
this.Socket = socket;
this.cryptographicFunction = new BlackTeaSharp();
this.CryptographicFunction = new BlackTeaSharp();
this.Key = key;
this.OnReceived = received;
this.ReceiveBuffer = new ArraySegment<byte>(new byte[1024]);
Expand Down Expand Up @@ -50,7 +50,7 @@ private async Task ReadCallback()
{
while (ContinueReading)
{
var received = cryptographicFunction.Decrypt(await Read().ConfigureAwait(false),Key);
var received = CryptographicFunction.Decrypt(await Read().ConfigureAwait(false),Key);
OnReceived?.Invoke(JsonSerializer.Deserialize<BaseMessage>(received));
}
}
Expand All @@ -70,7 +70,7 @@ private async Task<string> Read()
}
public void SendAsync(string message)
{
Socket.SendAsync(Encoding.UTF8.GetBytes(cryptographicFunction.Encrypt(message,Key)),WebSocketMessageType.Text,true,CancellationToken.None).ConfigureAwait(false);
Socket.SendAsync(Encoding.UTF8.GetBytes(CryptographicFunction.Encrypt(message,Key)),WebSocketMessageType.Text,true,CancellationToken.None).ConfigureAwait(false);
}

public static ulong GetTime()
Expand Down
Loading

0 comments on commit d2db4fb

Please sign in to comment.