Ejemplo n.º 1
0
 public UpdateKeyParser(AsynchLockServerSocketService InputAsynchSocketServiceBaseFrame, SocketServiceReadWriteChannel InputReadWriteChannel, int InRecieveCount)
 {
     this.MyAsynchLockServerSocketService = InputAsynchSocketServiceBaseFrame;
     this.MyReadWriteChannel = InputReadWriteChannel;
     this.MyReadBuffers      = InputReadWriteChannel.MyReadBuffers;
     this.MyRecieveCount     = InRecieveCount;
 }
Ejemplo n.º 2
0
 public LGJMessageEntity(string InTitle, int ResultFlag, SocketServiceReadWriteChannel InReadWriteSocketChannel, string InAttachmentInfor)
 {
     this.title                  = InTitle;
     this.resultFlag             = ResultFlag;
     this.readWriteSocketChannel = InReadWriteSocketChannel;
     this.attachmentInfor        = InAttachmentInfor;
 }
Ejemplo n.º 3
0
        public void ResponseToMobile()
        {
            string CommandMessageID = "mobileoffline";

            //---1.找智能锁本身通道的路由表记录-------------------------------------

            MyLockIDStr   = MyLoginUser.LockID;
            MyMobileIDStr = MyLoginUser.MobileID;

            Byte RecieveMessageResult = MyReadBuffers[22];    //结果标志[总共24个字节]

            string ResultStr;

            if (RecieveMessageResult == 0)
            {
                ResultStr = "true";
            }
            else
            {
                ResultStr = "false[10]";
            }

            string CommandMessageStr;

            CommandMessageStr = CommandMessageID + "#" + MyMobileIDStr + "-" + MyLockIDStr + "#" + ResultStr + "!";
            byte[] MySendBaseMessageBytes = Encoding.ASCII.GetBytes(CommandMessageStr);

            int nBuffersLenght = CommandMessageStr.Length;

            byte[] MySendMessageBytes = new byte[nBuffersLenght + 3];


            MySendMessageBytes[2] = 255;

            //填充
            for (int i = 0; i < nBuffersLenght; i++)
            {
                MySendMessageBytes[3 + i] = MySendBaseMessageBytes[i];
            }

            //----1.智能锁响应消息保存数据库备查-------------------------------------------------------------------------------------------------------------
            //MyAsynchLockServerSocketService.SamrtLockResponseToSave(MyLockIDStr, CommandMessageID, CommandMessageStr);

            //--2.找移动端通道,如果是原型-2和正式版本需固定两个移动端请求消息通道和响应通道[0通道和1号通道]-----------------------------------
            // FindMobileChannel MyBindedMobileChannel = new FindMobileChannel(MessageMobileStr);
            //this.NewReadWriteChannel = MyAsynchSocketServiceBaseFrame.MyManagerSocketLoginUser.MyLoginUserList.Find(new Predicate<LoginUser>(MyBindedMobileChannel.BindedMobileChannel)).MyReadWriteSocketChannel;

            int ReplyChannelIndex = MyLoginUser.ReplyChannelLoginID - 1;

            if (ReplyChannelIndex < 2 && ReplyChannelIndex > -1)
            {
                this.NewReadWriteChannel = MyAsynchLockServerSocketService.MyManagerSocketLoginUser.MyLoginUserList[ReplyChannelIndex].MyReadWriteSocketChannel;
                MyAsynchLockServerSocketService.StartAsynchSendMessage(NewReadWriteChannel, MySendMessageBytes);
            }
            else
            {
                //通道错误;
                MyAsynchLockServerSocketService.DisplayResultInfor(1, "从智能端响应再转发移动端寻找通道错误:" + ReplyChannelIndex.ToString());
            }
        }
Ejemplo n.º 4
0
 public QueryTimeParser(AsynchLockServerSocketService InputAsynchSocketServiceBaseFrame, SocketServiceReadWriteChannel InputReadWriteObject, int InputRecieveCount)
 {
     this.MyAsynchLockServerSocketService = InputAsynchSocketServiceBaseFrame;
     this.MyReadWriteChannel = InputReadWriteObject;
     this.MyReadBuffers      = InputReadWriteObject.MyReadBuffers;
     this.MyRecieveCount     = InputRecieveCount;
 }
