|
发表于 2024-12-18 22:47:25
|
显示全部楼层
贵州省贵阳市
在下面那个Agent_OnReceive()子程序里,处理账号密码的验证。验证方法,我昨天已经给你参考了。
亦可参考:https://bbs.125.la/forum.php?mod=viewthread&tid=14038291
|
Agent_OnConnect | 整数型 | | |
pSender | 整数型 | | | | dwConnID | 整数型 | | | |
m_Agent. GetConnectionExtra (m_spAgent, dwConnID, ServerID ) 如果真 (m_Agent. SendBytes (pSender, dwConnID, { 5, 2, 0, 2 }))  m_Agent. SetConnectionExtra (pSender, dwConnID, 1000000 + ServerID )返回 ( #HR_OK )|
Agent_OnReceive | 整数型 | | |
pSender | 整数型 | | | | dwConnID | 整数型 | | | | pData | 整数型 | | | | iLength | 整数型 | | | |
变量名 | 类 型 | 静态 | 数组 | 备 注 | pBuffer | 字节集 | | | Server_ID | 整数型 | | | 目标地址 | 字节集 | | |
Agent_Recv = Agent_Recv + iLength m_Agent. GetConnectionExtra (pSender, dwConnID, Server_ID ) 判断 (Server_ID > 1000000 且 Server_ID < 2000000 )  pBuffer = 指针到字节集 (pData, iLength ) 调试输出 (pBuffer ) 判断 (取字节集左边 (pBuffer, 2 ) = { 5, 0 })  哈希. 查找 (到字节集 (dwConnID ), 目标地址 )  m_Agent. SendBytes (pSender, dwConnID, { 5, 1, 0, 1 } + 目标地址 )   Server_ID = Server_ID + 1000000   哈希. 删除 (到字节集 (dwConnID ))   m_Agent. SetConnectionExtra (pSender, dwConnID, Server_ID ) 返回 ( #HR_OK )    m_Agent. Disconnect (pSender, dwConnID, 真)  m_Server. Disconnect (m_spServer, Server_ID, 真) 返回 ( #HR_OK )   判断 (Server_ID > 2000000 ) pBuffer = 指针到字节集 (pData, iLength ) 判断 (取字节集左边 (pBuffer, 2 ) = { 5, 0 })  Server_ID = Server_ID - 2000000   m_Agent. SetConnectionExtra (pSender, dwConnID, Server_ID )  m_Server. SetConnectionExtra (m_spServer, Server_ID, dwConnID )  m_Server. PauseReceive (m_spServer, Server_ID, 假)  返回 ( #HR_OK )    m_Agent. Disconnect (pSender, dwConnID, 真)  m_Server. Disconnect (m_spServer, Server_ID, 真) 返回 ( #HR_OK )     m_Server. Send (m_spServer, Server_ID, pData, iLength )返回 ( #HR_OK ) |
评分
-
参与人数 1 | 荣誉 +1 |
收起
理由
|
笨潴
| + 1 |
热心帮助他人,荣誉+1,希望继续努力(*^__^*) 嘻嘻! |
查看全部评分
|