public async void SendCommand(SyncCommand command) { if (this.Status == ConnectionStatus.Connected && this.User != null) { try { await Task.Run(() => _client.Send(command.ToString())); } catch (Exception) { } } }
public static SyncCommand ProposeSyncCameras(List <User> admins, CameraDetails camera) { var command = new SyncCommand(SyncCommand.CommandTypes.ProposeSyncCameras); command.Data = new { Users = admins, CameraDetails = camera, Force = false, ProposingAdmin = SyncManager.Instance.User.CustId }; return(command); }
private void OnConnected(UserContext context) { // Connected - send registration command var command = new SyncCommand(SyncCommand.CommandTypes.Register); command.Data = new { Id = _custid, Name = _name, ShortName = _shortname, Password = _password, Ssid = _subSessionId }; _client.Send(command.ToString()); }
public static SyncCommand Pong() { var command = new SyncCommand(SyncCommand.CommandTypes.Pong); return(command); }