コード例 #1
0
 public async void SendCommand(SyncCommand command)
 {
     if (this.Status == ConnectionStatus.Connected && this.User != null)
     {
         try
         {
             await Task.Run(() => _client.Send(command.ToString()));
         }
         catch (Exception) { }
     }
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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());
        }
コード例 #4
0
        public static SyncCommand Pong()
        {
            var command = new SyncCommand(SyncCommand.CommandTypes.Pong);

            return(command);
        }