Ejemplo n.º 1
0
        private void OnUpdatePWFinishReq(Datagram datagram)
        {
            UpdatePWFinishReq req = datagram.UnSerialData <UpdatePWFinishReq>();

            UpdatePWResponse response = new UpdatePWResponse();

            if (OperationFinishCache.TryGetValue
                (
                    req.NextLabel,
                    out KeyValuePair <string, DateTime> value
                ))
            {
                string user_id = InternalTools.GetNewUserID();
                if (SQLDB.UpdatePassword(value.Key, req.Password))
                {
                    response.NextLabel = Guid.NewGuid();
                }
            }

            datagram.DataType    = DatagramType.Client;
            datagram.MessageType = LoginMessageType.UpdatePWFinishRes;
            datagram.Datas       = response.ToByteArray();

            if (!Send(datagram.ToByteArray()))
            {
                Notify(IKXTServer.LogLevel.Error, "数据发送异常");
                Close();
            }
        }
Ejemplo n.º 2
0
        bool IDataSender.UpdatePWFinishReq(Guid request_id, UpdatePWFinishReq req)
        {
            Datagram datagram = new Datagram
            {
                DataType    = DatagramType.Login,
                MessageType = LoginMessageType.UpdatePWFinishReq,
                RequestID   = request_id,
                Datas       = req.ToByteArray()
            };

            return(Send(datagram));
        }