Exemplo n.º 1
0
 private static void TryMakeStop(string clientCode, ClientCommandStutas status)
 {
     if (status.IsStopWait)
     {
         ServerListener.ConnectedClients.FirstOrDefault(c => c.ClientCode == clientCode)?.SendCommand(ControlCommand.Stop);
         status.UpdateLastCommand(ControlCommand.Stop);
     }
 }
Exemplo n.º 2
0
 private static bool IsCommandCanSend(string clientCode, ControlCommand command, out ClientCommandStutas status)
 {
     lock (LastSendCommands)
     {
         if (!LastSendCommands.ContainsKey(clientCode))
         {
             LastSendCommands.Add(clientCode, new ClientCommandStutas(clientCode));
         }
         status = LastSendCommands[clientCode];
         return(status.IsCommandCanSend(command));
     }
 }