EllanJiang / GameFramework

This is literally a game framework, based on Unity game engine. It encapsulates commonly used game modules during development, and, to a large degree, standardises the process, enhances the development speed and ensures the product quality.

Home Page:https://GameFramework.cn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SendHeartBeat or !SendHeartBeat

alexddhuang opened this issue · comments

if (sendHeartBeat && m_NetworkChannelHelper.SendHeartBeat())

Do I misunderstand this code? I think that this condition should be replaced by

 if (sendHeartBeat && !m_NetworkChannelHelper.SendHeartBeat()) 

After I have successfully sent a heartbeat, it shouldn't report missing a heartbeat.

Could you please actively resolve questions from users? Thanks. @EllanJiang

The counter will increment when a heart beat is sent successfully rather than the opposite. When the response from server is received, the counter will reset. So when the sending counter exceeds some number, it means the we keeps failing to receive server responses.