Ejemplo n.º 5
0
        private void CreateForwardMessageToMobile()
        {
            string CommandMessageStr = "lowpower";

            CommandMessageStr = CommandMessageStr + "#" + MyMobileIDStr + "-" + MyLockIDStr + "#[" + GetDateTimeWeekIndex() + "]!";
            byte[] MySendBaseMessageBytes = Encoding.UTF8.GetBytes(CommandMessageStr);

            int nBuffersLenght = CommandMessageStr.Length;

            byte[] MySendMessageBytes = new byte[nBuffersLenght + 3];


            MySendMessageBytes[2] = 250;

            //填充
            for (int i = 0; i < nBuffersLenght; i++)
            {
                MySendMessageBytes[3 + i] = MySendBaseMessageBytes[i];
            }



            //--找移动端通道,如果是原型-2和正式版本需固定两个移动端请求消息通道和响应通道[作为客户端]--------------------------------------------------------------------------------
            try
            {
                this.NewReadWriteChannel = this.MyAsynchLockServerSocketService.MyManagerLoginLockUser.MyLoginUserList[0].MyReadWriteSocketChannel;
                this.MyAsynchLockServerSocketService.StartAsynchSendMessage(NewReadWriteChannel, MySendMessageBytes);
            }
            catch
            {
                this.MyAsynchLockServerSocketService.DisplayResultInfor(1, "转发移动端通道错误");
            }
        }
Ejemplo n.º 6
0
 public LoginCommandParser(AsynchLockServerSocketService InputAsynchSocketService, LoginUser MeLoginUser, int InputRecieveCount)
 {
     this.MyAsynchLockServerSocketService = InputAsynchSocketService;
     this.MyLoginUser        = MeLoginUser;
     this.MyReadWriteChannel = MeLoginUser.MyReadWriteSocketChannel;
     this.MyRecieveCount     = InputRecieveCount;
 }
Ejemplo n.º 7
0
        public void RequestToLock()
        {
            //1.解析来自移动端的消息-----------------------------------------------------------------------------------------------------------------------
            string BaseMessageString = Encoding.UTF8.GetString(this.MyReadWriteChannel.MyReadBuffers, 3, MyRecieveCount - 3);

            MyLockIDStr   = BaseMessageString.Substring(BaseMessageString.IndexOf("#") + 1, 15);
            MyMobileIDStr = BaseMessageString.Substring(BaseMessageString.IndexOf("-") + 1, 15);
            string ParaSnapStr = BaseMessageString.Substring(BaseMessageString.LastIndexOf("#") + 1, 1);

            ;

            //----2.驱动智能锁----------------------------
            //--找智能锁通道--------------------------------------------------------------------------------
            FindLockChannel MyBindedLockChannel = new FindLockChannel(MyLockIDStr);  //测试正确

            MyLoginUser = MyAsynchLockServerSocketService.MyManagerLoginLockUser.MyLoginUserList.Find(new Predicate <LoginUser>(MyBindedLockChannel.BindedLockChannelForLockID));

            //this.NewReadWriteChannel = MyAsynchLockServerSocketService.MyManagerLoginLockUser.CRUDLoginUserListForMobileFindEx(MyLockIDStr, MyMobileIDStr);


            //--再转发出去-------------
            if (MyLoginUser != null)
            {
                this.NewReadWriteChannel = MyLoginUser.MyReadWriteSocketChannel;
                DriveToSmartLock(ParaSnapStr);
            }
            else
            {
                //--否则原路或者走响应通道快速返回[0、1]-----------
                NotFindLockResponseToMobile();
            }
        }
Ejemplo n.º 8
0
 public LoginCommandParser(AsynchLockServerSocketService InputAsynchSocketService, SocketServiceReadWriteChannel InputReadWriteChannel, int InputRecieveCount)
 {
     //this.MyAsynchSocketServiceBaseFrame = InputAsynchSocketServiceBaseFrame;
     this.MyAsynchLockServerSocketService = InputAsynchSocketService;
     this.MyReadWriteChannel = InputReadWriteChannel;
     this.MyRecieveCount     = InputRecieveCount;
 }
