示例#1
0
    public void LoginToLoginServer(string ip_, int port_, string account_, uint zoneId_)
    {
        m_loginIP   = ip_;
        m_loginPort = port_;
        m_account   = account_;
        m_zoneId    = zoneId_;

        if (m_thread.InitLoginClient(ip_, port_))
        {
            Cmd.VerifyVersion verify = new Cmd.VerifyVersion();
            verify.clientversion = 2017;
            Serializer.Serialize <Cmd.VerifyVersion>(m_pbStream, verify);
            SendMsgToLogin(verify.id, m_pbStream.ToArray());

            Cmd.LoginReq login = new Cmd.LoginReq();
            login.account  = Encoding.UTF8.GetBytes(m_account);
            login.verifier = "this is verifier code";
            login.zoneid   = m_zoneId;
            Serializer.Serialize <Cmd.LoginReq>(m_pbStream, login);
            SendMsgToLogin(login.id, m_pbStream.ToArray());
        }
        else
        {
            Utility.LogError("login to login server failed (ip:" + ip_ + ":" + port_ + ")");
        }
    }
示例#2
0
    public void LoginToLoginServer(string ip_, int port_)
    {
        if (m_thread.InitLoginClient(ip_, port_))
        {
            m_loginIP   = ip_;
            m_loginPort = port_;

            Cmd.VerifyVersion verify = new Cmd.VerifyVersion();
            verify.clientversion = 2017;
            Serializer.Serialize <Cmd.VerifyVersion>(m_pbStream, verify);
            SendMsgToLogin(verify.id, m_pbStream.ToArray());

            Cmd.LoginReq login = new Cmd.LoginReq();
            login.accountid = 9527;
            login.verifier  = "this is verifier code";
            Serializer.Serialize <Cmd.LoginReq>(m_pbStream, login);
            SendMsgToLogin(login.id, m_pbStream.ToArray());
        }
        else
        {
            Debug.LogError("login to login server failed (ip:" + ip_ + ":" + port_ + ")");
        }
    }