diff --git a/BinaryDad.Coding/Hubs/CodeHub.cs b/BinaryDad.Coding/Hubs/CodeHub.cs index d3ddf6f..6728ff5 100644 --- a/BinaryDad.Coding/Hubs/CodeHub.cs +++ b/BinaryDad.Coding/Hubs/CodeHub.cs @@ -8,6 +8,8 @@ namespace BinaryDad.Coding.Hubs { public Task UpdateCode(string user, int index, string code, bool isTeacher) { + Console.WriteLine($"Received code from {user} with index {index}"); + if (index == 0) { if (Users.Sessions.TryGetValue(Context.ConnectionId, out User value)) @@ -26,9 +28,13 @@ namespace BinaryDad.Coding.Hubs // only send to all if it's a teacher if (isTeacher) { + Console.WriteLine($"Sending code from {user}"); + return Clients.All.SendAsync("ReceiveCode", user, index, code); } + + return Task.CompletedTask; }