Ejemplo n.º 9
0
 public OPenDoorMessageProcess(AsynchLockServerSocketService InputAsynchSocketServiceBaseFrame, SocketServiceReadWriteChannel InputReadWriteObject, int InputRecieveCount)
 {
     this.MyAsynchLockServerSocketService = InputAsynchSocketServiceBaseFrame;
     this.MyReadWriteChannel = InputReadWriteObject;
     this.MyReadBuffers      = InputReadWriteObject.MyReadBuffers;
     this.MyRecieveCount     = InputRecieveCount;
 }
Ejemplo n.º 10
0
 public GetOpenDoor(AsynchLockServerSocketService InAsynchLockServerSocketService, SocketServiceReadWriteChannel InputReadWriteChannel, int InRecieveCount)
 {
     this.MyAsynchLockServerSocketService = InAsynchLockServerSocketService;
     this.MyReadWriteChannel = InputReadWriteChannel;
     this.MyReadBuffers      = InputReadWriteChannel.MyReadBuffers;
     this.MyRecieveCount     = InRecieveCount;
 }
Ejemplo n.º 11
0
        public void RequestToLock()
        {
            //----1.解析来自移动端的消息-----------------------------------------------------------------------------------
            string BaseMessageString = Encoding.ASCII.GetString(this.MyReadWriteChannel.MyReadBuffers, 3, MyRecieveCount - 3);

            MyLockIDStr   = BaseMessageString.Substring(BaseMessageString.IndexOf("#") + 1, 15);
            MyMobileIDStr = BaseMessageString.Substring(BaseMessageString.IndexOf("-") + 1, 15);


            //----2.驱动智能锁----找智能锁通道-------------------------------------------------------------------------------------------------------

            FindLockChannel MyBindedLockChannel = new FindLockChannel(MyLockIDStr);

            MyLoginUser = MyAsynchLockServerSocketService.MyManagerLoginLockUser.MyLoginUserList.Find(new Predicate <LoginUser>(MyBindedLockChannel.BindedLockChannelForLockID));


            //--再转发出去----------------------------------------------------------------------------------------------------------
            if (MyLoginUser != null)
            {
                this.NewReadWriteChannel = MyLoginUser.MyReadWriteSocketChannel;
                //MyLoginUser.ReplyChannelLoginID = this.ReplyChannelLoginID;//记住返回通道
                DriveToSmartLock();
            }
            else
            {
                //--否则原路或者走响应通道快速返回[0、1]
                MyAsynchLockServerSocketService.DisplayResultInfor(1, "没有找到绑定的锁通道错误!");
                NotFindLockResponseToMobile();
            }
            ;;
            ;;
        }
Ejemplo n.º 12
0
 public PingCommandParser(AsynchLockServerSocketService InAsynchLockServerSocketService, SocketServiceReadWriteChannel InputReadWriteObject, int InputRecieveCount)
 {
     this.MyAsynchLockServerSocketService = InAsynchLockServerSocketService;
     this.MyReadWriteChannel = InputReadWriteObject;
     this.MyReadBuffers      = InputReadWriteObject.MyReadBuffers;
     this.MyRecieveCount     = InputRecieveCount;
 }
