Fixed GetServerState method - removed old debug code.

This commit is contained in:
Chris Davoren 2024-01-10 18:41:58 +10:00
parent 9c7f5cb21a
commit 96f10416ff
1 changed files with 1 additions and 5 deletions

View File

@ -10,11 +10,7 @@ namespace TrafficLightsSignalR.Hubs
public async Task GetServerState(string connectionId) public async Task GetServerState(string connectionId)
{ {
Debug.WriteLine("ServerBroadcast called..."); await Clients.Client(connectionId).SendAsync("ReceiveServerState", _stateService.GetCurrentTrafficLightState());
string currentState = _stateService.GetCurrentTrafficLightState().CurrentSimulationTime;
State stateTemplate = new();
Debug.WriteLine($"Retrieved state: {currentState}");
await Clients.Client(connectionId).SendAsync("ReceiveStructuredMessage", stateTemplate);
} }
} }
} }