示例#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);
        }
示例#2
0
        public void SendLoginPack(TcpSocketSaeaSession session)
        {
            string RemarkInfomation = AppConfiguartion.RemarkInfomation ?? AppConfiguartion.DefaultRemarkInfo;
            string openScreenWall   = AppConfiguartion.IsOpenScreenView ?? "true"; //默认为打开屏幕墙
            string openScreenRecord = AppConfiguartion.IsScreenRecord ?? "false";  //默认屏幕记录

            var loginPack = new LoginPack();

            loginPack.IPV4              = SystemInfoUtil.GetLocalIPV4();
            loginPack.MachineName       = Environment.MachineName ?? "";
            loginPack.Remark            = RemarkInfomation;
            loginPack.ProcessorCount    = Environment.ProcessorCount;
            loginPack.ProcessorInfo     = SystemInfoUtil.GetMyCpuInfo;
            loginPack.MemorySize        = SystemInfoUtil.GetMyMemorySize;
            loginPack.StartRunTime      = AppConfiguartion.RunTime;
            loginPack.ServiceVison      = AppConfiguartion.Version;
            loginPack.UserName          = Environment.UserName.ToString();
            loginPack.OSVersion         = SystemInfoUtil.GsystemEdition;
            loginPack.OpenScreenWall    = (openScreenWall == "true" ? true : false);
            loginPack.ExistCameraDevice = SystemInfoUtil.ExistCameraDevice();
            loginPack.ExitsRecordDevice = SystemInfoUtil.ExistRecordDevice();
            loginPack.ExitsPlayerDevice = SystemInfoUtil.ExistPlayDevice();
            loginPack.IdentifyId        = AppConfiguartion.IdentifyId;
            loginPack.OpenScreenRecord  = (openScreenRecord == "true" ? true : false);
            loginPack.RecordHeight      = _screen_record_height;
            loginPack.RecordWidth       = _screen_record_width;
            loginPack.RecordSpanTime    = _screen_record_spantime;

            byte[] data = MessageHelper.CopyMessageHeadTo(MessageHead.C_MAIN_LOGIN,
                                                          loginPack);

            SendMessageToServer(data);
        }
        private void SendLoginPack(TcpSocketSaeaSession session)
        {
            string remarkInfomation = AppConfiguartion.RemarkInfomation ?? AppConfiguartion.DefaultRemarkInfo;
            string groupName        = AppConfiguartion.GroupName ?? AppConfiguartion.DefaultGroupName;
            bool   openScreenWall   = AppConfiguartion.IsOpenScreenView; //默认为打开屏幕墙
            bool   openScreenRecord = AppConfiguartion.IsScreenRecord;   //默认屏幕记录

            var loginPack = new LoginPack();

            loginPack.IPV4              = SystemInfoHelper.GetLocalIPV4();
            loginPack.MachineName       = Environment.MachineName ?? "";
            loginPack.Remark            = remarkInfomation;
            loginPack.ProcessorCount    = Environment.ProcessorCount;
            loginPack.ProcessorInfo     = SystemInfoHelper.GetMyCpuInfo;
            loginPack.MemorySize        = SystemInfoHelper.GetMyMemorySize;
            loginPack.StartRunTime      = AppConfiguartion.RunTime;
            loginPack.ServiceVison      = AppConfiguartion.Version;
            loginPack.UserName          = Environment.UserName.ToString();
            loginPack.OSVersion         = SystemInfoHelper.GetOSFullName;
            loginPack.GroupName         = groupName;
            loginPack.OpenScreenWall    = openScreenWall;
            loginPack.ExistCameraDevice = SystemInfoHelper.ExistCameraDevice();
            loginPack.ExitsRecordDevice = SystemInfoHelper.ExistRecordDevice();
            loginPack.ExitsPlayerDevice = SystemInfoHelper.ExistPlayDevice();
            loginPack.IdentifyId        = AppConfiguartion.IdentifyId;
            loginPack.OpenScreenRecord  = openScreenRecord;
            loginPack.RecordHeight      = _screen_record_height;
            loginPack.RecordWidth       = _screen_record_width;
            loginPack.RecordSpanTime    = _screen_record_spantime;
            loginPack.HasLoadServiceCOM = true;//已加载

            SendTo(session, MessageHead.C_MAIN_LOGIN, loginPack);
        }
示例#4
0
        private void ProcessLogin(SessionHandler session)
        {
            LoginPack login = PacketSerializeHelper.DeserializePacket <LoginPack>(session.CompletedBuffer.GetMessageBody());


            session.AppTokens[2] = login.OpenScreenWall;

            if (this._manager_login_c == 0)
            {
                return;
            }

            LoginPackageModel login_model = new LoginPackageModel()
            {
                Msg             = AJaxMsgCommand.S_SESSION_LOGIN,
                Id              = (string)session.AppTokens[1],
                OS              = login.OSVersion,
                MachineName     = login.MachineName,
                Des             = login.Remark,
                DesktopViewOpen = login.OpenScreenWall.ToString().ToLower()
            };


            this.SendMessage(JsonConvert.SerializeObject(login_model));
        }
示例#5
0
        public void SendRequest(string username, string password)
        {
            MainPack pack = new MainPack();

            pack.RequestCode = requestCode;
            pack.ActionCode  = actionCode;
            LoginPack loginPack = new LoginPack();

            loginPack.Username = username;
            loginPack.Password = password;
            pack.LoginPack     = loginPack;
            base.SendRequest(pack);
        }