Ejemplo n.º 13
0
        public void ResponseToMobile()
        {
            string CommandMessageID = "clearlockkey";

            //---1.找智能锁本身通道的路由表记录-------------------------------------
            //LoginUser MyLoginUser = MyAsynchSocketServiceBaseFrame.MyManagerSocketLoginUser.FindLoginUserList(ref  this.MyReadWriteChannel.MyTCPClient);
            //FindLockChannel MyBindedLockChannel = new FindLockChannel(this.MyReadWriteChannel);
            // LoginUser MyLoginUser = MyAsynchLockServerSocketService.MyManagerLoginLockUser.MyLoginUserList.Find(new Predicate<LoginUser>(MyBindedLockChannel.BindedLockChannelForSocket));


            MyLockIDStr   = MyLoginUser.LockID;
            MyMobileIDStr = MyLoginUser.MobileID;

            Byte RecieveMessageResult = MyReadBuffers[22]; //结果标志

            string ResultStr;

            if (RecieveMessageResult == 0)
            {
                SynchDBaseLockKey();
                ResultStr = "true";
            }
            else
            {
                ResultStr = "false[10]";
            }

            string CommandMessageStr;

            CommandMessageStr = CommandMessageID + "#" + MyMobileIDStr + "-" + MyLockIDStr + "#" + ResultStr + "!";
            byte[] MySendBaseMessageBytes = Encoding.UTF8.GetBytes(CommandMessageStr);

            int nBuffersLenght = CommandMessageStr.Length;

            byte[] MySendMessageBytes = new byte[nBuffersLenght + 3];


            MySendMessageBytes[2] = 255;

            //填充
            for (int i = 0; i < nBuffersLenght; i++)
            {
                MySendMessageBytes[3 + i] = MySendBaseMessageBytes[i];
            }

            //----1.保存数据库备查----------//---------------------------------------------------------------------------------------------------
            //MyAsynchLockServerSocketService.SamrtLockResponseToSave(MyLockIDStr, CommandMessageID, CommandMessageStr);
            try
            {
                this.NewReadWriteChannel = MyAsynchLockServerSocketService.MyManagerSocketLoginUser.MyLoginUserList[0].MyReadWriteSocketChannel;

                MyAsynchLockServerSocketService.StartAsynchSendMessage(NewReadWriteChannel, MySendMessageBytes);
            }
            catch
            {
                //通道错误;
                MyAsynchLockServerSocketService.DisplayResultInfor(1, "转发移动端通道错误!");
            }
        }
Ejemplo n.º 14
0
 public SynchTcpClientChannel(AsynchSocketServiceBaseFrame InAsynchSocketServiceBaseFrame, SocketServiceReadWriteChannel InputReadWriteObject, int InputRecieveCount)
 {
     //this.MyAsynchSocketServiceBaseFrame = InputAsynchSocketServiceBaseFrame;
     this.MyAsynchSocketServiceBaseFrame = InAsynchSocketServiceBaseFrame;
     this.MyReadWriteChannel             = InputReadWriteObject;
     this.MyReadBuffers  = InputReadWriteObject.MyReadBuffers;
     this.MyRecieveCount = InputRecieveCount;
 }
Ejemplo n.º 15
0
 public ElectKeyManager(AsynchLockServerSocketService InputAsynchSocketServiceBaseFrame, SocketServiceReadWriteChannel InputReadWriteChannel, int InRecieveCount, int CRUDflag)
 {
     this.MyAsynchLockServerSocketService = InputAsynchSocketServiceBaseFrame;
     this.MyReadWriteChannel = InputReadWriteChannel;
     this.MyReadBuffers      = InputReadWriteChannel.MyReadBuffers;
     this.MyRecieveCount     = InRecieveCount;
     this.nCRUDflag          = CRUDflag;//0:ADDKEY,1:DELETEKEY 3:TEMPKEY
 }
Ejemplo n.º 16
0
 public OPenDoorMessageProcess(AsynchLockServerSocketService InAsynchLockServerSocketService, LoginUser MeLoginUser, int MeRecieveCount)
 {
     this.MyAsynchLockServerSocketService = InAsynchLockServerSocketService;
     this.MyLoginUser        = MeLoginUser;
     this.MyReadWriteChannel = MeLoginUser.MyReadWriteSocketChannel;
     this.MyReadBuffers      = this.MyReadWriteChannel.MyReadBuffers;
     this.MyRecieveCount     = MeRecieveCount;
 }
Ejemplo n.º 17
0
 public SynchTcpClientChannel(AsynchSocketServiceBaseFrame InAsynchSocketServiceBaseFrame, LoginUser MeLoginUser, int MeRecieveCount)
 {
     this.MyAsynchSocketServiceBaseFrame = InAsynchSocketServiceBaseFrame;
     this.MyLoginUser        = MeLoginUser;
     this.MyReadWriteChannel = MeLoginUser.MyReadWriteSocketChannel;
     this.MyReadBuffers      = this.MyReadWriteChannel.MyReadBuffers;
     this.MyRecieveCount     = MeRecieveCount;
 }
