pub async fn tcp_login_raw(
conn: &BackendConn,
client_key: &[u8],
target: TcpLoginTarget<'_>,
channel: TcpLoginChannel<'_>,
) -> Result<LoginResult>Expand description
执行 TCP 登录(通用版 —— 同时用于 Platform cmd=6001 和 Broker cmd=1001)
构造 ReqEncryptData → AES-CBC-MD5 加密(key=完整 client_key,
32 字节时是 AES-256) → 放进 LoginReq.encrypt_data → 发指定 cmd。
对齐 logger.cpp:150-220 —— 该函数是 C++ SendNormalLoginProtocol 的等价
实现,cmd=6001/1001 共用同一套 ReqEncryptData 字段布局,只是以下三个值
随通道变化:
cmd_id:6001=kCmdLoginPlatform,1001=kCmdLoginBrokerconn_identity:Platform 是 1-6(按 UserAttribution),Broker 是 1001/1007/…effective_user_id:Platform 是 uid,Broker 是 customer_id (cid) —— 对齐 C++channel_->outer_uid_(logger.cpp:107,120,161,194)
TcpLoginChannel::client_sig:Platform 用 auth.client_sig,Broker 用 broker_client_sig。