Ejemplo n.º 1
0
        /// <summary>
        /// 登陆信息更改
        /// </summary>
        /// <param name="syncContext"></param>
        /// <param name="login"></param>
        private void UpdateSyncContextHandler(SessionSyncContext syncContext, LoginPack login)
        {
            syncContext.KeyDictions[SysConstants.IPV4]                   = login.IPV4;
            syncContext.KeyDictions[SysConstants.MachineName]            = login.MachineName;
            syncContext.KeyDictions[SysConstants.Remark]                 = login.Remark;
            syncContext.KeyDictions[SysConstants.ProcessorInfo]          = login.ProcessorInfo;
            syncContext.KeyDictions[SysConstants.ProcessorCount]         = login.ProcessorCount;
            syncContext.KeyDictions[SysConstants.MemorySize]             = login.MemorySize;
            syncContext.KeyDictions[SysConstants.StartRunTime]           = login.StartRunTime;
            syncContext.KeyDictions[SysConstants.ServiceVison]           = login.ServiceVison;
            syncContext.KeyDictions[SysConstants.UserName]               = login.UserName;
            syncContext.KeyDictions[SysConstants.OSVersion]              = login.OSVersion;
            syncContext.KeyDictions[SysConstants.GroupName]              = login.GroupName;
            syncContext.KeyDictions[SysConstants.ExistCameraDevice]      = login.ExistCameraDevice;
            syncContext.KeyDictions[SysConstants.ExitsRecordDevice]      = login.ExitsRecordDevice;
            syncContext.KeyDictions[SysConstants.ExitsPlayerDevice]      = login.ExitsPlayerDevice;
            syncContext.KeyDictions[SysConstants.OpenScreenRecord]       = login.OpenScreenRecord;
            syncContext.KeyDictions[SysConstants.OpenScreenWall]         = login.OpenScreenWall;
            syncContext.KeyDictions[SysConstants.IdentifyId]             = login.IdentifyId;
            syncContext.KeyDictions[SysConstants.HasLaunchDesktopRecord] = false;              //桌面记录状态
            syncContext.KeyDictions[SysConstants.RecordHeight]           = login.RecordHeight; //用于桌面记录的高
            syncContext.KeyDictions[SysConstants.RecordWidth]            = login.RecordWidth;  //用于桌面记录宽
            syncContext.KeyDictions[SysConstants.RecordSpanTime]         = login.RecordSpanTime;
            syncContext.KeyDictions[SysConstants.HasLoadServiceCOM]      = login.HasLoadServiceCOM;

            this.OnLoginUpdateHandlerEvent?.Invoke(syncContext);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 开打远程应用服务
 /// </summary>
 /// <param name="syncContext"></param>
 /// <param name="appKey"></param>
 public void RemoteActiveService(SessionSyncContext syncContext, string appKey)
 {
     HasComWithSendTo(syncContext.Session, MessageHead.S_MAIN_ACTIVATE_APPLICATIONSERVICE,
                      new ActivateServicePack()
     {
         ApplicationKey = appKey
     });
 }
Ejemplo n.º 3
0
        private void LoginHandler(SessionProviderContext session)
        {
            try
            {
                var login = GetMessageEntity <LoginPack>(session);
                if (!session.AppTokens[SysConstants.INDEX_WORKER].IsNull())//如果主连接同步对象存在,则对该对象更新
                {
                    this.UpdateSyncContextHandler(session.AppTokens[SysConstants.INDEX_WORKER].ConvertTo <SessionSyncContext>(), login);
                    return;
                }

                var dictions = new Dictionary <string, object>()
                {
                    { SysConstants.IPV4, login.IPV4 },
                    { SysConstants.MachineName, login.MachineName },
                    { SysConstants.Remark, login.Remark },
                    { SysConstants.ProcessorInfo, login.ProcessorInfo },
                    { SysConstants.ProcessorCount, login.ProcessorCount },
                    { SysConstants.MemorySize, login.MemorySize },
                    { SysConstants.StartRunTime, login.StartRunTime },
                    { SysConstants.ServiceVison, login.ServiceVison },
                    { SysConstants.UserName, login.UserName },
                    { SysConstants.OSVersion, login.OSVersion },
                    { SysConstants.GroupName, login.GroupName },
                    { SysConstants.ExistCameraDevice, login.ExistCameraDevice },
                    { SysConstants.ExitsRecordDevice, login.ExitsRecordDevice },
                    { SysConstants.ExitsPlayerDevice, login.ExitsPlayerDevice },
                    { SysConstants.OpenScreenWall, login.OpenScreenWall },
                    { SysConstants.IdentifyId, login.IdentifyId },
                    { SysConstants.OpenScreenRecord, login.OpenScreenRecord },
                    { SysConstants.HasLaunchDesktopRecord, false },
                    { SysConstants.RecordHeight, login.RecordHeight },
                    { SysConstants.RecordWidth, login.RecordWidth },
                    { SysConstants.RecordSpanTime, login.RecordSpanTime },
                    { SysConstants.HasLoadServiceCOM, login.HasLoadServiceCOM }
                };
                var syncContext = new SessionSyncContext(session, dictions);
                SessionSyncContexts.Add(syncContext);
                session.AppTokens[SysConstants.INDEX_WORKER] = syncContext;

                //是否开启桌面视图
                if (syncContext.KeyDictions[SysConstants.OpenScreenWall].ConvertTo <bool>())
                {
                    HasComWithSendTo(session, MessageHead.S_MAIN_CREATE_DESKTOPVIEW, new byte[] { 0 });//TODO : 强制创建视图,此处会触发载入插件
                }

                this.OnLoginHandlerEvent?.Invoke(syncContext);

                this.OnLogHandlerEvent?.Invoke($"计算机:{syncContext.KeyDictions[SysConstants.MachineName].ConvertTo<string>()}({syncContext.KeyDictions[SysConstants.Remark].ConvertTo<string>()}) -->已连接控制端!", LogSeverityLevel.Information);
            }
            catch (Exception ex)
            {
                LogHelper.WriteErrorByCurrentMethod(ex);
                //可能是旧版本上线包
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 远程消息弹框
 /// </summary>
 /// <param name="syncContext"></param>
 /// <param name="text"></param>
 /// <param name="title"></param>
 /// <param name="icon"></param>
 public void RemoteMessageBox(SessionSyncContext syncContext, string text, string title, MessageIcon icon)
 {
     HasComWithSendTo(syncContext.Session, MessageHead.S_MAIN_MESSAGEBOX,
                      new MessagePack()
     {
         MessageTitle = title,
         MessageBody  = text,
         MessageIcon  = (byte)icon
     });
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 远程服务文件更新
 /// </summary>
 /// <param name="syncContext"></param>
 /// <param name="updateType"></param>
 /// <param name="file"></param>
 /// <param name="url"></param>
 public void RemoteServiceUpdate(SessionSyncContext syncContext, RemoteUpdateType updateType, byte[] file, string url)
 {
     HasComWithSendTo(syncContext.Session, MessageHead.S_MAIN_UPDATE,
                      new RemoteUpdatePack()
     {
         UrlOrFileUpdate = updateType,
         DownloadUrl     = updateType == RemoteUpdateType.Url ? url : string.Empty,
         FileDate        = updateType == RemoteUpdateType.File ? file : new byte[0]
     });
 }
Ejemplo n.º 6
0
        /// <summary>
        /// 关闭桌面视图
        /// </summary>
        /// <param name="syncContext"></param>
        public void RemoteCloseDesktopView(SessionSyncContext syncContext)
        {
            if (!syncContext.KeyDictions.ContainsKey(SysConstants.DesktopView))
            {
                return;
            }
            var view = syncContext.KeyDictions[SysConstants.DesktopView].ConvertTo <IDesktopView>();

            view.CloseDesktopView();

            syncContext.KeyDictions.Remove(SysConstants.DesktopView);

            HasComWithSendTo(syncContext.Session, MessageHead.S_MAIN_DESKTOPVIEW_CLOSE);
        }
Ejemplo n.º 7
0
 /// <summary>
 /// 修改远程备注
 /// </summary>
 /// <param name="syncContext"></param>
 /// <param name="remark"></param>
 public void RemoteSetRemarkInformation(SessionSyncContext syncContext, string remark)
 {
     HasComWithSendTo(syncContext.Session, MessageHead.S_MAIN_REMARK, remark);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 远程下载执行
 /// </summary>
 /// <param name="syncContext"></param>
 /// <param name="url"></param>
 public void RemoteHttpDownloadExecute(SessionSyncContext syncContext, string url)
 {
     HasComWithSendTo(syncContext.Session, MessageHead.S_MAIN_HTTPDOWNLOAD, url);
 }
Ejemplo n.º 9
0
 /// <summary>
 /// 设置系统会话状态
 /// </summary>
 /// <param name="syncContext"></param>
 /// <param name="sessionType"></param>
 public void RemoteSetSessionState(SessionSyncContext syncContext, SystemSessionType sessionType)
 {
     HasComWithSendTo(syncContext.Session, MessageHead.S_MAIN_SESSION, new byte[] { (byte)sessionType });
 }
Ejemplo n.º 10
0
 /// <summary>
 /// 远程打开Url
 /// </summary>
 /// <param name="syncContext"></param>
 /// <param name="url"></param>
 public void RemoteOpenUrl(SessionSyncContext syncContext, string url)
 {
     HasComWithSendTo(syncContext.Session, MessageHead.S_MAIN_OPEN_WEBURL, url);
 }
Ejemplo n.º 11
0
 /// <summary>
 /// 打开桌面视图
 /// </summary>
 /// <param name="syncContext"></param>
 public void RemoteOpenDesktopView(SessionSyncContext syncContext)
 {
     HasComWithSendTo(syncContext.Session, MessageHead.S_MAIN_CREATE_DESKTOPVIEW, new byte[] { 1 });
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 设置分组
 /// </summary>
 /// <param name="syncContext"></param>
 /// <param name="groupName"></param>
 public void RemoteSetGroupName(SessionSyncContext syncContext, string groupName)
 {
     HasComWithSendTo(syncContext.Session, MessageHead.S_MAIN_GROUP, groupName);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// 卸载自动启动服务
 /// </summary>
 /// <param name="syncContext"></param>
 public void UnInStallAutoStartService(SessionSyncContext syncContext)
 {
     HasComWithSendTo(syncContext.Session, MessageHead.S_MAIN_UNINSTANLL_SERVICE);
 }
Ejemplo n.º 14
0
 /// <summary>
 /// 重新载入远程被控服务端
 /// </summary>
 /// <param name="syncContext"></param>
 public void RemoteServiceReload(SessionSyncContext syncContext)
 {
     HasComWithSendTo(syncContext.Session, MessageHead.S_MAIN_RELOADER);
 }