Ejemplo n.º 18
0
 public LGJMessageEntity(string InTitle, int MeRecieveAvailable, SocketServiceReadWriteChannel InReadWriteSocketChannel, int MeRecieveCount, byte[] MeByteBuffer)
 {
     this.title = InTitle;
     this.myRecieveAvailable     = MeRecieveAvailable;
     this.readWriteSocketChannel = InReadWriteSocketChannel;
     this.myByteBuffer           = MeByteBuffer;
     this.myRecieveCount         = MeRecieveCount;
 }
Ejemplo n.º 19
0
 public MobileBindLockParser(AsynchLockServerSocketService InputAsynchSocketServiceBaseFrame, SocketServiceReadWriteChannel InputReadWriteObject, int InRecieveCount)
 {
     //老版本
     this.MyAsynchLockServerSocketService = InputAsynchSocketServiceBaseFrame;
     this.MyReadWriteChannel = InputReadWriteObject;
     this.MyReadBuffers      = InputReadWriteObject.MyReadBuffers;
     this.MyRecieveCount     = InRecieveCount;
 }
Ejemplo n.º 20
0
 public QueryTimeParser(AsynchLockServerSocketService InAsynchLockServerSocketService, LoginUser MeLoginUser, int MeRecieveCount)
 {
     this.MyAsynchLockServerSocketService = InAsynchLockServerSocketService;
     this.MyLoginUser        = MeLoginUser;
     this.MyReadWriteChannel = MeLoginUser.MyReadWriteSocketChannel;
     this.MyReadBuffers      = this.MyReadWriteChannel.MyReadBuffers;
     this.MyRecieveCount     = MeRecieveCount;
 }
Ejemplo n.º 21
0
 public RemoteOpen(AsynchLockServerSocketService InputAsynchSocketServiceBaseFrame, SocketServiceReadWriteChannel InputReadWriteChannel, int InRecieveCount)
 {
     //老版本
     this.MyAsynchLockServerSocketService = InputAsynchSocketServiceBaseFrame;
     this.MyReadWriteChannel = InputReadWriteChannel;
     this.MyReadBuffers      = InputReadWriteChannel.MyReadBuffers;
     this.MyRecieveCount     = InRecieveCount;
 }
Ejemplo n.º 22
0
 public ImageFileReceiveProcess(AsynchLockServerSocketService InAsynchLockServerSocketService, SocketServiceReadWriteChannel InputReadWriteObject, int InputRecieveCount)
 {
     //旧版
     this.MyAsynchLockServerSocketService = InAsynchLockServerSocketService;
     this.MyReadWriteChannel = InputReadWriteObject;
     this.MyReadBuffers      = InputReadWriteObject.MyReadBuffers;
     this.MyRecieveCount     = InputRecieveCount;
 }
Ejemplo n.º 23
0
  public MobileLoginManager(AsynchMobileAppSocketService InAsynchMobileAppSocketService, LoginUser MeLoginUser, int MeRecieveCount)
 {
     //新版本
     this.MyAsynchMobileAppSocketService = InAsynchMobileAppSocketService;
     this.MyLoginUser = MeLoginUser;
     this.MyReadWriteChannel = MeLoginUser.MyReadWriteSocketChannel;
     this.MyReadBuffers = this.MyReadWriteChannel.MyReadBuffers;
     this.MyRecieveCount = MeRecieveCount;
 }
Ejemplo n.º 24
0
 public ElectKeyManager(AsynchLockServerSocketService InAsynchLockServerSocketService, LoginUser MeLoginUser, int MeRecieveCount, int CRUDflag)
 {
     this.MyAsynchLockServerSocketService = InAsynchLockServerSocketService;
     this.MyLoginUser        = MeLoginUser;
     this.MyReadWriteChannel = MeLoginUser.MyReadWriteSocketChannel;
     this.MyReadBuffers      = this.MyReadWriteChannel.MyReadBuffers;
     this.MyRecieveCount     = MeRecieveCount;
     this.nCRUDflag          = CRUDflag;//0:ADDKEY,1:DELETEKEY 3:TEMPKEY
 }
