예제 #1
0
    private void OnRegisterClick(object[] param)
    {
        if (m_RegisterWindow != null)
        {
            if (string.IsNullOrEmpty(m_RegisterWindow.IFAccount.text))
            {
                TipsUtil.ShowWindowTips(LanguageUtil.GetStrById(1000101), LanguageUtil.GetStrById(1000110));
                return;
            }
            if (string.IsNullOrEmpty(m_RegisterWindow.IFPwd.text))
            {
                TipsUtil.ShowWindowTips(LanguageUtil.GetStrById(1000102), LanguageUtil.GetStrById(1000110));
                return;
            }
            if (string.IsNullOrEmpty(m_RegisterWindow.IFAgainPwd.text))
            {
                TipsUtil.ShowWindowTips(LanguageUtil.GetStrById(1000103), LanguageUtil.GetStrById(1000110));
                return;
            }
            if (!string.Equals(m_RegisterWindow.IFPwd.text, m_RegisterWindow.IFAgainPwd.text))
            {
                TipsUtil.ShowWindowTips(LanguageUtil.GetStrById(1000104), LanguageUtil.GetStrById(1000110));
                return;
            }
        }
        AccountRegisterRequestProto proto = new AccountRegisterRequestProto();

        proto.Account          = m_RegisterWindow.IFAccount.text;
        proto.Pwd              = m_RegisterWindow.IFPwd.text;
        proto.Channel          = "0";
        proto.DeviceIdentifier = DeviceUtil.DeviceIdentifier;
        proto.DeviceModel      = DeviceUtil.DeviceModel;
        NetWorkSocket.Instance.SendMsg(proto.ToArray());
    }
예제 #2
0
    private void OnAccountRegisterRequest(Role role, byte[] buffer)
    {
        AccountRegisterRequestProto proto = AccountRegisterRequestProto.GetProto(buffer);
        //Console.WriteLine(proto.Account + "  " + proto.Pwd + "   " + proto.Channel);
        AccountRegisterResponseProto responseProto = Register(proto.Account, proto.Pwd, proto.Channel, proto.DeviceIdentifier, proto.DeviceModel);

        //AccountCacheModel.Instance.Register
        role.ClientSocket.SendMsg(responseProto.ToArray());
    }
    public static AccountRegisterRequestProto GetProto(byte[] buffer)
    {
        AccountRegisterRequestProto proto = new AccountRegisterRequestProto();

        using (MMO_MemoryStream ms = new MMO_MemoryStream(buffer))
        {
            proto.Account          = ms.ReadUTF8String();
            proto.Pwd              = ms.ReadUTF8String();
            proto.Channel          = ms.ReadUTF8String();
            proto.DeviceIdentifier = ms.ReadUTF8String();
            proto.DeviceModel      = ms.ReadUTF8String();
        }
        return(proto);
    }