Exemple #1
0
        public void RequireRoleList()
        {
            NFMsg.ReqRoleList xData = new NFMsg.ReqRoleList();
            xData.game_id = mLoginModule.mServerID;
            xData.account = ByteString.CopyFromUtf8(mLoginModule.mAccount);

            MemoryStream stream = new MemoryStream();

            xData.WriteTo(stream);

            mNetModule.SendToServerByPB(NFMsg.EGameMsgID.EGMI_REQ_ROLE_LIST, stream);
            Debug.Log("RequireRoleList");
        }
        public void RequireRoleList()
        {
            NFMsg.ReqRoleList xData = new NFMsg.ReqRoleList();
            xData.game_id = mLoginModule.mServerID;
            xData.account = UnicodeEncoding.Default.GetBytes(mLoginModule.mAccount);

            MemoryStream stream = new MemoryStream();

            Serializer.Serialize <NFMsg.ReqRoleList>(stream, xData);

            mNetModule.SendToServerByPB(NFMsg.EGameMsgID.EGMI_REQ_ROLE_LIST, stream);
            Debug.Log("RequireRoleList");
        }
        // 请求消息
        public void LoginPB(string strAccount, string strPwd, string strKey)
        {
            Debug.Log("LoginPB:" + strAccount);
            NFMsg.ReqAccountLogin xData = new NFMsg.ReqAccountLogin();
            xData.account       = ByteString.CopyFromUtf8(strAccount);
            xData.password      = ByteString.CopyFromUtf8(strPwd);
            xData.security_code = ByteString.CopyFromUtf8(strKey);
            xData.signBuff      = ByteString.CopyFromUtf8("");
            xData.clientVersion = 1;
            xData.loginMode     = 0;
            xData.clientIP      = 0;
            xData.clientMAC     = 0;
            xData.device_info   = ByteString.CopyFromUtf8("");
            xData.extra_info    = ByteString.CopyFromUtf8("");

            mAccount = strAccount;

            MemoryStream stream = new MemoryStream();

            xData.WriteTo(stream);

            mNetModule.SendToServerByPB(NFMsg.EGameMsgID.EGMI_REQ_LOGIN, stream);
        }
        // 请求消息
        public void LoginPB(string strAccount, string strPwd, string strKey)
        {
            Debug.Log("LoginPB:" + strAccount);
            NFMsg.ReqAccountLogin xData = new NFMsg.ReqAccountLogin();
            xData.account       = System.Text.Encoding.Default.GetBytes(strAccount);
            xData.password      = System.Text.Encoding.Default.GetBytes(strPwd);
            xData.security_code = System.Text.Encoding.Default.GetBytes(strKey);
            xData.signBuff      = System.Text.Encoding.Default.GetBytes("");
            xData.clientVersion = 1;
            xData.loginMode     = 0;
            xData.clientIP      = 0;
            xData.clientMAC     = 0;
            xData.device_info   = System.Text.Encoding.Default.GetBytes("");
            xData.extra_info    = System.Text.Encoding.Default.GetBytes("");

            mAccount = strAccount;

            MemoryStream stream = new MemoryStream();

            Serializer.Serialize <NFMsg.ReqAccountLogin>(stream, xData);

            mNetModule.SendToServerByPB(NFMsg.EGameMsgID.EGMI_REQ_LOGIN, stream);
        }