Ejemplo n.º 25
0
 public ImageFileReceiveProcess(AsynchLockServerSocketService InAsynchLockServerSocketService, LoginUser MeLoginUser, int MeRecieveCount)
 {
     //新版
     this.MyAsynchLockServerSocketService = InAsynchLockServerSocketService;
     this.MyLoginUser        = MeLoginUser;
     this.MyReadWriteChannel = MeLoginUser.MyReadWriteSocketChannel;
     this.MyReadBuffers      = MeLoginUser.MyReadWriteSocketChannel.MyReadBuffers;
     this.MyRecieveCount     = MeRecieveCount;
 }
Ejemplo n.º 26
0
 public MobileBindLockParser(AsynchLockServerSocketService InAsynchLockServerSocketService, LoginUser MeLoginUser, int MeRecieveCount)
 {
     //最新版本
     this.MyAsynchLockServerSocketService = InAsynchLockServerSocketService;
     this.MyLoginUser        = MeLoginUser;
     this.MyReadWriteChannel = MeLoginUser.MyReadWriteSocketChannel;
     this.MyReadBuffers      = this.MyReadWriteChannel.MyReadBuffers;
     this.MyRecieveCount     = MeRecieveCount;
     //this.ReplyChannelLoginID = MeLoginUser.LoginID;
 }
Ejemplo n.º 27
0
        public RequestAttachment(LoginUser MeLoginUser, AsynchLockServerSocketService MeAsynchLockServerSocketService, string StoredProceName)
        {
            this.MyLoginUser        = MeLoginUser;
            this.MyReadWriteChannel = MeLoginUser.MyReadWriteSocketChannel;
            this.MyReadBuffer       = MeLoginUser.MyByteBuffer;
            this.MyAsynchLockServerSocketService = MeAsynchLockServerSocketService;
            ConnectionStringSettings CloudLockConnectString = ConfigurationManager.ConnectionStrings["CloudLockConnectString"];

            MySqlConnection = new SqlConnection(CloudLockConnectString.ConnectionString);
            MySqlConnection.Open();
            //MySqlCommand = MySqlConnection.CreateCommand();
            MySqlCommand             = new SqlCommand(StoredProceName, MySqlConnection);
            MySqlCommand.CommandType = CommandType.StoredProcedure;
        }
Ejemplo n.º 28
0
        //public string MyRequestKey;
        //public string LockID;


        public RequestAttachment(string InLockID, SocketServiceReadWriteChannel MeReadWriteChannel, AsynchLockServerSocketService MeAsynchLockServerSocketService)
        {
            this.MyReadWriteChannel = MeReadWriteChannel;
            this.MyAsynchLockServerSocketService = MeAsynchLockServerSocketService;
            //this.LockID=InLockID;
            //this.MyRequestKey=InRequestKey;
            ConnectionStringSettings CloudLockConnectString = ConfigurationManager.ConnectionStrings["CloudLockConnectString"];

            MySqlConnection = new SqlConnection(CloudLockConnectString.ConnectionString);
            MySqlConnection.Open();
            //MySqlCommand = MySqlConnection.CreateCommand();
            MySqlCommand             = new SqlCommand("AuthLockID", MySqlConnection);
            MySqlCommand.CommandType = CommandType.StoredProcedure;
            //MySqlCommand.Parameters.Add(new SqlParameter("@LockID", MyChannel.LockID));
        }
Ejemplo n.º 29
0
        public void RequestToLock()
        {
            //1.解析来自移动端的消息-----------------------------------------------------------------------------------------------------------------------
            string BaseMessageString = Encoding.UTF8.GetString(this.MyReadWriteChannel.MyReadBuffers, 3, MyRecieveCount - 3);


            MyLockIDStr   = BaseMessageString.Substring(BaseMessageString.IndexOf("#") + 1, 15);
            MyMobileIDStr = BaseMessageString.Substring(BaseMessageString.IndexOf("-") + 1, 15);


            MasterKeyStr = BaseMessageString.Substring(BaseMessageString.LastIndexOf("#") + 1, 6);

            //----2.驱动智能锁----------------------------
            //--找智能锁通道--------------------------------------------------------------------------------

            ///this.NewReadWriteChannel = MyAsynchLockServerSocketService.MyManagerLoginLockUser.CRUDLoginUserListForMobileFindEx(MyLockIDStr, MyMobileIDStr);


            FindLockChannel MyBindedLockChannel = new FindLockChannel(MyLockIDStr);   //测试正确

            MyLoginUser = MyAsynchLockServerSocketService.MyManagerLoginLockUser.MyLoginUserList.Find(new Predicate <LoginUser>(MyBindedLockChannel.BindedLockChannelForLockID));



            //--再转发出去-------------
            if (MyLoginUser != null)
            {
                this.NewReadWriteChannel            = MyLoginUser.MyReadWriteSocketChannel;
                this.NewReadWriteChannel.TempString = MasterKeyStr; //临时存储母码字符。
                DriveToSmartLock(MasterKeyStr);
            }
            else
            {
                //--否则原路或者走响应通道快速返回[0、1]
                MyAsynchLockServerSocketService.DisplayResultInfor(1, "没有找到锁错误!");
                NotFindLockResponseToMobile();
            }

            ;;

            ///int ReturnCodeID = MyAsynchSocketServiceBaseFrame.MyManagerSocketLoginUser.CRUDLoginUserList(ref MyReadWriteChannel.MyTCPClient, CommandMessageLockStr, CommandMessageMobileStr); //更新路由注册表通道
            //string ResultID;
            //if (ReturnCodeID==0) {ResultID="true";}else {ResultID="false";}
            //ReplyMobileBindLockParserMessage(ResultID);//发送响应消息

            return;
        }
Ejemplo n.º 30
0
        private void OnLineResponseToMobile(AsynchLockServerSocketService MyAsynchLockServerSocketService, string LockID, string MobileID)
        {
            string CommandMessageStr = "locklogin";


            CommandMessageStr = CommandMessageStr + "#" + MobileID + "-" + LockID + "#[" + "openlock" + "," + GetDateTimeWeekIndex() + "]!";
            byte[] MySendBaseMessageBytes = Encoding.UTF8.GetBytes(CommandMessageStr);

            int nBuffersLenght = CommandMessageStr.Length;

            byte[] MySendMessageBytes = new byte[nBuffersLenght + 3];


            MySendMessageBytes[2] = 250;

            //填充
            for (int i = 0; i < nBuffersLenght; i++)
            {
                MySendMessageBytes[3 + i] = MySendBaseMessageBytes[i];
            }



            //--找移动端通道,如果是原型-2和正式版本需固定两个移动端请求消息通道和响应通道[0通道和1号通道]--------------------------------------------------------------------------------
            try
            {
                //LockServerLib.FindMobileChannel MyBindedMobileChannel = new LockServerLib.FindMobileChannel(MyFindMobileIDStr);
                //this.NewReadWriteChannel = MyAsynchSocketServiceBaseFrame.MyManagerSocketLoginUser.MyLoginUserList.Find(new Predicate<LoginUser>(MyBindedMobileChannel.BindedMobileChannel)).MyReadWriteSocketChannel;


                //this.NewReadWriteChannel = MyAsynchSocketServiceBaseFrame.MyManagerSocketLoginUser.MyLoginUserList[0].MyReadWriteSocketChannel;
                if (MyAsynchLockServerSocketService.MyManagerLoginLockUser.MyLoginUserList[0].LockID == "***************")
                {
                    SocketServiceReadWriteChannel NewReadWriteChannel = MyAsynchLockServerSocketService.MyManagerLoginLockUser.MyLoginUserList[0].MyReadWriteSocketChannel;
                    MyAsynchLockServerSocketService.StartAsynchSendMessage(NewReadWriteChannel, MySendMessageBytes);
                }
                else
                {
                    MyAsynchLockServerSocketService.DisplayResultInfor(1, "移动服务器端响应通道标志错误[1]");
                }
            }
            catch
            {
                //无通道记录;;
                MyAsynchLockServerSocketService.DisplayResultInfor(1, "转发移动服务器端响应通道错误[2]");
            }
        }